Electroneum
gen_block_miner_tx_has_2_in Struct Reference

#include <block_validation.h>

Inheritance diagram for gen_block_miner_tx_has_2_in:
Collaboration diagram for gen_block_miner_tx_has_2_in:

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+1 >
 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 159 of file block_validation.h.

Member Function Documentation

◆ generate()

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

Definition at line 330 of file block_validation.cpp.

331 {
333  REWIND_BLOCKS(events, blk_0r, blk_0, miner_account);
334 
335  GENERATE_ACCOUNT(alice);
336 
337  tx_source_entry se;
338  se.amount = blk_0.miner_tx.vout[0].amount;
339  se.push_output(0, boost::get<txout_to_key>(blk_0.miner_tx.vout[0].target).key, se.amount);
340  se.real_output = 0;
341  se.rct = false;
342  se.real_out_tx_key = get_tx_pub_key_from_extra(blk_0.miner_tx);
344  std::vector<tx_source_entry> sources;
345  sources.push_back(se);
346 
348  de.addr = miner_account.get_keys().m_account_address;
349  de.amount = se.amount;
350  std::vector<tx_destination_entry> destinations;
351  destinations.push_back(de);
352 
353  transaction tmp_tx;
354  if (!construct_tx(miner_account.get_keys(), sources, destinations, boost::none, std::vector<uint8_t>(), tmp_tx, 0))
355  return false;
356 
357  MAKE_MINER_TX_MANUALLY(miner_tx, blk_0);
358  miner_tx.vin.push_back(tmp_tx.vin[0]);
359 
360  block blk_1;
361  generator.construct_block_manually(blk_1, blk_0r, miner_account, test_generator::bf_miner_tx, 0, 0, 0, crypto::hash(), 0, miner_tx);
362  events.push_back(blk_1);
363 
364  DO_CALLBACK(events, "check_block_purged");
365 
366  return true;
367 }
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 GENERATE_ACCOUNT(account)
Definition: chaingen.h:801
#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: