Electroneum
gen_uint_overflow_base Struct Reference

#include <integer_overflow.h>

Inheritance diagram for gen_uint_overflow_base:
Collaboration diagram for gen_uint_overflow_base:

Public Member Functions

 gen_uint_overflow_base ()
 
bool check_tx_verification_context (const cryptonote::tx_verification_context &tvc, bool tx_added, size_t event_idx, const cryptonote::transaction &tx)
 
bool check_block_verification_context (const cryptonote::block_verification_context &bvc, size_t event_idx, const cryptonote::block &block)
 
bool mark_last_valid_block (cryptonote::core &c, size_t ev_index, const std::vector< test_event_entry > &events)
 
- Public Member Functions inherited from test_chain_unit_base
void register_callback (const std::string &cb_name, verify_callback cb)
 
bool verify (const std::string &cb_name, cryptonote::core &c, size_t ev_index, const std::vector< test_event_entry > &events)
 
bool check_block_verification_context (const cryptonote::block_verification_context &bvc, size_t event_idx, const cryptonote::block &)
 
bool check_tx_verification_context (const cryptonote::tx_verification_context &tvc, bool, size_t, const cryptonote::transaction &)
 
bool check_tx_verification_context_array (const std::vector< cryptonote::tx_verification_context > &tvcs, size_t, size_t, const std::vector< cryptonote::transaction > &)
 

Additional Inherited Members

- Public Types inherited from test_chain_unit_base
typedef boost::function< bool(cryptonote::core &c, size_t ev_index, const std::vector< test_event_entry > &events)> verify_callback
 
typedef std::map< std::string, verify_callbackcallbacks_map
 

Detailed Description

Definition at line 35 of file integer_overflow.h.

Constructor & Destructor Documentation

◆ gen_uint_overflow_base()

gen_uint_overflow_base::gen_uint_overflow_base ( )

Definition at line 76 of file integer_overflow.cpp.

77  : m_last_valid_block_event_idx(static_cast<size_t>(-1))
78 {
80 }
bool mark_last_valid_block(cryptonote::core &c, size_t ev_index, const std::vector< test_event_entry > &events)
#define REGISTER_CALLBACK_METHOD(CLASS, METHOD)
Definition: chaingen.h:830
Here is the call graph for this function:

Member Function Documentation

◆ check_block_verification_context()

bool gen_uint_overflow_base::check_block_verification_context ( const cryptonote::block_verification_context bvc,
size_t  event_idx,
const cryptonote::block block 
)

Definition at line 87 of file integer_overflow.cpp.

88 {
89  return m_last_valid_block_event_idx < event_idx ? bvc.m_verification_failed | bvc.m_marked_as_orphaned : !bvc.m_verification_failed;
90 }

◆ check_tx_verification_context()

bool gen_uint_overflow_base::check_tx_verification_context ( const cryptonote::tx_verification_context tvc,
bool  tx_added,
size_t  event_idx,
const cryptonote::transaction tx 
)

Definition at line 82 of file integer_overflow.cpp.

83 {
84  return m_last_valid_block_event_idx < event_idx ? !tx_added && tvc.m_verification_failed : tx_added && !tvc.m_verification_failed;
85 }

◆ mark_last_valid_block()

bool gen_uint_overflow_base::mark_last_valid_block ( cryptonote::core c,
size_t  ev_index,
const std::vector< test_event_entry > &  events 
)

Definition at line 92 of file integer_overflow.cpp.

93 {
94  m_last_valid_block_event_idx = ev_index - 1;
95  return true;
96 }
Here is the caller graph for this function:

The documentation for this struct was generated from the following files: