fix: make bolt11 optional in NodePayment (#2005)

This commit is contained in:
jackstar12 2023-10-09 13:02:22 +02:00 committed by GitHub
parent 219838244b
commit a937e09f85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -104,7 +104,7 @@ class NodePayment(BaseModel):
fee: Optional[int] = None
memo: Optional[str] = None
time: int
bolt11: str
bolt11: Optional[str] = None
preimage: Optional[str]
payment_hash: str
expiry: Optional[float] = None

View File

@ -271,7 +271,7 @@ class CoreLightningNode(Node):
result = await self.ln_rpc("listpays")
return [
NodePayment(
bolt11=pay["bolt11"],
bolt11=pay.get("bolt11"),
amount=pay["amount_msat"],
fee=int(pay["amount_msat"]) - int(pay["amount_sent_msat"]),
memo=pay.get("description"),