test(wallet): make the TxStatus fixture actually call chia_query's ack_to_tx_status - #444
Conversation
The mutation proof — the test is load-bearingThe edit is only worth anything if the fixture now catches what its doc claims. Proved by RED — with the label renamedThat panic message is exactly the production failure the ticket predicted: a renamed label makes GREEN — patch removed,
|
Doc overclaim corrected —
|
2d3a12e to
d376c2c
Compare
Rebased onto
|
…stating it The `ack()` fixture hand-built a `TxStatus` from its own string literals while its doc claimed a change to `ack_to_tx_status` would "show up here as a failure". It could not: the crate mapping was never called. `accepted_by_mempool` compares against the literal "SUCCESS", so a rename in chia-query would refuse every push with both tests still green. The fixture now takes a status byte and returns `chia_query::peer::translate::ack_to_tx_status(status)`, making the asserted coupling real. Refs #438 Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
The doc added in the previous commit claimed the tests catch a flipped `success` flag. They do not: `accepted_by_mempool` reads only `status`, deliberately, because `success` conflates ACCEPTED with PENDING (DIG-Network/chia-query#48). Claiming otherwise reproduced -- one line below the fix -- the born-false coupling claim this change exists to remove. State what the fixture does catch (a label rename, proven by mutation) and name the flag as out of scope by design rather than by omission. Refs #438 Co-Authored-By: Claude <noreply@anthropic.com>
d376c2c to
2078873
Compare
Rebased onto
|
| mine | main | |
|---|---|---|
| workspace | 0.185.0 |
0.183.0 |
dig-wallet |
0.42.1 |
0.42.0 |
Diff vs origin/main is unchanged at 46 lines, and spend.rs still has zero CR bytes — the
conflict resolution read and wrote with newline='', so no line endings flipped:
Cargo.lock | 4 ++--
Cargo.toml | 2 +-
crates/dig-wallet/Cargo.toml | 2 +-
crates/dig-wallet/src/sage/spend.rs | 38 +++++++++++++++++++++----------------
4 files changed, 26 insertions(+), 20 deletions(-)
cargo fmt --all -- --check clean workspace-wide; working tree clean.
Checks at 2078873, read unpiped
All 14 SUCCESS, zero non-green (Attach packages to the release SKIPPED — not a PR-path job).
The mutation proof was not re-run for this rebase: the conflict touched only the two version
manifests, and crates/dig-wallet/src/sage/spend.rs is byte-identical to the tree the proof ran
against at d376c2c (RED on the label rename, GREEN restored, running 16 tests both times).
Saying so explicitly rather than implying fresh evidence.
Closes #438. Child of https://github.com/DIG-Network/dig_ecosystem/issues/3166.
What changed
crates/dig-wallet/src/sage/spend.rstest fixture only. No production code.The
ack()fixture hand-built achia_query::TxStatusfrom its own stringliterals while its doc claimed a change to
ack_to_tx_status"shows up here as afailure". It could not — the crate's mapping was never called, so the coupling the
doc asserted did not exist.
ack()now takes a status byte and returnschia_query::peer::translate::ack_to_tx_status(status). NamedACK_SUCCESS/ACK_PENDING/ACK_FAILED/ACK_UNKNOWNconstants keep the call sites readingas the acks a full node actually sends.
Why it mattered
accepted_by_mempoolcompares against the literal"SUCCESS". If chia-queryrenamed that label nothing in this repo would notice: the node would silently
refuse every push, and both tests would stay green. It fails closed, so it was
non-gating — but it is the born-false-coupling class this family has now hit five
times, and deleting the doc sentence would close the claim while leaving the gap.
Blast radius
impactonack— the symbol is a#[cfg(test)]helper private tosage::spend::tests, with exactly two callers, both in that module(
a_pending_ack_is_not_an_accepted_broadcast,only_a_success_ack_reports_an_accepted_broadcast). Nothing outside the testmodule can reach it, so the radius is the two tests changed here. Verified against
the shipped crate source that
chia_query::peer::translate::ack_to_tx_statusispublic and reachable under the
nativefeature dig-wallet already enables(
lib.rs:34→peer/mod.rs:8).accepted_by_mempoolandChiaQueryBroadcaster::broadcastare untouched — sibling lane #441 is live on thatproduction path.
How verified
Proof the test is now load-bearing: with the label for status
1changed in thevendored
chia-querysource, the fixture goes RED; restored, it goes green. Bothoutputs are in a comment below.
Version
0.179.0→0.179.1(root workspace) anddig-wallet0.42.0→0.42.1—patch, test-only, no behaviour change.