Skip to content

Commit

Permalink
oops
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc committed Jun 26, 2024
1 parent d81210e commit 7f60f05
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cashu/wallet/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
):
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
4 changes: 2 additions & 2 deletions tests/test_wallet_subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7f60f05

Please sign in to comment.