Electroneum
gen_block_miner_tx_with_txin_to_key Struct Reference

#include <block_validation.h>

Inheritance diagram for gen_block_miner_tx_with_txin_to_key:
Collaboration diagram for gen_block_miner_tx_with_txin_to_key:

Public Member Functions

bool generate (std::vector< test_event_entry > &events) const
 
- Public Member Functions inherited from gen_block_verification_base< CRYPTONOTE_MINED_ETN_UNLOCK_WINDOW+2 >
 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 164 of file block_validation.h.

Member Function Documentation

◆ generate()

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

Definition at line 369 of file block_validation.cpp.

370 {
372 
373  // This block has only one output
374  block blk_1;
375  generator.construct_block_manually(blk_1, blk_0, miner_account, test_generator::bf_none);
376  events.push_back(blk_1);
377 
378  REWIND_BLOCKS(events, blk_1r, blk_1, miner_account);
379 
380  tx_source_entry se;
381  se.amount = blk_1.miner_tx.vout[0].amount;
382  se.push_output(0, boost::get<txout_to_key>(blk_1.miner_tx.vout[0].target).key, se.amount);
383  se.real_output = 0;
384  se.rct = false;
387  std::vector<tx_source_entry> sources;
388  sources.push_back(se);
389 
391  de.addr = miner_account.get_keys().m_account_address;
392  de.amount = se.amount;
393  std::vector<tx_destination_entry> destinations;
394  destinations.push_back(de);
395 
396  transaction tmp_tx;
397  if (!construct_tx(miner_account.get_keys(), sources, destinations, boost::none, std::vector<uint8_t>(), tmp_tx, 0))
398  return false;
399 
400  MAKE_MINER_TX_MANUALLY(miner_tx, blk_1);
401  miner_tx.vin[0] = tmp_tx.vin[0];
402 
403  block blk_2;
404  generator.construct_block_manually(blk_2, blk_1r, miner_account, test_generator::bf_miner_tx, 0, 0, 0, crypto::hash(), 0, miner_tx);
405  events.push_back(blk_2);
406 
407  DO_CALLBACK(events, "check_block_purged");
408 
409  return true;
410 }
crypto::public_key real_out_tx_key
bool construct_tx(const account_keys &sender_account_keys, std::vector< tx_source_entry > &sources, const std::vector< tx_destination_entry > &destinations, const boost::optional< cryptonote::account_public_address > &change_addr, const std::vector< uint8_t > &extra, transaction &tx, uint64_t unlock_time)
bool rct
uint64_t amount
size_t real_output
crypto::public_key get_tx_pub_key_from_extra(const std::vector< uint8_t > &tx_extra, size_t pk_index)
uint64_t amount
#define MAKE_MINER_TX_MANUALLY(TX, BLK)
Definition: chaingen.h:949
void push_output(uint64_t idx, const crypto::public_key &k, uint64_t amount)
account_public_address addr
#define REWIND_BLOCKS(VEC_EVENTS, BLK_NAME, PREV_BLOCK, MINER_ACC)
Definition: chaingen.h:890
size_t real_output_in_tx_index
POD_CLASS hash
Definition: hash.h:50
#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: