mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
chainparams: add blockhash to AssumeutxoData
This allows us to reference assumeutxo configuration by blockhash as well as height; this is helpful in future changes when we want to reference assumeutxo configurations before the block index is loaded.
This commit is contained in:
@@ -132,17 +132,17 @@ BOOST_AUTO_TEST_CASE(test_assumeutxo)
|
||||
std::vector<int> bad_heights{0, 100, 111, 115, 209, 211};
|
||||
|
||||
for (auto empty : bad_heights) {
|
||||
const auto out = ExpectedAssumeutxo(empty, *params);
|
||||
const auto out = params->AssumeutxoForHeight(empty);
|
||||
BOOST_CHECK(!out);
|
||||
}
|
||||
|
||||
const auto out110 = *ExpectedAssumeutxo(110, *params);
|
||||
const auto out110 = *params->AssumeutxoForHeight(110);
|
||||
BOOST_CHECK_EQUAL(out110.hash_serialized.ToString(), "1ebbf5850204c0bdb15bf030f47c7fe91d45c44c712697e4509ba67adb01c618");
|
||||
BOOST_CHECK_EQUAL(out110.nChainTx, 110U);
|
||||
|
||||
const auto out210 = *ExpectedAssumeutxo(200, *params);
|
||||
BOOST_CHECK_EQUAL(out210.hash_serialized.ToString(), "51c8d11d8b5c1de51543c579736e786aa2736206d1e11e627568029ce092cf62");
|
||||
BOOST_CHECK_EQUAL(out210.nChainTx, 200U);
|
||||
const auto out110_2 = *params->AssumeutxoForBlockhash(uint256S("0x696e92821f65549c7ee134edceeeeaaa4105647a3c4fd9f298c0aec0ab50425c"));
|
||||
BOOST_CHECK_EQUAL(out110_2.hash_serialized.ToString(), "1ebbf5850204c0bdb15bf030f47c7fe91d45c44c712697e4509ba67adb01c618");
|
||||
BOOST_CHECK_EQUAL(out110_2.nChainTx, 110U);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
Reference in New Issue
Block a user