Electroneum
gen_block_verification_base< invalid_block_idx > Class Template Reference

#include <block_validation.h>

Inheritance diagram for gen_block_verification_base< invalid_block_idx >:
Collaboration diagram for gen_block_verification_base< invalid_block_idx >:

Public Member Functions

 gen_block_verification_base ()
 
bool check_block_verification_context (const cryptonote::block_verification_context &bvc, size_t event_idx, const cryptonote::block &)
 
bool check_block_purged (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

template<size_t invalid_block_idx = 0>
class gen_block_verification_base< invalid_block_idx >

Definition at line 36 of file block_validation.h.

Constructor & Destructor Documentation

◆ gen_block_verification_base()

template<size_t invalid_block_idx = 0>
gen_block_verification_base< invalid_block_idx >::gen_block_verification_base ( )
inline

Definition at line 39 of file block_validation.h.

40  {
42  }
#define REGISTER_CALLBACK(CB_NAME, CLBACK)
Definition: chaingen.h:827

Member Function Documentation

◆ check_block_purged()

template<size_t invalid_block_idx = 0>
bool gen_block_verification_base< invalid_block_idx >::check_block_purged ( cryptonote::core c,
size_t  ev_index,
const std::vector< test_event_entry > &  events 
)
inline

Definition at line 52 of file block_validation.h.

53  {
54  DEFINE_TESTS_ERROR_CONTEXT("gen_block_verification_base::check_block_purged");
55 
56  CHECK_TEST_CONDITION(invalid_block_idx < ev_index);
58  CHECK_EQ(invalid_block_idx, c.get_current_blockchain_height());
59 
60  return true;
61  }
#define CHECK_TEST_CONDITION(cond)
Definition: chaingen.h:1057
uint64_t get_current_blockchain_height() const
get the current height of the blockchain
size_t get_pool_transactions_count() const
get the total number of transactions in the pool
#define CHECK_EQ(v1, v2)
Definition: chaingen.h:1058
#define DEFINE_TESTS_ERROR_CONTEXT(text)
Definition: chaingen.h:1056

◆ check_block_verification_context()

template<size_t invalid_block_idx = 0>
bool gen_block_verification_base< invalid_block_idx >::check_block_verification_context ( const cryptonote::block_verification_context bvc,
size_t  event_idx,
const cryptonote::block  
)
inline

Definition at line 44 of file block_validation.h.

45  {
46  if (invalid_block_idx == event_idx)
47  return bvc.m_verification_failed;
48  else
49  return !bvc.m_verification_failed;
50  }

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