Changeset View
Changeset View
Standalone View
Standalone View
src/test/validation_block_tests.cpp
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | struct TestSubscriber : public CValidationInterface { | ||||
explicit TestSubscriber(uint256 tip) : m_expected_tip(tip) {} | explicit TestSubscriber(uint256 tip) : m_expected_tip(tip) {} | ||||
void UpdatedBlockTip(const CBlockIndex *pindexNew, | void UpdatedBlockTip(const CBlockIndex *pindexNew, | ||||
const CBlockIndex *pindexFork, | const CBlockIndex *pindexFork, | ||||
bool fInitialDownload) override { | bool fInitialDownload) override { | ||||
BOOST_CHECK_EQUAL(m_expected_tip, pindexNew->GetBlockHash()); | BOOST_CHECK_EQUAL(m_expected_tip, pindexNew->GetBlockHash()); | ||||
} | } | ||||
void | void BlockConnected(const std::shared_ptr<const CBlock> &block, | ||||
BlockConnected(const std::shared_ptr<const CBlock> &block, | const CBlockIndex *pindex) override { | ||||
const CBlockIndex *pindex, | |||||
const std::vector<CTransactionRef> &txnConflicted) override { | |||||
BOOST_CHECK_EQUAL(m_expected_tip, block->hashPrevBlock); | BOOST_CHECK_EQUAL(m_expected_tip, block->hashPrevBlock); | ||||
BOOST_CHECK_EQUAL(m_expected_tip, pindex->pprev->GetBlockHash()); | BOOST_CHECK_EQUAL(m_expected_tip, pindex->pprev->GetBlockHash()); | ||||
m_expected_tip = block->GetHash(); | m_expected_tip = block->GetHash(); | ||||
} | } | ||||
void BlockDisconnected(const std::shared_ptr<const CBlock> &block, | void BlockDisconnected(const std::shared_ptr<const CBlock> &block, | ||||
const CBlockIndex *pindex) override { | const CBlockIndex *pindex) override { | ||||
▲ Show 20 Lines • Show All 329 Lines • Show Last 20 Lines |