Uh oh!
There was an error while loading. Please reload this page.
test(platform-wallet): CR-004 — legacy BIP32 UTXO update after spend (FAILING-by-design) - #3613
Conversation
…nd (dash-evo-tool#845) Pin the post-broadcast UTXO-mutation contract on standard_bip32_accounts end-to-end (TEST_SPEC.md → CR-004) and annotate the production call site so a regression in the routing layer lands at a named breadcrumb, not silently in dash-evo-tool's issue tracker. Test (FAILING-by-design until SPV runtime gates clear and the harness exposes a stable BIP32 receive-address derivation point): - Funds the legacy BIP32 account 0 with two distinct UTXOs via the existing bank.send_core_to helper (no harness refactor — derives the BIP32 receive address inline by mirroring the BIP-44 helper shape on standard_bip32_accounts). - Asserts no cross-account contamination: BIP-44 stays empty, BIP-32 ends up at exactly 2 spendable UTXOs before the broadcast. - Sweeps the legacy account via send_to_addresses(BIP32Account, 0, ...). - POST-pin: standard_bip32_accounts[0].spendable_utxos == empty AND a follow-up send fails with TransactionBuild naming an empty input set (NOT Ok(...) — the bug surface from dash-evo-tool#845 is exactly the Ok-with-phantom-UTXOs case). Production breadcrumb (no behavior change): - broadcast.rs:185 (the post-broadcast check_core_transaction(Mempool) hook) gains a TODO(CR-004) docstring naming the BIP32-routing contract and a tracing::debug! that surfaces the affected account_type + tx outpoint counts. The downstream routing in key_wallet::TransactionRouter::get_relevant_account_types currently DOES include StandardBIP32 for TransactionType::Standard at the pinned revision; the breadcrumb makes a future drop-out visible at a single grep-able call site. Verification: - cargo check -p platform-wallet --tests ok - cargo clippy -p platform-wallet --tests --all-features -- -D warnings clean - cargo fmt --all -- --check clean - cargo test -p platform-wallet --lib 149 passed Refs: dashpay/dash-evo-tool#845, TEST_SPEC.md → CR-004 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…GN env-var guard for CR-004 (QA-V18-003) `#[ignore]` is bypassed by `cargo test -- --ignored`, which runs every ignored case — so CR-004's FAILING-by-design body still panicked and polluted the standard ignored-cohort run. Add a runtime opt-in guard at the top of the test body: unless `PLATFORM_WALLET_E2E_RUN_FAILING_BY_DESIGN` is truthy (`1`/`true`/`yes`/`on`, case-insensitive) the test early-returns as a passing no-op with an `eprintln!` breadcrumb. Operators who want to exercise the pinned regression set the var explicitly. Also declare the new env-var key in `framework::config::vars` next to `DISABLE_SPV` so the cohort of operator-facing knobs stays in one place; the existing `parse_truthy` helper handles the truthy parse so no new logic is needed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… env-gate `fafa5b4fa9` references `crate::framework::config::parse_truthy` which was introduced in `d1d81a3294` (DISABLE_SPV feature) on the source branch but is absent from `feat/rs-platform-wallet-e2e` at the base commit. Add just the helper function here so the env-gate compiles without pulling in the full DISABLE_SPV harness changes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 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 |
…th (#3613 review) Trim the 12-line TODO(CR-004 / dash-evo-tool#845) commentary on `send_to_addresses` post-broadcast hook to a 3-line marker pointing at the e2e test name. Drop the 9-line `tracing::debug!` call that fired on every standard-tx broadcast — it logged an invariant the CR-004 test asserts via state inspection, not via log scraping, and hot-path logging of static invariants violates the project logging policy (skill: coding-best-practices § Logging Levels). Addresses F-001 (MEDIUM) and F-002 (MEDIUM) in audit report. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…3613 review) Trim the 33-line module docstring to a 10-line present-state summary; the call-site walkthrough and "Why FAILING-by-design and not WIRED" framing belong in the PR description / git history, not in source. Collapse multi-paragraph assertion messages to single-line essence naming the contract violated. Drop dangling references to "module docstring point 3" now that the numbered list is gone. Addresses F-003, F-004, F-005 (LOW) in audit report. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…o test/cr-004-legacy-bip32-utxo # Conflicts: # packages/rs-platform-wallet/tests/e2e/framework/config.rs
Uh oh!
There was an error while loading. Please reload this page.
Issue being fixed or feature implemented
Reproduces dashpay/dash-evo-tool#845 — after spending from a legacy BIP-32 account, the wallet's UTXO state is not updated, leaving phantom spendable UTXOs that cause subsequent sends to appear to succeed while silently using already-spent inputs.
TEST_SPEC.md entry already merged via #3610. This PR brings only the test.
What was done?
packages/rs-platform-wallet/tests/e2e/cases/cr_004_legacy_bip32_utxo_update_after_spend.rs— the end-to-end regression test for dash-evo-tool#845.cr_004incases/mod.rs.parse_truthyhelper toframework::config(prerequisite for the env-gate; introduced on the source branch in an out-of-scope commit, brought over as a minimal helper).PLATFORM_WALLET_E2E_RUN_FAILING_BY_DESIGN=1— without that var, the test body early-returns as a passing no-op, keeping standard--ignoredruns clean.Note: the cherry-picked commit also adds a
TODO(CR-004)comment andtracing::debug!breadcrumb tobroadcast.rs— no behavior change, companion annotation only.How Has This Been Tested?
cargo build --tests --no-default-features— PASScargo build --tests— PASScargo clippy --tests --all-features -- -D warnings— cleancargo fmt --all -- --check— cleancargo test --test e2e cr_004 -- --listconfirms the test is discoverableBreaking Changes
None.
Checklist:
🤖 Co-authored by Claudius the Magnificent AI Agent