Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/test/processor_tests.cpp
Show First 20 Lines • Show All 2,191 Lines • ▼ Show 20 Lines | for (size_t i = 0; i < 5; i++) { | ||||
BOOST_CHECK_GT(tx->GetId(), lastTxId); | BOOST_CHECK_GT(tx->GetId(), lastTxId); | ||||
lastTxId = tx->GetId(); | lastTxId = tx->GetId(); | ||||
it++; | it++; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
BOOST_AUTO_TEST_CASE(block_reconcile_initial_vote) { | BOOST_AUTO_TEST_CASE(block_reconcile_initial_vote) { | ||||
const auto &config = GetConfig(); | |||||
auto &chainman = Assert(m_node.chainman); | auto &chainman = Assert(m_node.chainman); | ||||
Chainstate &chainstate = chainman->ActiveChainstate(); | Chainstate &chainstate = chainman->ActiveChainstate(); | ||||
const auto block = std::make_shared<const CBlock>( | const auto block = std::make_shared<const CBlock>( | ||||
this->CreateBlock({}, CScript(), chainstate)); | this->CreateBlock({}, CScript(), chainstate)); | ||||
const BlockHash blockhash = block->GetHash(); | const BlockHash blockhash = block->GetHash(); | ||||
BlockValidationState state; | BlockValidationState state; | ||||
CBlockIndex *blockindex; | CBlockIndex *blockindex; | ||||
{ | { | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
BOOST_CHECK(chainstate.AcceptBlock(config, block, state, | BOOST_CHECK(chainstate.AcceptBlock(block, state, | ||||
/*fRequested=*/true, /*dbp=*/nullptr, | /*fRequested=*/true, /*dbp=*/nullptr, | ||||
/*fNewBlock=*/nullptr, | /*fNewBlock=*/nullptr, | ||||
/*min_pow_checked=*/true)); | /*min_pow_checked=*/true)); | ||||
blockindex = chainman->m_blockman.LookupBlockIndex(blockhash); | blockindex = chainman->m_blockman.LookupBlockIndex(blockhash); | ||||
BOOST_CHECK(blockindex); | BOOST_CHECK(blockindex); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 320 Lines • Show Last 20 Lines |