feat(rs-platform-wallet): SPV runtime accessors + FFI error mapping#3651
feat(rs-platform-wallet): SPV runtime accessors + FFI error mapping#3651lklimek wants to merge 1 commit into
Conversation
Carve-out of clusters D, E, K from #3549 (e2e framework PR) as an independent production change on v3.1-dev. D — SPV runtime accessors: SpvRuntime::cancel_background() (sync cancellation-token fire for panic-hook data-dir-lock release) and SpvRuntime::event_manager(); IdentityManager::identity_ids() snapshot. E — FFI error mapping: dedicated ErrorNoSelectableInputs=14 (and reserved ErrorArithmeticOverflow=13); NoSpendableInputs / OnlyOutputAddressesFunded / OnlyDustInputs now map to the dedicated FFI code instead of flattening to ErrorUnknown. K — DAPI dispatch trace log: one tracing::trace! emitting the resolved endpoint/method. Pure observability. E's match arm consumes three PlatformWalletError variants that live in the still-open #3554 (OnlyOutputAddressesFunded, OnlyDustInputs) and #3585 (NoSpendableInputs). Per maintainer decision this PR is independent on v3.1-dev and copies those variant definitions verbatim so it compiles standalone; duplicate definitions are expected and resolved at merge. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Provenance correction (narrative-level, no history rewrite) The commit message of The accurate provenance and the deliberate-duplication / merge-conflict caveat are now documented in the Provenance & strategy section of the PR description. Commit history was intentionally NOT rewritten (no amend/force-push) so the immutable commit record stays intact; the correction lives at the PR-narrative level only. The error variants Co-authored by Claudius the Magnificent AI Agent |
Summary
Independent carve-out of three small production clusters (D, E, K) extracted from #3549 (the e2e-framework PR), so they can land on
v3.1-devwithout waiting for the large e2e suite. No companion issue — this PR is the unit of work tracking. Single commit62e03c6298.D — SPV runtime accessors (
spv/runtime.rs,wallet/identity/state/manager/accessors.rs)SpvRuntime::cancel_background()— sync cancellation-token fire so a panic hook can release the SPV data-dir lock.SpvRuntime::event_manager()accessor.IdentityManager::identity_ids()snapshot helper.E — FFI error mapping (
rs-platform-wallet-ffi/src/error.rs)ErrorArithmeticOverflow = 13(reserved, ABI placeholder) andErrorNoSelectableInputs = 14.NoSpendableInputs/OnlyOutputAddressesFunded/OnlyDustInputsnow map to the dedicated FFI code instead of flattening toErrorUnknown; typedDisplayrendering survives in the message. Catch-allErrorUnknownretained for unmapped variants.K — DAPI dispatch trace log (
rs-dapi-client/src/dapi_client.rs)tracing::trace!emitting the resolved DAPI endpoint/method. Pure observability, no behavior change.Copied error variants (
rs-platform-wallet/src/error.rs)NoSpendableInputs,OnlyOutputAddressesFunded,OnlyDustInputsplus their imports — definitions byte-identical to the canonical fix(platform-wallet): auto_select_inputs honors Σ inputs == Σ outputs #3554/fix: case-insensitive .dash + atomic state on broadcast failure #3585 sources.Provenance & strategy
This PR is intentionally independent on
v3.1-dev(not stacked on #3554/#3585) per an explicit operator directive given during the carve-out session — NOT a separate project-maintainer ruling. The verbatim operator directive was: "Create an independent PR on top of v3.1-dev and copy these new errors there. We'll handle conflicts during merge."The commit message's "Per maintainer decision this PR is independent on
v3.1-dev" wording is inaccurate and is corrected here at the PR-narrative level. There was no dashpay/platform maintainer decision; the true provenance is the in-session operator directive quoted above. History was deliberately not rewritten (see the PR comment) so the immutable commit record stays intact.The error-enum variants
NoSpendableInputs(from #3585),OnlyOutputAddressesFundedandOnlyDustInputs(from #3554) are copied verbatim and deliberately duplicated so D+E+K compiles standalone. These definitions WILL collide with #3554/#3585 at merge time — this is expected and accepted; the conflicts are to be resolved at merge (the definitions are identical, so resolution is mechanical). A human maintainer should explicitly ratify this deliberate-duplication strategy before this PR is un-drafted / merged.Test plan / How Has This Been Tested?
cargo build -p platform-wallet-ffi -p platform-wallet -p rs-dapi-client— clean.cargo clippy -p platform-wallet-ffi -p platform-wallet -p rs-dapi-client— zero diagnostics on changed code (only pre-existing workspaceCargo.tomlprofile warnings, present on untouched base).cargo test -p platform-wallet-ffi --lib error— all passed (incl.no_selectable_inputs_maps_to_dedicated_code,unmapped_variants_fall_through_to_unknown).rustfmt --edition 2021on each touched file.Breaking Changes
None. Additive: new error variants, new FFI result codes (existing codes unchanged), new public accessors, one trace log.
Checklist:
For repository code-owners and collaborators only
🤖 Generated with Claude Code
Co-authored by Claudius the Magnificent AI Agent