Monero
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
test_generator Class Reference

#include <chaingen.h>

Classes

struct  block_info
 

Public Types

enum  block_fields {
  bf_none = 0, bf_major_ver = 1 << 0, bf_minor_ver = 1 << 1, bf_timestamp = 1 << 2,
  bf_prev_id = 1 << 3, bf_miner_tx = 1 << 4, bf_tx_hashes = 1 << 5, bf_diffic = 1 << 6,
  bf_max_outs = 1 << 7, bf_hf_version = 1 << 8, bf_tx_fees = 1 << 9
}
 

Public Member Functions

 test_generator ()
 
 test_generator (const test_generator &other)
 
void get_block_chain (std::vector< block_info > &blockchain, const crypto::hash &head, size_t n) const
 
void get_last_n_block_weights (std::vector< size_t > &block_weights, const crypto::hash &head, size_t n) const
 
uint64_t get_already_generated_coins (const crypto::hash &blk_id) const
 
uint64_t get_already_generated_coins (const cryptonote::block &blk) const
 
void add_block (const cryptonote::block &blk, size_t tsx_size, std::vector< size_t > &block_weights, uint64_t already_generated_coins, uint64_t block_reward, uint8_t hf_version=1)
 
bool construct_block (cryptonote::block &blk, uint64_t height, const crypto::hash &prev_id, const cryptonote::account_base &miner_acc, uint64_t timestamp, uint64_t already_generated_coins, std::vector< size_t > &block_weights, const std::list< cryptonote::transaction > &tx_list, const boost::optional< uint8_t > &hf_ver=boost::none)
 
bool construct_block (cryptonote::block &blk, const cryptonote::account_base &miner_acc, uint64_t timestamp)
 
bool construct_block (cryptonote::block &blk, const cryptonote::block &blk_prev, const cryptonote::account_base &miner_acc, const std::list< cryptonote::transaction > &tx_list=std::list< cryptonote::transaction >(), const boost::optional< uint8_t > &hf_ver=boost::none)
 
bool construct_block_manually (cryptonote::block &blk, const cryptonote::block &prev_block, const cryptonote::account_base &miner_acc, int actual_params=bf_none, uint8_t major_ver=0, uint8_t minor_ver=0, uint64_t timestamp=0, const crypto::hash &prev_id=crypto::hash(), const cryptonote::difficulty_type &diffic=1, const cryptonote::transaction &miner_tx=cryptonote::transaction(), const std::vector< crypto::hash > &tx_hashes=std::vector< crypto::hash >(), size_t txs_sizes=0, size_t max_outs=999, uint8_t hf_version=1, uint64_t fees=0)
 
bool construct_block_manually_tx (cryptonote::block &blk, const cryptonote::block &prev_block, const cryptonote::account_base &miner_acc, const std::vector< crypto::hash > &tx_hashes, size_t txs_size)
 
void fill_nonce (cryptonote::block &blk, const cryptonote::difficulty_type &diffic, uint64_t height)
 
void set_events (const std::vector< test_event_entry > *events)
 
void set_network_type (const cryptonote::network_type nettype)
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int)
 

Private Attributes

std::unordered_map< crypto::hash, block_infom_blocks_info
 
const std::vector< test_event_entry > * m_events
 
cryptonote::network_type m_nettype
 

Friends

class boost::serialization::access
 

Member Enumeration Documentation

◆ block_fields

Enumerator
bf_none 
bf_major_ver 
bf_minor_ver 
bf_timestamp 
bf_prev_id 
bf_miner_tx 
bf_tx_hashes 
bf_diffic 
bf_max_outs 
bf_hf_version 
bf_tx_fees 

Constructor & Destructor Documentation

◆ test_generator() [1/2]

test_generator::test_generator ( )
inline

◆ test_generator() [2/2]

test_generator::test_generator ( const test_generator other)
inline

Member Function Documentation

◆ add_block()

void test_generator::add_block ( const cryptonote::block blk,
size_t  tsx_size,
std::vector< size_t > &  block_weights,
uint64_t  already_generated_coins,
uint64_t  block_reward,
uint8_t  hf_version = 1 
)

◆ construct_block() [1/3]

bool test_generator::construct_block ( cryptonote::block blk,
uint64_t  height,
const crypto::hash prev_id,
const cryptonote::account_base miner_acc,
uint64_t  timestamp,
uint64_t  already_generated_coins,
std::vector< size_t > &  block_weights,
const std::list< cryptonote::transaction > &  tx_list,
const boost::optional< uint8_t > &  hf_ver = boost::none 
)

◆ construct_block() [2/3]

bool test_generator::construct_block ( cryptonote::block blk,
const cryptonote::account_base miner_acc,
uint64_t  timestamp 
)

◆ construct_block() [3/3]

bool test_generator::construct_block ( cryptonote::block blk,
const cryptonote::block blk_prev,
const cryptonote::account_base miner_acc,
const std::list< cryptonote::transaction > &  tx_list = std::list< cryptonote::transaction >(),
const boost::optional< uint8_t > &  hf_ver = boost::none 
)

◆ construct_block_manually()

bool test_generator::construct_block_manually ( cryptonote::block blk,
const cryptonote::block prev_block,
const cryptonote::account_base miner_acc,
int  actual_params = bf_none,
uint8_t  major_ver = 0,
uint8_t  minor_ver = 0,
uint64_t  timestamp = 0,
const crypto::hash prev_id = crypto::hash(),
const cryptonote::difficulty_type diffic = 1,
const cryptonote::transaction miner_tx = cryptonote::transaction(),
const std::vector< crypto::hash > &  tx_hashes = std::vector<crypto::hash>(),
size_t  txs_sizes = 0,
size_t  max_outs = 999,
uint8_t  hf_version = 1,
uint64_t  fees = 0 
)

◆ construct_block_manually_tx()

bool test_generator::construct_block_manually_tx ( cryptonote::block blk,
const cryptonote::block prev_block,
const cryptonote::account_base miner_acc,
const std::vector< crypto::hash > &  tx_hashes,
size_t  txs_size 
)

◆ fill_nonce()

void test_generator::fill_nonce ( cryptonote::block blk,
const cryptonote::difficulty_type diffic,
uint64_t  height 
)

◆ get_already_generated_coins() [1/2]

uint64_t test_generator::get_already_generated_coins ( const crypto::hash blk_id) const

◆ get_already_generated_coins() [2/2]

uint64_t test_generator::get_already_generated_coins ( const cryptonote::block blk) const

◆ get_block_chain()

void test_generator::get_block_chain ( std::vector< block_info > &  blockchain,
const crypto::hash head,
size_t  n 
) const

◆ get_last_n_block_weights()

void test_generator::get_last_n_block_weights ( std::vector< size_t > &  block_weights,
const crypto::hash head,
size_t  n 
) const

◆ serialize()

template<class Archive >
void test_generator::serialize ( Archive &  ar,
const unsigned  int 
)
inlineprivate

◆ set_events()

void test_generator::set_events ( const std::vector< test_event_entry > *  events)
inline

◆ set_network_type()

void test_generator::set_network_type ( const cryptonote::network_type  nettype)
inline

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Member Data Documentation

◆ m_blocks_info

std::unordered_map<crypto::hash, block_info> test_generator::m_blocks_info
private

◆ m_events

const std::vector<test_event_entry>* test_generator::m_events
private

◆ m_nettype

cryptonote::network_type test_generator::m_nettype
private

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