HomePhabricator

refactor coins_tests

Description

refactor coins_tests

Summary:
From the PR description:

The last few commits contain significant test refactorings to make coins_tests easier to change in follow-ups.


test, refactor: Migrate GetCoinsMapEntry to return MaybeCoin

https://github.com/bitcoin/bitcoin/pull/30906/commits/ca74aa7490a5005d227da75dc8f2d1ab73c6e9d2


test: Group values and states in tests into CoinEntry wrappers

Note: that this commit affects the test order, but doesn't change its behavior or coverage otherwise.

https://github.com/bitcoin/bitcoin/pull/30906/commits/d5f8d607ab1f8fd9fc17aba4105867b450117be2


test: Validate error messages on fail

The ccoins_add and ccoins_write tests check the actual exception error messages now instead of just that they fail for the given parameters.
This enables us testing different exceptions in a more fine-grained way in later changes.

https://github.com/bitcoin/bitcoin/pull/30906/commits/c0b4b2c1eef95c0b626573a9a2e217f4a541a880


test, refactor: Remove remaining unbounded flags from coins_tests

https://github.com/bitcoin/bitcoin/pull/30906/commits/0a159f0914775756dcac2d9fa7fe4e4d4e70ba0c


test, refactor: Compact ccoins_access and ccoins_spend

Also added an extra check for AccessCoin in CheckAccessCoin to make sure its result is also validated.

https://github.com/bitcoin/bitcoin/pull/30906/commits/50cce20013c97e1257cb9f4c9319701a09b0a196


This concludes backport of core#30906
Depends on D18809

Test Plan: ninja check

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D18810

Details

Provenance
Lőrinc <pap.lorinc@gmail.com>Authored on Sep 16 2024, 11:49
PiRKCommitted on Oct 21 2025, 12:42
PiRKPushed on Oct 21 2025, 12:42
Reviewer
Restricted Project
Differential Revision
D18810: refactor coins_tests
Parents
rABC4f73f04abd45: coins, refactor: Remove direct GetFlags access
Branches
Unknown
Tags
Unknown

Event Timeline