mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-23 11:44:19 +01:00
Mint: Recover pending melts at startup (#499)
* wip works with fakewallet * startup refactor * add tests * regtest tests for pending melts * wip CLN * remove db migration * remove foreign key relation to keyset id * fix: get_promise from db and restore DLEQs * test: check for keyset not found error * fix migrations * lower-case all db column names * add more tests for regtest * simlate failure for lightning * test wallet spent state with hodl invoices * retry * regtest with postgres * retry postgres * add sleeps * longer sleep on github * more sleep for github sigh * increase sleep ffs * add sleep loop * try something * do not pay with wallet but with ledger * fix lnbits pending state * fix pipeline to use fake admin from docker
This commit is contained in:
@@ -151,8 +151,18 @@ class LNbitsWallet(LightningBackend):
|
||||
if "paid" not in data and "details" not in data:
|
||||
return PaymentStatus(paid=None)
|
||||
|
||||
paid_value = None
|
||||
if data["paid"]:
|
||||
paid_value = True
|
||||
elif not data["paid"] and data["details"]["pending"]:
|
||||
paid_value = None
|
||||
elif not data["paid"] and not data["details"]["pending"]:
|
||||
paid_value = False
|
||||
else:
|
||||
raise ValueError(f"unexpected value for paid: {data['paid']}")
|
||||
|
||||
return PaymentStatus(
|
||||
paid=data["paid"],
|
||||
paid=paid_value,
|
||||
fee=Amount(unit=Unit.msat, amount=abs(data["details"]["fee"])),
|
||||
preimage=data["preimage"],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user