#36601 test: avoid reusing AssumeUTXO coin insertion method in test fixtures

ReviewabilityReviewsAgreementSize
#36601 l0rinc test: avoid reusing AssumeUTXO coin insertion method in test fixturesReady1Strong0 + 10 tests
  • Decouple routine coin cache unit tests from AssumeUTXO snapshot-loading internals
  • Confine internal snapshot bypasses strictly to dedicated snapshot and fuzz tests
  • Ready to review
  • Support for clean and structured changes with no objections raised (Hamza1610)
  • Verified by running coins_tests and coinsviewoverlay_tests (Hamza1610)
  • 0 lines added or modified outside tests
  • 10 lines added or modified in tests
  • 6 lines removed in total
  • 2 files, 1 commits
Uncategorized15 PRs, unranked
1 rejected
  • Test infrastructure: not a member. Changes unit tests for the coins cache (src/test/coins_tests.cpp and src/test/coinsviewoverlay_tests.cpp) rather than shared test machinery or utilities.
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

Replaces usages of EmplaceCoinInternalDANGER with AddCoin and SpendCoin in unit test fixtures for the coin cache. It limits the use of EmplaceCoinInternalDANGER to dedicated fuzz, simulation, and duplicate-insertion tests that explicitly test snapshot coin insertion.

Problem: Coin-cache test fixtures in coins_tests.cpp and coinsviewoverlay_tests.cpp use EmplaceCoinInternalDANGER to set up test state. Because that method is an internal bypass intended strictly for AssumeUTXO snapshot loading, using it in routine test fixtures unnecessarily couples standard cache tests to snapshot-specific mechanisms.

Evidence of importance:

  • Author description notes this decouples standard test fixtures and follows an earlier review suggestion on PR #35295 (discussion_r3421846300).
  • Author notes this is extracted from PR #36598 to allow independent review.

Scope: Small test-only change (+10/-6 across two test files).

Risk of a mistake: low (tests). Touches only unit test fixtures in coins_tests.cpp and coinsviewoverlay_tests.cpp; a bug would only cause false test failures.

Reviewability

Ready

Nothing known that would invalidate a review now.

Waiting on (from the thread read):

  • nothing

Agreement

Strong

substantive support, no open objection (Hamza1610)

Thread notes: Initial record. PR received a Tested ACK from Hamza1610 with no objections or suggestions raised. / Initial record. Hamza1610 provided a Tested ACK running unit tests.

Objections, suggestions, and questions: none recorded.

Support:

  • Hamza1610 (none) (Tested ACK, 2026-10-23) [tested: coins_tests, coinsviewoverlay_tests]: clean and structured changes; passed coins_tests and coinsviewoverlay_tests

Participants:

  • Hamza1610 (none, support, 1 statements 2026-10-23 to 2026-10-23): Tested ACK with test suite execution

Dependencies

Enables:

Base for: #36598

Files

16 lines under test/bench/ci.

  • src/test/coinsviewoverlay_tests.cpp +8/-4
  • src/test/coins_tests.cpp +2/-2

Card

The short text the ranking pass compares across PRs.

This PR replaces calls to EmplaceCoinInternalDANGER with AddCoin and SpendCoin across several coin cache unit test fixtures. It resolves the misuse of an internal AssumeUTXO snapshot-loading method for standard test fixture setup, keeping routine test coverage cleanly separated from snapshot loading internals. The change follows a review suggestion from PR #35295 and is extracted as an independent prerequisite for PR #36598.

Data

dossier JSON · extract JSON · model ledger, generated 2026-10-24T01:18, confidence high, input hash 20a5529d6dae73a1
thread read through 2026-10-23 (1 statements), head 1c62336903
labels: Tests