Electroneum
get_tx_validation_base Struct Reference

#include <tx_validation.h>

Inheritance diagram for get_tx_validation_base:
Collaboration diagram for get_tx_validation_base:

Public Member Functions

 get_tx_validation_base ()
 
bool check_tx_verification_context (const cryptonote::tx_verification_context &tvc, bool tx_added, size_t event_idx, const cryptonote::transaction &)
 
bool check_block_verification_context (const cryptonote::block_verification_context &bvc, size_t event_idx, const cryptonote::block &)
 
bool mark_invalid_block (cryptonote::core &, size_t ev_index, const std::vector< test_event_entry > &)
 
bool mark_invalid_tx (cryptonote::core &, size_t ev_index, const std::vector< test_event_entry > &)
 
- 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 tx_validation.h.

Constructor & Destructor Documentation

◆ get_tx_validation_base()

get_tx_validation_base::get_tx_validation_base ( )
inline

Definition at line 37 of file tx_validation.h.

38  : m_invalid_tx_index(0)
39  , m_invalid_block_index(0)
40  {
43  }
bool mark_invalid_block(cryptonote::core &, size_t ev_index, const std::vector< test_event_entry > &)
Definition: tx_validation.h:61
#define REGISTER_CALLBACK_METHOD(CLASS, METHOD)
Definition: chaingen.h:830
bool mark_invalid_tx(cryptonote::core &, size_t ev_index, const std::vector< test_event_entry > &)
Definition: tx_validation.h:67
Here is the call graph for this function:

Member Function Documentation

◆ check_block_verification_context()

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

Definition at line 53 of file tx_validation.h.

54  {
55  if (m_invalid_block_index == event_idx)
56  return bvc.m_verification_failed;
57  else
58  return !bvc.m_verification_failed;
59  }

◆ check_tx_verification_context()

bool get_tx_validation_base::check_tx_verification_context ( const cryptonote::tx_verification_context tvc,
bool  tx_added,
size_t  event_idx,
const cryptonote::transaction  
)
inline

Definition at line 45 of file tx_validation.h.

46  {
47  if (m_invalid_tx_index == event_idx)
48  return tvc.m_verification_failed;
49  else
50  return !tvc.m_verification_failed && tx_added;
51  }

◆ mark_invalid_block()

bool get_tx_validation_base::mark_invalid_block ( cryptonote::core ,
size_t  ev_index,
const std::vector< test_event_entry > &   
)
inline

Definition at line 61 of file tx_validation.h.

62  {
63  m_invalid_block_index = ev_index + 1;
64  return true;
65  }
Here is the caller graph for this function:

◆ mark_invalid_tx()

bool get_tx_validation_base::mark_invalid_tx ( cryptonote::core ,
size_t  ev_index,
const std::vector< test_event_entry > &   
)
inline

Definition at line 67 of file tx_validation.h.

68  {
69  m_invalid_tx_index = ev_index + 1;
70  return true;
71  }
Here is the caller graph for this function:

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