so this commit contains a new GENESIS TX with the revised TX format - no pricing_record_height etc. Lots of reworking of tests because of changes to function prototypes, etc
This commit is contained in:
@@ -350,7 +350,7 @@ bool gen_block_miner_tx_has_2_in::generate(std::vector<test_event_entry>& events
|
||||
destinations.push_back(de);
|
||||
|
||||
transaction tmp_tx;
|
||||
if (!construct_tx(miner_account.get_keys(), sources, destinations, 1/*hf_version*/, boost::none, std::vector<uint8_t>(), tmp_tx, 0))
|
||||
if (!construct_tx(miner_account.get_keys(), sources, destinations, 1/*hf_version*/, "FULM", "FULM", boost::none, std::vector<uint8_t>(), tmp_tx, 0))
|
||||
return false;
|
||||
|
||||
MAKE_MINER_TX_MANUALLY(miner_tx, blk_0);
|
||||
@@ -393,7 +393,7 @@ bool gen_block_miner_tx_with_txin_to_key::generate(std::vector<test_event_entry>
|
||||
destinations.push_back(de);
|
||||
|
||||
transaction tmp_tx;
|
||||
if (!construct_tx(miner_account.get_keys(), sources, destinations, 1/*hf_version*/, boost::none, std::vector<uint8_t>(), tmp_tx, 0))
|
||||
if (!construct_tx(miner_account.get_keys(), sources, destinations, 1/*hf_version*/, "FULM", "FULM", boost::none, std::vector<uint8_t>(), tmp_tx, 0))
|
||||
return false;
|
||||
|
||||
MAKE_MINER_TX_MANUALLY(miner_tx, blk_1);
|
||||
|
||||
@@ -136,7 +136,9 @@ bool gen_bpp_tx_validation_base::generate_with(std::vector<test_event_entry>& ev
|
||||
std::unordered_map<crypto::public_key, cryptonote::subaddress_index> subaddresses;
|
||||
subaddresses[miner_accounts[n].get_keys().m_account_address.m_spend_public_key] = {0,0};
|
||||
rct_txes.resize(rct_txes.size() + 1);
|
||||
bool r = construct_tx_and_get_tx_key(miner_accounts[n].get_keys(), subaddresses, sources, destinations, 1/*hf_version*/, cryptonote::account_public_address{}, std::vector<uint8_t>(), rct_txes.back(), 0, tx_key, additional_tx_keys, true, rct_config[n]);
|
||||
std::string source_asset = "FULM";
|
||||
std::string dest_asset = "FULM";
|
||||
bool r = construct_tx_and_get_tx_key(miner_accounts[n].get_keys(), subaddresses, sources, destinations, 1/*hf_version*/, source_asset, dest_asset, cryptonote::account_public_address{}, std::vector<uint8_t>(), rct_txes.back(), 0, tx_key, additional_tx_keys, true, rct_config[n]);
|
||||
CHECK_AND_ASSERT_MES(r, false, "failed to construct transaction");
|
||||
|
||||
if (post_tx && !post_tx(rct_txes.back(), n))
|
||||
|
||||
@@ -134,9 +134,11 @@ bool gen_bp_tx_validation_base::generate_with(std::vector<test_event_entry>& eve
|
||||
crypto::secret_key tx_key;
|
||||
std::vector<crypto::secret_key> additional_tx_keys;
|
||||
std::unordered_map<crypto::public_key, cryptonote::subaddress_index> subaddresses;
|
||||
std::string source_asset = "FULM";
|
||||
std::string dest_asset = "FULM";
|
||||
subaddresses[miner_accounts[n].get_keys().m_account_address.m_spend_public_key] = {0,0};
|
||||
rct_txes.resize(rct_txes.size() + 1);
|
||||
bool r = construct_tx_and_get_tx_key(miner_accounts[n].get_keys(), subaddresses, sources, destinations, 1/*hf_version*/, cryptonote::account_public_address{}, std::vector<uint8_t>(), rct_txes.back(), 0, tx_key, additional_tx_keys, true, rct_config[n]);
|
||||
bool r = construct_tx_and_get_tx_key(miner_accounts[n].get_keys(), subaddresses, sources, destinations, 1/*hf_version*/, source_asset, dest_asset, cryptonote::account_public_address{}, std::vector<uint8_t>(), rct_txes.back(), 0, tx_key, additional_tx_keys, true, rct_config[n]);
|
||||
CHECK_AND_ASSERT_MES(r, false, "failed to construct transaction");
|
||||
|
||||
if (post_tx && !post_tx(rct_txes.back(), n))
|
||||
|
||||
@@ -1078,7 +1078,9 @@ bool construct_tx_rct(const cryptonote::account_keys& sender_account_keys, std::
|
||||
std::vector<crypto::secret_key> additional_tx_keys;
|
||||
std::vector<tx_destination_entry> destinations_copy = destinations;
|
||||
rct::RCTConfig rct_config = {range_proof_type, bp_version};
|
||||
return construct_tx_and_get_tx_key(sender_account_keys, subaddresses, sources, destinations_copy, 1/*hf_version*/, change_addr, extra, tx, unlock_time, tx_key, additional_tx_keys, rct, rct_config);
|
||||
std::string source_asset = "FULM";
|
||||
std::string dest_asset = "FULM";
|
||||
return construct_tx_and_get_tx_key(sender_account_keys, subaddresses, sources, destinations_copy, 1/*hf_version*/, source_asset, dest_asset, change_addr, extra, tx, unlock_time, tx_key, additional_tx_keys, rct, rct_config);
|
||||
}
|
||||
|
||||
transaction construct_tx_with_fee(std::vector<test_event_entry>& events, const block& blk_head,
|
||||
|
||||
@@ -144,7 +144,7 @@ bool gen_double_spend_in_tx<txs_keeped_by_block>::generate(std::vector<test_even
|
||||
destinations.push_back(de);
|
||||
|
||||
cryptonote::transaction tx_1;
|
||||
if (!construct_tx(bob_account.get_keys(), sources, destinations, 1/*hf_version*/, boost::none, std::vector<uint8_t>(), tx_1, 0))
|
||||
if (!construct_tx(bob_account.get_keys(), sources, destinations, 1/*hf_version*/, "FULM", "FULM", boost::none, std::vector<uint8_t>(), tx_1, 0))
|
||||
return false;
|
||||
|
||||
SET_EVENT_VISITOR_SETT(events, txs_keeped_by_block ? event_visitor_settings::set_txs_keeped_by_block : 0);
|
||||
|
||||
@@ -174,7 +174,7 @@ bool gen_uint_overflow_2::generate(std::vector<test_event_entry>& events) const
|
||||
destinations.push_back(tx_destination_entry(sources.front().amount - MONEY_SUPPLY - MONEY_SUPPLY + 1 - TESTS_DEFAULT_FEE, bob_addr, false));
|
||||
|
||||
cryptonote::transaction tx_1;
|
||||
if (!construct_tx(miner_account.get_keys(), sources, destinations, 1/*hf_version*/, boost::none, std::vector<uint8_t>(), tx_1, 0))
|
||||
if (!construct_tx(miner_account.get_keys(), sources, destinations, 1/*hf_version*/, "FULM", "FULM", boost::none, std::vector<uint8_t>(), tx_1, 0))
|
||||
return false;
|
||||
events.push_back(tx_1);
|
||||
|
||||
@@ -200,7 +200,7 @@ bool gen_uint_overflow_2::generate(std::vector<test_event_entry>& events) const
|
||||
destinations.push_back(de);
|
||||
|
||||
cryptonote::transaction tx_2;
|
||||
if (!construct_tx(bob_account.get_keys(), sources, destinations, 1/*hf_version*/, boost::none, std::vector<uint8_t>(), tx_2, 0))
|
||||
if (!construct_tx(bob_account.get_keys(), sources, destinations, 1/*hf_version*/, "FULM", "FULM", boost::none, std::vector<uint8_t>(), tx_2, 0))
|
||||
return false;
|
||||
events.push_back(tx_2);
|
||||
|
||||
|
||||
@@ -122,7 +122,9 @@ bool gen_rct_tx_validation_base::generate_with_full(std::vector<test_event_entry
|
||||
std::vector<crypto::secret_key> additional_tx_keys;
|
||||
std::unordered_map<crypto::public_key, cryptonote::subaddress_index> subaddresses;
|
||||
subaddresses[miner_accounts[n].get_keys().m_account_address.m_spend_public_key] = {0,0};
|
||||
bool r = construct_tx_and_get_tx_key(miner_accounts[n].get_keys(), subaddresses, sources, destinations, 1/*hf_version*/, cryptonote::account_public_address{}, std::vector<uint8_t>(), rct_txes[n], 0, tx_key, additional_tx_keys, true);
|
||||
std::string source_asset = "FULM";
|
||||
std::string dest_asset = "FULM";
|
||||
bool r = construct_tx_and_get_tx_key(miner_accounts[n].get_keys(), subaddresses, sources, destinations, 1/*hf_version*/, source_asset, dest_asset, cryptonote::account_public_address{}, std::vector<uint8_t>(), rct_txes[n], 0, tx_key, additional_tx_keys, true);
|
||||
CHECK_AND_ASSERT_MES(r, false, "failed to construct transaction");
|
||||
events.push_back(rct_txes[n]);
|
||||
starting_rct_tx_hashes.push_back(get_transaction_hash(rct_txes[n]));
|
||||
@@ -229,7 +231,9 @@ bool gen_rct_tx_validation_base::generate_with_full(std::vector<test_event_entry
|
||||
std::vector<crypto::secret_key> additional_tx_keys;
|
||||
std::unordered_map<crypto::public_key, cryptonote::subaddress_index> subaddresses;
|
||||
subaddresses[miner_accounts[0].get_keys().m_account_address.m_spend_public_key] = {0,0};
|
||||
bool r = construct_tx_and_get_tx_key(miner_accounts[0].get_keys(), subaddresses, sources, destinations, 1/*hf_version*/, cryptonote::account_public_address{}, std::vector<uint8_t>(), tx, 0, tx_key, additional_tx_keys, true, rct_config, use_view_tags);
|
||||
std::string source_asset = "FULM";
|
||||
std::string dest_asset = "FULM";
|
||||
bool r = construct_tx_and_get_tx_key(miner_accounts[0].get_keys(), subaddresses, sources, destinations, 1/*hf_version*/, source_asset, dest_asset, cryptonote::account_public_address{}, std::vector<uint8_t>(), tx, 0, tx_key, additional_tx_keys, true, rct_config, use_view_tags);
|
||||
CHECK_AND_ASSERT_MES(r, false, "failed to construct transaction");
|
||||
|
||||
if (post_tx)
|
||||
|
||||
@@ -136,7 +136,9 @@ bool gen_rct2_tx_validation_base::generate_with(std::vector<test_event_entry>& e
|
||||
std::unordered_map<crypto::public_key, cryptonote::subaddress_index> subaddresses;
|
||||
subaddresses[miner_accounts[n].get_keys().m_account_address.m_spend_public_key] = {0,0};
|
||||
rct_txes.resize(rct_txes.size() + 1);
|
||||
bool r = construct_tx_and_get_tx_key(miner_accounts[n].get_keys(), subaddresses, sources, destinations, 1/*hf_version*/, cryptonote::account_public_address{}, std::vector<uint8_t>(), rct_txes.back(), 0, tx_key, additional_tx_keys, true, rct_config[n]);
|
||||
std::string source_asset = "FULM";
|
||||
std::string dest_asset = "FULM";
|
||||
bool r = construct_tx_and_get_tx_key(miner_accounts[n].get_keys(), subaddresses, sources, destinations, 1/*hf_version*/, source_asset, dest_asset, cryptonote::account_public_address{}, std::vector<uint8_t>(), rct_txes.back(), 0, tx_key, additional_tx_keys, true, rct_config[n]);
|
||||
CHECK_AND_ASSERT_MES(r, false, "failed to construct transaction");
|
||||
|
||||
if (post_tx && !post_tx(rct_txes.back(), n))
|
||||
|
||||
@@ -157,7 +157,7 @@ bool test_transaction_generation_and_ring_signature()
|
||||
destinations.push_back(td);
|
||||
|
||||
transaction tx_rc1;
|
||||
bool r = construct_tx(miner_acc2.get_keys(), sources, destinations, 1/*hf_version*/, boost::none, std::vector<uint8_t>(), tx_rc1, 0);
|
||||
bool r = construct_tx(miner_acc2.get_keys(), sources, destinations, 1/*hf_version*/, "FULM", "FULM", boost::none, std::vector<uint8_t>(), tx_rc1, 0);
|
||||
CHECK_AND_ASSERT_MES(r, false, "failed to construct transaction");
|
||||
|
||||
crypto::hash pref_hash = get_transaction_prefix_hash(tx_rc1);
|
||||
|
||||
@@ -107,7 +107,7 @@ bool gen_v2_tx_validation_base::generate_with(std::vector<test_event_entry>& eve
|
||||
destinations.push_back(td);
|
||||
|
||||
transaction tx;
|
||||
bool r = construct_tx(miner_accounts[0].get_keys(), sources, destinations, 1/*hf_version*/, boost::none, std::vector<uint8_t>(), tx, 0);
|
||||
bool r = construct_tx(miner_accounts[0].get_keys(), sources, destinations, 1/*hf_version*/, "FULM", "FULM", boost::none, std::vector<uint8_t>(), tx, 0);
|
||||
CHECK_AND_ASSERT_MES(r, false, "failed to construct transaction");
|
||||
if (!valid)
|
||||
DO_CALLBACK(events, "mark_invalid_tx");
|
||||
|
||||
@@ -280,5 +280,7 @@ bool construct_tx_rct(tools::wallet2 * sender_wallet, std::vector<cryptonote::tx
|
||||
std::vector<crypto::secret_key> additional_tx_keys;
|
||||
std::vector<tx_destination_entry> destinations_copy = destinations;
|
||||
rct::RCTConfig rct_config = {range_proof_type, bp_version};
|
||||
return construct_tx_and_get_tx_key(sender_wallet->get_account().get_keys(), subaddresses, sources, destinations_copy, 1/*hf_version*/, change_addr, extra, tx, unlock_time, tx_key, additional_tx_keys, rct, rct_config);
|
||||
std::string source_asset = "FULM";
|
||||
std::string dest_asset = "FULM";
|
||||
return construct_tx_and_get_tx_key(sender_wallet->get_account().get_keys(), subaddresses, sources, destinations_copy, 1/*hf_version*/, source_asset, dest_asset, change_addr, extra, tx, unlock_time, tx_key, additional_tx_keys, rct, rct_config);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user