#36614 test: check algorithm after SelectionResult::Merge

ReviewabilityReviewsAgreementSize
#36614 Naomi-Gift test: check algorithm after SelectionResult::MergeReady1Strong0 + 23 tests
  • Preserve coin selection algorithm reporting when combining preset manual inputs with automatic selection
  • Prevents unnoticed regressions in selection metadata reporting
  • Ready for review
  • Strong support with no open objections
  • Verified by confirming the new test kills a surviving mutation (mercie-ux)
  • 0 lines added or modified outside tests
  • 23 lines added or modified in tests
  • 0 lines removed in total
  • 1 files, 1 commits
Wallet#87 of 92
P4 · test coverage
  • P4 after comparing with the other PRs here (assessed alone as P3): Lowered from P3: one narrow mutation-killing unit test, equivalent in consequence to the other test-only P4 entries.
  • P3 because it adds regression test coverage for coin selection metadata retention
  • Kills a surviving mutant found by mutation testing tools
Reviewability: ReadyStalePaused
Agreement: StrongPositivePositive w/ caveatsNeutralMildDisputedBlockedCrickets
Reviews: current code-review ACKs, then (+stale ACKs) and -NACKs; greener = more ACKs.
Size: lines added or modified outside tests, then in tests; greener = smaller.

Goal

Adds a unit test to verify that SelectionResult::Merge preserves the automatic selection algorithm when merging manual preset inputs and automatic coin selection results. It checks that merging manual inputs into an automatic selection retains the automatic algorithm, and merging an automatic selection into a manual one adopts the automatic algorithm.

Problem: Selection algorithm metadata retention in SelectionResult::Merge is not directly tested when combining preset MANUAL inputs with automatic selection results, risking unnoticed regressions in selection reporting.

Evidence of importance:

  • Author notes that applying a mutation to the merge behavior causes both test cases to fail with 'manual != bnb' (PR description)

Risk of a mistake: low (tests, wallet). Test-only addition to coin selection unit tests that does not touch production code.

Reviewability

Ready

Nothing known that would invalidate a review now.

Waiting on (from the thread read):

  • nothing

Agreement

Strong

substantive support, no open objection (mercie-ux)

Thread notes: Added tested ACK from mercie-ux.

Objections, suggestions, and questions: none recorded.

Support:

  • mercie-ux (contributor) (ACK, 2026-10-23) [both: src/wallet/coinselection.cpp]: covers the surviving mutant in coinselection.cpp; ran bcore-mutation and confirmed merge_algo_test kills it

Participants:

  • fanquake (member, neutral, 1 statements 2026-10-22 to 2026-10-22): pinged murchandamus
  • mercie-ux (contributor, support, 1 statements 2026-10-23 to 2026-10-23): tested and ACKed killing the surviving mutant

Files

23 lines under test/bench/ci.

  • src/wallet/test/coinselector_tests.cpp +23/-0

Card

The short text the ranking pass compares across PRs.

Adds a unit test in coinselector_tests.cpp verifying that SelectionResult::Merge preserves the automatic coin selection algorithm when combining manual preset inputs with automatic selection results. Existing tests did not cover algorithm tracking across merges, leaving reporting behavior open to silent regressions. The author verified effectiveness via mutation testing showing both test cases fail if manual algorithm propagation is altered. This is a low-risk test-only change with no dependencies.

Data

dossier JSON · extract JSON · model ledger, generated 2026-10-24T01:18, confidence high, input hash e2d80572449b340d
thread read through 2026-10-23 (2 statements), head 4959d34130
labels: Tests

Categories

Wallet

P4 · test coverage (assessed alone as P3; Lowered from P3: one narrow mutation-killing unit test, equivalent in consequence to the other test-only P4 entries.)

Adds regression coverage for coin selection algorithm metadata retention after merge, killing a surviving mutation identified by bcore-mutation.

Membership: Adds unit tests for wallet coin selection in src/wallet/test/coinselector_tests.cpp.

Factors: security/stability 0, bug 0, performance 0, user value 0, leverage 0