forked from lthn/blockchain
coretests: implemented mark_unverifiable_tx callback for test_chain_unit_enchanced base class
This commit is contained in:
parent
b7e4dbcb38
commit
9ede2f9802
2 changed files with 12 additions and 0 deletions
|
|
@ -2047,9 +2047,11 @@ test_chain_unit_enchanced::test_chain_unit_enchanced()
|
|||
: m_invalid_block_index(std::numeric_limits<size_t>::max())
|
||||
, m_orphan_block_index(std::numeric_limits<size_t>::max())
|
||||
, m_invalid_tx_index(std::numeric_limits<size_t>::max())
|
||||
, m_unverifiable_tx_index(std::numeric_limits<size_t>::max())
|
||||
{
|
||||
REGISTER_CALLBACK_METHOD(test_chain_unit_enchanced, configure_core);
|
||||
REGISTER_CALLBACK_METHOD(test_chain_unit_enchanced, mark_invalid_tx);
|
||||
REGISTER_CALLBACK_METHOD(test_chain_unit_enchanced, mark_unverifiable_tx);
|
||||
REGISTER_CALLBACK_METHOD(test_chain_unit_enchanced, mark_invalid_block);
|
||||
REGISTER_CALLBACK_METHOD(test_chain_unit_enchanced, mark_orphan_block);
|
||||
REGISTER_CALLBACK_METHOD(test_chain_unit_enchanced, check_top_block);
|
||||
|
|
|
|||
|
|
@ -258,6 +258,9 @@ public:
|
|||
{
|
||||
if (m_invalid_tx_index == event_idx)
|
||||
return tvc.m_verification_failed;
|
||||
|
||||
if (m_unverifiable_tx_index == event_idx)
|
||||
return tvc.m_verification_impossible;
|
||||
|
||||
return !tvc.m_verification_failed && tx_added;
|
||||
}
|
||||
|
|
@ -291,6 +294,12 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
bool mark_unverifiable_tx(currency::core& /*c*/, size_t ev_index, const std::vector<test_event_entry>& /*events*/)
|
||||
{
|
||||
m_unverifiable_tx_index = ev_index + 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool configure_core(currency::core& c, size_t ev_index, const std::vector<test_event_entry>& events);
|
||||
bool check_top_block(currency::core& c, size_t ev_index, const std::vector<test_event_entry>& events);
|
||||
bool clear_tx_pool(currency::core& c, size_t ev_index, const std::vector<test_event_entry>& events);
|
||||
|
|
@ -310,6 +319,7 @@ protected:
|
|||
};
|
||||
size_t m_invalid_block_index;
|
||||
size_t m_invalid_tx_index;
|
||||
size_t m_unverifiable_tx_index;
|
||||
size_t m_orphan_block_index;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue