Electroneum
test_construct_tx< a_in_count, a_out_count, a_rct, range_proof_type, bp_version > Class Template Reference

#include <construct_tx.h>

Inheritance diagram for test_construct_tx< a_in_count, a_out_count, a_rct, range_proof_type, bp_version >:
Collaboration diagram for test_construct_tx< a_in_count, a_out_count, a_rct, range_proof_type, bp_version >:

Public Types

typedef multi_tx_test_base< a_in_count > base_class
 

Public Member Functions

bool init ()
 
bool test ()
 

Static Public Attributes

static const size_t loop_count = (a_in_count + a_out_count < 10) ? (a_rct ? 10 : 200) : (a_in_count + a_out_count) < 100 ? (a_rct ? 5 : 25) : 5
 
static const size_t in_count = a_in_count
 
static const size_t out_count = a_out_count
 
static const bool rct = a_rct
 

Detailed Description

template<size_t a_in_count, size_t a_out_count, bool a_rct, rct::RangeProofType range_proof_type = rct::RangeProofBorromean, int bp_version = 2>
class test_construct_tx< a_in_count, a_out_count, a_rct, range_proof_type, bp_version >

Definition at line 41 of file construct_tx.h.

Member Typedef Documentation

◆ base_class

template<size_t a_in_count, size_t a_out_count, bool a_rct, rct::RangeProofType range_proof_type = rct::RangeProofBorromean, int bp_version = 2>
typedef multi_tx_test_base<a_in_count> test_construct_tx< a_in_count, a_out_count, a_rct, range_proof_type, bp_version >::base_class

Definition at line 52 of file construct_tx.h.

Member Function Documentation

◆ init()

template<size_t a_in_count, size_t a_out_count, bool a_rct, rct::RangeProofType range_proof_type = rct::RangeProofBorromean, int bp_version = 2>
bool test_construct_tx< a_in_count, a_out_count, a_rct, range_proof_type, bp_version >::init ( )
inline

Definition at line 54 of file construct_tx.h.

55  {
56  using namespace cryptonote;
57 
58  if (!base_class::init())
59  return false;
60 
61  m_alice.generate();
62 
63  for (size_t i = 0; i < out_count; ++i)
64  {
65  m_destinations.push_back(tx_destination_entry(this->m_source_amount / out_count, m_alice.get_keys().m_account_address, false));
66  }
67 
68  return true;
69  }
Holds cryptonote related classes and helpers.
Definition: ban.cpp:40
static const size_t out_count
Definition: construct_tx.h:49
Here is the call graph for this function:

◆ test()

template<size_t a_in_count, size_t a_out_count, bool a_rct, rct::RangeProofType range_proof_type = rct::RangeProofBorromean, int bp_version = 2>
bool test_construct_tx< a_in_count, a_out_count, a_rct, range_proof_type, bp_version >::test ( )
inline

Definition at line 71 of file construct_tx.h.

72  {
73  crypto::secret_key tx_key;
74  std::vector<crypto::secret_key> additional_tx_keys;
75  std::unordered_map<crypto::public_key, cryptonote::subaddress_index> subaddresses;
76  subaddresses[this->m_miners[this->real_source_idx].get_keys().m_account_address.m_spend_public_key] = {0,0};
77  rct::RCTConfig rct_config{range_proof_type, bp_version};
78  return cryptonote::construct_tx_and_get_tx_key(this->m_miners[this->real_source_idx].get_keys(), subaddresses, this->m_sources, m_destinations, cryptonote::account_public_address{}, std::vector<uint8_t>(), m_tx, 0, tx_key, additional_tx_keys, rct, rct_config);
79  }
cryptonote::account_base m_miners[ring_size]
const account_keys & get_keys() const
Definition: account.cpp:264
account_public_address m_account_address
Definition: account.h:43
std::vector< cryptonote::tx_source_entry > m_sources
bool construct_tx_and_get_tx_key(const account_keys &sender_account_keys, const std::unordered_map< crypto::public_key, subaddress_index > &subaddresses, std::vector< tx_source_entry > &sources, 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, crypto::secret_key &tx_key, std::vector< crypto::secret_key > &additional_tx_keys, bool rct, const rct::RCTConfig &rct_config, rct::multisig_out *msout, const uint32_t account_major_offset, const cryptonote::network_type nettype)
Here is the call graph for this function:

Member Data Documentation

◆ in_count

template<size_t a_in_count, size_t a_out_count, bool a_rct, rct::RangeProofType range_proof_type = rct::RangeProofBorromean, int bp_version = 2>
const size_t test_construct_tx< a_in_count, a_out_count, a_rct, range_proof_type, bp_version >::in_count = a_in_count
static

Definition at line 48 of file construct_tx.h.

◆ loop_count

template<size_t a_in_count, size_t a_out_count, bool a_rct, rct::RangeProofType range_proof_type = rct::RangeProofBorromean, int bp_version = 2>
const size_t test_construct_tx< a_in_count, a_out_count, a_rct, range_proof_type, bp_version >::loop_count = (a_in_count + a_out_count < 10) ? (a_rct ? 10 : 200) : (a_in_count + a_out_count) < 100 ? (a_rct ? 5 : 25) : 5
static

Definition at line 47 of file construct_tx.h.

◆ out_count

template<size_t a_in_count, size_t a_out_count, bool a_rct, rct::RangeProofType range_proof_type = rct::RangeProofBorromean, int bp_version = 2>
const size_t test_construct_tx< a_in_count, a_out_count, a_rct, range_proof_type, bp_version >::out_count = a_out_count
static

Definition at line 49 of file construct_tx.h.

◆ rct

template<size_t a_in_count, size_t a_out_count, bool a_rct, rct::RangeProofType range_proof_type = rct::RangeProofBorromean, int bp_version = 2>
const bool test_construct_tx< a_in_count, a_out_count, a_rct, range_proof_type, bp_version >::rct = a_rct
static

Definition at line 50 of file construct_tx.h.


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