mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-12 21:52:53 +02:00
Merge bitcoin/bitcoin#33856: kernel: Refactor process_block_header to return btck_BlockValidationState
88d9bc5aa4kernel: Return btck_BlockValidationState from process_block_header API (yuvicc) Pull request description: This PR refactors `btck_chainstate_manager_process_block_header` to return `btck_BlockValidationState` by value instead of using out-parameters or boolean returns. ACKs for top commit: optout21: ACK88d9bc5aa4stickies-v: ACK88d9bc5aa4w0xlt: reACK88d9bc5aa4hodlinator: re-ACK88d9bc5aa4Tree-SHA512: f86b6e85aedafd78ae250930cbe34dc666c14d800e43cf8582d49aecb97faab801eff8dcc0250082ceebc3e8d32949839e030cf9f0023b56b23c8f7b7a741e49
This commit is contained in:
@@ -1102,10 +1102,9 @@ BOOST_AUTO_TEST_CASE(btck_chainman_regtest_tests)
|
||||
for (const auto& data : REGTEST_BLOCK_DATA) {
|
||||
Block block{hex_string_to_byte_vec(data)};
|
||||
BlockHeader header = block.GetHeader();
|
||||
BlockValidationState state{};
|
||||
BOOST_CHECK(state.GetBlockValidationResult() == BlockValidationResult::UNSET);
|
||||
BOOST_CHECK(chainman->ProcessBlockHeader(header, state));
|
||||
BlockValidationState state = chainman->ProcessBlockHeader(header);
|
||||
BOOST_CHECK(state.GetValidationMode() == ValidationMode::VALID);
|
||||
BOOST_CHECK(state.GetBlockValidationResult() == BlockValidationResult::UNSET);
|
||||
BlockTreeEntry entry{*chainman->GetBlockTreeEntry(header.Hash())};
|
||||
BOOST_CHECK(!chainman->GetChain().Contains(entry));
|
||||
BlockTreeEntry best_entry{chainman->GetBestEntry()};
|
||||
|
||||
Reference in New Issue
Block a user