1
0

tests: add tests for wallet/invoices functionality

only for payment requests ("incoming invoices") for now
This commit is contained in:
SomberNight
2023-01-12 18:08:02 +00:00
parent 8829b7cd63
commit 7dcaa4b204
3 changed files with 276 additions and 3 deletions

View File

@@ -148,9 +148,13 @@ class Invoice(StoredObject):
# 0 means never
return self.exp + self.time if self.exp else 0
@staticmethod
def _get_cur_time(): # for unit tests
return time.time()
def has_expired(self) -> bool:
exp = self.get_expiration_date()
return bool(exp) and exp < time.time()
return bool(exp) and exp < self._get_cur_time()
def get_amount_msat(self) -> Union[int, str, None]:
return self.amount_msat