From 7f60f05e3d227e21809584f61fd47ad827298e85 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Wed, 26 Jun 2024 03:00:08 +0200 Subject: [PATCH] oops --- cashu/wallet/cli/cli.py | 4 ++-- tests/conftest.py | 2 +- tests/test_wallet_subscription.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cashu/wallet/cli/cli.py b/cashu/wallet/cli/cli.py index 3bfad207..d64a4b1c 100644 --- a/cashu/wallet/cli/cli.py +++ b/cashu/wallet/cli/cli.py @@ -15,7 +15,7 @@ from click import Context from loguru import logger -from ...core.base import Invoice, Method, TokenV3, Unit +from ...core.base import Invoice, Method, MintQuoteState, TokenV3, Unit from ...core.helpers import sum_proofs from ...core.json_rpc.base import JSONRPCNotficationParams from ...core.logging import configure_logger @@ -299,7 +299,7 @@ def mint_invoice_callback(msg: JSONRPCNotficationParams): # we need to sleep to give the callback map some time to be populated time.sleep(0.1) if ( - quote.paid + (quote.paid or quote.state == MintQuoteState.paid.value) and quote.request == invoice.bolt11 and msg.subId in subscription.callback_map.keys() ): diff --git a/tests/conftest.py b/tests/conftest.py index ed3dc2f1..a76d3ce4 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -33,7 +33,7 @@ settings.wallet_unit = "sat" settings.mint_backend_bolt11_sat = settings.mint_backend_bolt11_sat or "FakeWallet" settings.fakewallet_brr = True -settings.fakewallet_delay_outgoing_payment = None +settings.fakewallet_delay_outgoing_payment = 0 settings.fakewallet_delay_incoming_payment = 1 settings.fakewallet_stochastic_invoice = False assert ( diff --git a/tests/test_wallet_subscription.py b/tests/test_wallet_subscription.py index d94d38a8..d4705926 100644 --- a/tests/test_wallet_subscription.py +++ b/tests/test_wallet_subscription.py @@ -55,10 +55,10 @@ def callback(msg: JSONRPCNotficationParams): assert len(msg_stack) == 3 assert msg_stack[0].payload["paid"] is False - assert msg_stack[1].payload["state"] == MintQuoteState.unpaid.value + assert msg_stack[0].payload["state"] == MintQuoteState.unpaid.value assert msg_stack[1].payload["paid"] is True - assert msg_stack[2].payload["state"] == MintQuoteState.paid.value + assert msg_stack[1].payload["state"] == MintQuoteState.paid.value assert msg_stack[2].payload["paid"] is True assert msg_stack[2].payload["state"] == MintQuoteState.issued.value