1
0

invoices: make sure that OnchainInvoice .exp and .time are not None

related: #6284
This commit is contained in:
SomberNight
2020-06-27 02:23:46 +02:00
parent 2db0ad10db
commit dee5d52948
3 changed files with 30 additions and 6 deletions

View File

@@ -113,9 +113,9 @@ class Invoice(StoredObject):
@attr.s
class OnchainInvoice(Invoice):
message = attr.ib(type=str, kw_only=True)
amount_sat = attr.ib(kw_only=True) # type: Union[None, int, str] # in satoshis. can be '!'
exp = attr.ib(type=int, kw_only=True)
time = attr.ib(type=int, kw_only=True)
amount_sat = attr.ib(kw_only=True) # type: Union[int, str] # in satoshis. can be '!'
exp = attr.ib(type=int, kw_only=True, validator=attr.validators.instance_of(int))
time = attr.ib(type=int, kw_only=True, validator=attr.validators.instance_of(int))
id = attr.ib(type=str, kw_only=True)
outputs = attr.ib(kw_only=True, converter=_decode_outputs) # type: List[PartialTxOutput]
bip70 = attr.ib(type=str, kw_only=True) # type: Optional[str]