diff --git a/tests/test_wallet_subscription.py b/tests/test_wallet_subscription.py index d81896da..90346527 100644 --- a/tests/test_wallet_subscription.py +++ b/tests/test_wallet_subscription.py @@ -3,7 +3,7 @@ import pytest import pytest_asyncio -from cashu.core.base import Method, ProofState +from cashu.core.base import Method, MintQuoteState, ProofState from cashu.core.json_rpc.base import JSONRPCNotficationParams from cashu.core.nuts import WEBSOCKETS_NUT from cashu.core.settings import settings @@ -61,10 +61,13 @@ 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[1].payload["paid"] is True + assert msg_stack[2].payload["state"] == MintQuoteState.paid.value assert msg_stack[2].payload["paid"] is True + assert msg_stack[2].payload["state"] == MintQuoteState.issued.value @pytest.mark.asyncio @@ -103,16 +106,16 @@ def callback(msg: JSONRPCNotficationParams): pending_stack = msg_stack[:n_subscriptions] for msg in pending_stack: proof_state = ProofState.parse_obj(msg.payload) - assert proof_state.state.value == "UNSPENT" + assert proof_state.state == ProofState.state.unspent # the second one is the PENDING state spent_stack = msg_stack[n_subscriptions : n_subscriptions * 2] for msg in spent_stack: proof_state = ProofState.parse_obj(msg.payload) - assert proof_state.state.value == "PENDING" + assert proof_state.state == ProofState.state.pending # the third one is the SPENT state spent_stack = msg_stack[n_subscriptions * 2 :] for msg in spent_stack: proof_state = ProofState.parse_obj(msg.payload) - assert proof_state.state.value == "SPENT" + assert proof_state.state == ProofState.state.spent