53 for (
size_t n = 0; n < 4; ++n) {
59 false,
"Failed to generate block");
60 events.push_back(
blocks[n]);
75 false,
"Failed to generate block");
76 events.push_back(blk);
83 std::vector<tx_source_entry> sources;
84 for (
size_t out_idx_idx = 0; out_idx[out_idx_idx] >= 0; ++out_idx_idx) {
85 sources.resize(sources.size()+1);
88 src.
amount =
blocks[0].miner_tx.vout[out_idx[out_idx_idx]].amount;
89 std::cout <<
"using " <<
print_etn(src.
amount) <<
" output at index " << out_idx[out_idx_idx] << std::endl;
90 for (
int m = 0; m <= mixin; ++m) {
96 src.
push_output(idx, boost::get<txout_to_key>(
blocks[m].miner_tx.vout[out_idx[out_idx_idx]].target).key, src.
amount);
106 td.
addr = miner_account.get_keys().m_account_address;
108 std::vector<tx_destination_entry> destinations;
109 destinations.push_back(td);
112 bool r =
construct_tx(miner_accounts[0].get_keys(), sources, destinations, boost::none, std::vector<uint8_t>(), tx, 0);
116 events.push_back(tx);
124 const int out_idx[] = {1, -1};
126 return generate_with(events, out_idx, mixin, amount_paid,
false);
132 const int out_idx[] = {1, -1};
134 return generate_with(events, out_idx, mixin, amount_paid,
false);
140 const int out_idx[] = {0, -1};
142 return generate_with(events, out_idx, mixin, amount_paid,
true);
148 const int out_idx[] = {0, 1, -1};
150 return generate_with(events, out_idx, mixin, amount_paid,
true);
156 const int out_idx[] = {0, 1, 2, -1};
158 return generate_with(events, out_idx, mixin, amount_paid,
false);
164 const int out_idx[] = {1, -1};
166 return generate_with(events, out_idx, mixin, amount_paid,
false);
#define CRYPTONOTE_MINED_ETN_UNLOCK_WINDOW
crypto::public_key real_out_tx_key
std::string print_etn(uint64_t amount, unsigned int decimal_point)
#define CHECK_AND_ASSERT_MES(expr, fail_ret_val, message)
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)
crypto::secret_key generate(const crypto::secret_key &recovery_key=crypto::secret_key(), bool recover=false, bool two_random=false)
bool generate(std::vector< test_event_entry > &events) const
Holds cryptonote related classes and helpers.
bool is_valid_decomposed_amount(uint64_t amount)
bool generate_with(std::vector< test_event_entry > &events, const int *out_idx, int mixin, uint64_t amount_paid, bool valid) const
#define MAKE_GENESIS_BLOCK(VEC_EVENTS, BLK_NAME, MINER_ACC, TS)
unsigned __int64 uint64_t
bool generate(std::vector< test_event_entry > &events) const
crypto::public_key get_tx_pub_key_from_extra(const std::vector< uint8_t > &tx_extra, size_t pk_index)
void push_output(uint64_t idx, const crypto::public_key &k, uint64_t amount)
account_public_address addr
bool generate(std::vector< test_event_entry > &events) const
size_t real_output_in_tx_index
bool generate(std::vector< test_event_entry > &events) const
bool generate(std::vector< test_event_entry > &events) const
#define DIFFICULTY_BLOCKS_ESTIMATE_TIMESPAN
#define GENERATE_ACCOUNT(account)
#define DO_CALLBACK(VEC_EVENTS, CB_NAME)
bool generate(std::vector< test_event_entry > &events) const