Mark Keysets as Deleted.
Fixes #731
Summary
This PR fixes the wallet behavior when a keyset disappears from a mint's /keysets response.
Changes
- Updated
load_mint_keysetsto mark missing keysets as inactive. - Added
update_keyset_activeincrud.pyto use named SQL parameters for SQLAlchemy async compatibility. - Verified with
pytest tests/wallet/test_wallet.py -k keyset(all keyset tests now pass).
LGTM but one outstanding question regarding the removed line
await self.load_keysets_from_db()what's the justification for that?
@callebtc I replaced "await self.load_keysets_from_db()" because we now build self.keysets inline with the already-fetched list (keysets_in_db) filtered by k.unit == self.unit and k.active. That list is fresh (we re-fetch after marking inactive), so the old helper’s extra query + loop is redundant. The trace message is still printed two lines below, so no observability is lost.
Hi @KvngMikey, sorry for getting back to you late. We have a crud called update_keyset that supports setting the active flag (latest main also can update the fee, worth a merge of main into this branch). Why not use that directly?
Hi @KvngMikey, sorry for getting back to you late. We have a crud called
update_keysetthat supports setting theactiveflag (latest main also can update the fee, worth a merge of main into this branch). Why not use that directly?
hi @callebtc , thanks for checking my work, I have addressed your request now.