Electroneum
gen_block_ts_in_past Struct Reference

#include <block_validation.h>

Inheritance diagram for gen_block_ts_in_past:
Collaboration diagram for gen_block_ts_in_past:

Public Member Functions

bool generate (std::vector< test_event_entry > &events) const
 
- Public Member Functions inherited from gen_block_verification_base< BLOCKCHAIN_TIMESTAMP_CHECK_WINDOW >
 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

Definition at line 98 of file block_validation.h.

Member Function Documentation

◆ generate()

bool gen_block_ts_in_past::generate ( std::vector< test_event_entry > &  events) const

Definition at line 118 of file block_validation.cpp.

119 {
121  REWIND_BLOCKS_N(events, blk_0r, blk_0, miner_account, BLOCKCHAIN_TIMESTAMP_CHECK_WINDOW - 1);
122 
123  uint64_t ts_below_median = boost::get<block>(events[BLOCKCHAIN_TIMESTAMP_CHECK_WINDOW / 2 - 1]).timestamp;
124  block blk_1;
125  generator.construct_block_manually(blk_1, blk_0r, miner_account, test_generator::bf_timestamp, 0, 0, ts_below_median);
126  events.push_back(blk_1);
127 
128  DO_CALLBACK(events, "check_block_purged");
129 
130  return true;
131 }
#define REWIND_BLOCKS_N(VEC_EVENTS, BLK_NAME, PREV_BLOCK, MINER_ACC, COUNT)
Definition: chaingen.h:889
unsigned __int64 uint64_t
Definition: stdint.h:136
#define BLOCKCHAIN_TIMESTAMP_CHECK_WINDOW
#define BLOCK_VALIDATION_INIT_GENERATE()
#define DO_CALLBACK(VEC_EVENTS, CB_NAME)
Definition: chaingen.h:820
Here is the call graph for this function:

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