mirror of
https://github.com/aljazceru/nutshell.git
synced 2026-02-23 17:44:30 +01:00
Fix race condition (#586)
* `_set_proofs_pending` performs DB related "proofs are spendable" check inside the lock. * move _verify_spent_proofs_and_set_pending to write.py * edit logging --------- Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
This commit is contained in:
@@ -39,7 +39,7 @@ async def test_mint_proofs_pending(wallet1: Wallet, ledger: Ledger):
|
||||
[s.state == ProofSpentState.unspent for s in proofs_states_before_split.states]
|
||||
)
|
||||
|
||||
await ledger.db_write._set_proofs_pending(proofs)
|
||||
await ledger.db_write._verify_spent_proofs_and_set_pending(proofs)
|
||||
|
||||
proof_states = await wallet1.check_proof_state(proofs)
|
||||
assert all([s.state == ProofSpentState.pending for s in proof_states.states])
|
||||
|
||||
Reference in New Issue
Block a user