Repository navigation
Description
PastaClaw flagged this while reviewing #5210, where it was deferred to a follow-up instead of being fixed in that pull request. This issue tracks the follow-up.
Share the one-time funding-role definition with the asset-lock writer (suggestion)
Where: packages/rs-platform-wallet-storage/src/sqlite/schema/core_pool.rs:556-572 at ce03450e2daa:
platform/packages/rs-platform-wallet-storage/src/sqlite/schema/core_pool.rs
Lines 556 to 572 in ce03450
| /// Labels of the accounts whose keys each fund one asset lock. | |
| /// | |
| /// Such a key leaves the wallet — an invitation exports it — and never shows | |
| /// up as a coin, so the `used` flag or reservation on its pool row is the | |
| /// only record that it is gone. The set is the one the wallet snapshots after | |
| /// an asset-lock build (`persist_asset_lock_account_pools` in | |
| /// `rs-platform-wallet`'s `wallet/asset_lock/build.rs`), which this crate | |
| /// cannot name from there; `one_time_funding_labels_match_the_asset_lock_writer` | |
| /// holds the two together. | |
| const ONE_TIME_FUNDING_LABELS: [&str; 6] = [ | |
| "identity_registration", | |
| "identity_topup", | |
| "identity_topup_unbound", | |
| "identity_invitation", | |
| "asset_lock_address_topup", | |
| "asset_lock_shielded_topup", | |
| ]; |
ONE_TIME_FUNDING_LABELS independently reproduces the funding-account classification in wallet/asset_lock/build.rs::persist_asset_lock_account_pools. The sets currently agree, but their connection is enforced by a test that reads and parses the private writer's source syntax. This makes maintenance of the fail-closed restoration rule depend on another crate's implementation text rather than a typed wallet-domain contract. Export a shared AccountType predicate or equivalent classification API from platform-wallet's asset_lock module and consume it in both paths. Keep database labels, coordinate validation and Strict/Recovery handling in SQLite; translating the shared roles through account_type_db_label removes the parallel semantic lists without moving backend policy into the wallet layer.
Origin
- Pull request: feat(wallet-storage)!: restore complete Core wallet snapshots from SQLite #5210
- Review thread: feat(wallet-storage)!: restore complete Core wallet snapshots from SQLite #5210 (comment)
- Filed by PastaClaw when it accepted the deferral, as nothing else tracked it.
Activity