Skip to content

Commit b1ab9f1

Browse files
nesitorAndres D. Molins
andauthored
Feature: Implement credit payment method and is_credit property. (#133)
Co-authored-by: Andres D. Molins <[email protected]>
1 parent b3a39e1 commit b1ab9f1

File tree

1 file changed

+7
-2
lines changed
  • aleph_message/models/execution

1 file changed

+7
-2
lines changed

aleph_message/models/execution/base.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@ class PaymentType(str, Enum):
2828

2929
hold = "hold"
3030
superfluid = "superfluid"
31+
credit = "credit"
3132

3233

3334
class Payment(HashableModel):
3435
"""Payment information for a program execution."""
3536

36-
chain: Chain
37+
chain: Optional[Chain] = None
3738
"""Which chain to check for funds"""
3839
receiver: Optional[str] = None
3940
"""Optional alternative address to send tokens to"""
@@ -42,7 +43,11 @@ class Payment(HashableModel):
4243

4344
@property
4445
def is_stream(self):
45-
return self.type != PaymentType.hold
46+
return self.type == PaymentType.superfluid
47+
48+
@property
49+
def is_credit(self):
50+
return self.type == PaymentType.credit
4651

4752

4853
class Interface(str, Enum):

0 commit comments

Comments
 (0)