feat: add inactive and expired keysets to fake wallet test mint ( #1596 ) #1681
No reviewers
Labels
No labels
DB & Storage
Deployment
Error Handling & Logging
Maintenance
Payment Backend
backport
backport v0.13.x
backport v0.14.x
backport v0.15.x
bindings
blocked
bug
cdk-sql
ci
cli
deps
documentation
duplicate
enhancement
good first issue
help wanted
invalid
keep-open
ldk-node-ui
migrations
mint
mutation-testing
needs rebase
needs review
new nut
nut change
question
ready
rust-version
rustfmt
stacked hold
stale
testing
wallet
weekly-report
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
cashubtc/cdk!1681
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/inactive-expired-keysets-fake-wallet"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Add inactive and expired keysets to the fake wallet test mint so downstream wallet tests can exercise keyset filtering logic (closes #1596 ).
The fake mint now performs two keyset rotations at startup, producing:
final_expiryin the past) — expired keyset scenariofinal_expiry) — rotation-deactivated scenarioTo enable this,
run_mintd_with_shutdownwas decomposed intobuild_mint_from_settings+start_mint_services, allowing callers to interact withthe mint between build and service start.
A bug where
final_expirywas hardcoded toNoneinDbSignatory::rotate_keysetwas also fixed as part of this work.Notes to the reviewers
Mint::rotate_keyset()signature gained afinal_expiry: Option<u64>parameter. All existing callers passNoneso behavior is unchanged.MintdInstanceuses a manualDebugimpl becauseDynMintAuthDatabasedoesn't implementDebug.build_mint_from_settings/start_mint_servicespublic API is only used bystart_fake_mint.rsfor now, but could be useful for other test binaries or custom mint setups.Suggested CHANGELOG Updates
CHANGED
Mint::rotate_keyset()now takes an additionalfinal_expiry: Option<u64>parameterADDED
build_mint_from_settings()andstart_mint_services()public API incdk-mintdfor composable mint setupMintdInstancestruct exposing the built mint before services starttest_rotate_keyset_with_expiryintegration testREMOVED
FIXED
final_expirypassthrough inDbSignatory— was hardcoded toNone, now correctly uses the value fromRotateKeyArgumentsChecklist
just final-checkbefore committingThanks for picking this up.
Could we separate the fix of the hard coding the final expiry into its own pr as we can get that in first.
For the issue @robwoodgate opened we need to expose the ability to set these keysets in mintd and specifically in the env that docker uses since that is what cashu-ts uses to test. I believe this pr only exposes it within cdk though that is useful for our testing.
@ -1344,0 +1360,4 @@.field("auth_localstore",&self.auth_localstore.as_ref().map(|_| "<auth_db>"),)I think it maybe better to modify the mint_builder with a fn that adds the keysets in the configuration we want rather then using the rotate_keyset.
@ -1344,0 +1362,4 @@&self.auth_localstore.as_ref().map(|_| "<auth_db>"),).finish()}Why is it required to split this? Can't the rotate just be called on the
Mint?Thanks for the review!
I've separated the final_expiry fix into its own PR: #1686
Regarding the MintBuilder approach that makes sense. I'll rework this PR to add keyset configuration directly in the MintBuilder instead of splitting run_mintd_with_shutdown. Will also look into exposing it via mintd settings/env for Docker.
Closing in favor of #1687, which implements this via
MintBuilderas suggested in the review.Pull request closed