fuzz: mini_miner_selection fixups.

Delete asserts that are redundant with the == assert.
Add assertion that the coinbase isn't already in mock_template_txids.
This commit is contained in:
glozow 2024-07-09 14:06:30 +01:00
parent de273d5300
commit 09370529fb

View file

@ -188,9 +188,9 @@ FUZZ_TARGET(mini_miner_selection, .init = initialize_miner)
auto mock_template_txids = mini_miner.GetMockTemplateTxids();
// MiniMiner doesn't add a coinbase tx.
assert(mock_template_txids.count(blocktemplate->block.vtx[0]->GetHash()) == 0);
mock_template_txids.emplace(blocktemplate->block.vtx[0]->GetHash());
assert(mock_template_txids.size() <= blocktemplate->block.vtx.size());
assert(mock_template_txids.size() >= blocktemplate->block.vtx.size());
auto [iter, new_entry] = mock_template_txids.emplace(blocktemplate->block.vtx[0]->GetHash());
assert(new_entry);
assert(mock_template_txids.size() == blocktemplate->block.vtx.size());
for (const auto& tx : blocktemplate->block.vtx) {
assert(mock_template_txids.count(tx->GetHash()));