Page MenuHomePhabricator

tests: add deterministic chain generation unittest fixture
ClosedPublic

Authored by PiRK on Mar 18 2022, 13:37.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC329ebe963229: tests: add deterministic chain generation unittest fixture
Summary

This is a backport of core#19806 [3/8]
https://github.com/bitcoin/bitcoin/pull/19806/commits/31d225274ff1a4b245aea0a69f0e5224b0e64ca2

Note that the hash of the block in TestChain100Setup is different because Bitcoin ABC blocks have differences with Bitcoin Core blocks.
I added a test that does nothing but initialize a TestChain100DeterministicSetup to demonstrate that the hash in the assertion is correct (changing something in that string makes the test fail).

Test Plan

ninja check

Event Timeline

PiRK requested review of this revision.Mar 18 2022, 13:37
PiRK planned changes to this revision.Mar 18 2022, 13:59

The blockhash in the asssertion probably need to be adjusted for Bitcoin ABC

PiRK edited the summary of this revision. (Show Details)

fix block hash in the assertion in setup_common.h and add a blank test initializing the new test setup to exercise the assertion.

Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/test/validation_chainstatemanager_tests.cpp
174 ↗(On Diff #32883)

Add a dummy BOOST_CHECK(true); in this test to avoid a boost warning when no assert is executed from a test case (assert() is not accounted by boost)

This revision is now accepted and ready to land.Mar 23 2022, 08:58

Add a dummy BOOST_CHECK(true); in the placeholder test