Merge pull request #2662

88ebfd64 core_tests: fix for subaddress patch (kenshi84)
e373a203 performance_tests: add master spend pubkey to subaddress hashtable (kenshi84)
This commit is contained in:
Riccardo Spagni 2017-11-03 11:58:06 +02:00
commit 13a84caa22
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD
10 changed files with 18 additions and 16 deletions

View file

@ -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, std::vector<uint8_t>(), tmp_tx, 0))
if (!construct_tx(miner_account.get_keys(), sources, destinations, 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, std::vector<uint8_t>(), tmp_tx, 0))
if (!construct_tx(miner_account.get_keys(), sources, destinations, boost::none, std::vector<uint8_t>(), tmp_tx, 0))
return false;
MAKE_MINER_TX_MANUALLY(miner_tx, blk_1);

View file

@ -563,7 +563,7 @@ bool construct_tx_to_key(const std::vector<test_event_entry>& events, cryptonote
vector<tx_destination_entry> destinations;
fill_tx_sources_and_destinations(events, blk_head, from, to, amount, fee, nmix, sources, destinations);
return construct_tx(from.get_keys(), sources, destinations, std::vector<uint8_t>(), tx, 0);
return construct_tx(from.get_keys(), sources, destinations, from.get_keys().m_account_address, std::vector<uint8_t>(), tx, 0);
}
transaction construct_tx_with_fee(std::vector<test_event_entry>& events, const block& blk_head,

View file

@ -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, std::vector<uint8_t>(), tx_1, 0))
if (!construct_tx(bob_account.get_keys(), sources, destinations, boost::none, std::vector<uint8_t>(), tx_1, 0))
return false;
SET_EVENT_VISITOR_SETT(events, event_visitor_settings::set_txs_keeped_by_block, txs_keeped_by_block);

View file

@ -65,6 +65,7 @@ namespace
se.real_output = 0;
se.rct = false;
se.real_out_tx_key = get_tx_pub_key_from_extra(tx);
se.real_out_additional_tx_keys = get_additional_tx_pub_keys_from_extra(tx);
se.real_output_in_tx_index = out_idx;
sources.push_back(se);
@ -175,7 +176,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, std::vector<uint8_t>(), tx_1, 0))
if (!construct_tx(miner_account.get_keys(), sources, destinations, boost::none, std::vector<uint8_t>(), tx_1, 0))
return false;
events.push_back(tx_1);
@ -201,7 +202,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, std::vector<uint8_t>(), tx_2, 0))
if (!construct_tx(bob_account.get_keys(), sources, destinations, boost::none, std::vector<uint8_t>(), tx_2, 0))
return false;
events.push_back(tx_2);

View file

@ -108,7 +108,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, std::vector<uint8_t>(), tx_rc1, 0);
bool r = construct_tx(miner_acc2.get_keys(), sources, destinations, 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);

View file

@ -108,7 +108,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, std::vector<uint8_t>(), tx, 0);
bool r = construct_tx(miner_accounts[0].get_keys(), sources, destinations, 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");

View file

@ -54,7 +54,7 @@ public:
std::vector<tx_destination_entry> destinations;
destinations.push_back(tx_destination_entry(1, m_alice.get_keys().m_account_address, false));
return construct_tx(this->m_miners[this->real_source_idx].get_keys(), this->m_sources, destinations, std::vector<uint8_t>(), m_tx, 0);
return construct_tx(this->m_miners[this->real_source_idx].get_keys(), this->m_sources, destinations, boost::none, std::vector<uint8_t>(), m_tx, 0);
}
bool test()

View file

@ -64,6 +64,7 @@ public:
{
const cryptonote::txout_to_key& tx_out = boost::get<cryptonote::txout_to_key>(m_tx.vout[0].target);
std::unordered_map<crypto::public_key, cryptonote::subaddress_index> subaddresses;
subaddresses[m_bob.get_keys().m_account_address.m_spend_public_key] = {0,0};
std::vector<crypto::key_derivation> additional_derivations;
boost::optional<cryptonote::subaddress_receive_info> info = cryptonote::is_out_to_acc_precomp(subaddresses, tx_out.key, m_derivation, additional_derivations, 0);
return (bool)info;