mirror of
https://github.com/aljazceru/nutshell.git
synced 2026-01-06 10:24:21 +01:00
NUT-04 and NUT-05: Add state field to quotes (#560)
* wip adding states, tests failing * add state field to quotes * responses from quotes * store correct state * cleaner test * fix swap check * oops
This commit is contained in:
@@ -3,7 +3,7 @@ import asyncio
|
||||
import pytest
|
||||
import pytest_asyncio
|
||||
|
||||
from cashu.core.base import SpentState
|
||||
from cashu.core.base import ProofSpentState
|
||||
from cashu.mint.ledger import Ledger
|
||||
from cashu.wallet.wallet import Wallet
|
||||
from tests.conftest import SERVER_ENDPOINT
|
||||
@@ -63,7 +63,7 @@ async def test_regtest_pending_quote(wallet: Wallet, ledger: Ledger):
|
||||
|
||||
# expect that proofs are still pending
|
||||
states = await ledger.db_read.get_proofs_states([p.Y for p in send_proofs])
|
||||
assert all([s.state == SpentState.pending for s in states])
|
||||
assert all([s.state == ProofSpentState.pending for s in states])
|
||||
|
||||
# only now settle the invoice
|
||||
settle_invoice(preimage=preimage)
|
||||
@@ -71,7 +71,7 @@ async def test_regtest_pending_quote(wallet: Wallet, ledger: Ledger):
|
||||
|
||||
# expect that proofs are now spent
|
||||
states = await ledger.db_read.get_proofs_states([p.Y for p in send_proofs])
|
||||
assert all([s.state == SpentState.spent for s in states])
|
||||
assert all([s.state == ProofSpentState.spent for s in states])
|
||||
|
||||
# expect that no melt quote is pending
|
||||
melt_quotes = await ledger.crud.get_all_melt_quotes_from_pending_proofs(
|
||||
|
||||
Reference in New Issue
Block a user