aboutsummaryrefslogtreecommitdiff
path: root/tests/performance_tests
diff options
context:
space:
mode:
authorkenshi84 <kenshi84@protonmail.ch>2017-02-19 11:42:10 +0900
committerkenshi84 <kenshi84@protonmail.ch>2017-10-07 13:06:21 +0900
commit53ad5a0f42174bca57e24485ef3d40e4b9cf5599 (patch)
treeafc13a3ee6a049ec78ac234e2d55ff46e992b457 /tests/performance_tests
parentMerge pull request #2548 (diff)
downloadmonero-53ad5a0f42174bca57e24485ef3d40e4b9cf5599.tar.xz
Subaddresses
Diffstat (limited to 'tests/performance_tests')
-rw-r--r--tests/performance_tests/check_tx_signature.h7
-rw-r--r--tests/performance_tests/construct_tx.h7
-rw-r--r--tests/performance_tests/ge_frombytes_vartime.h2
-rw-r--r--tests/performance_tests/generate_key_image_helper.h5
-rw-r--r--tests/performance_tests/is_out_to_acc.h2
-rw-r--r--tests/performance_tests/single_tx_test_base.h2
6 files changed, 18 insertions, 7 deletions
diff --git a/tests/performance_tests/check_tx_signature.h b/tests/performance_tests/check_tx_signature.h
index 1e02bfcaa..02555fae8 100644
--- a/tests/performance_tests/check_tx_signature.h
+++ b/tests/performance_tests/check_tx_signature.h
@@ -62,10 +62,13 @@ public:
m_alice.generate();
std::vector<tx_destination_entry> destinations;
- destinations.push_back(tx_destination_entry(this->m_source_amount, m_alice.get_keys().m_account_address));
+ destinations.push_back(tx_destination_entry(this->m_source_amount, m_alice.get_keys().m_account_address, false));
crypto::secret_key tx_key;
- if (!construct_tx_and_get_tx_key(this->m_miners[this->real_source_idx].get_keys(), this->m_sources, destinations, std::vector<uint8_t>(), m_tx, 0, tx_key, rct))
+ std::vector<crypto::secret_key> additional_tx_keys;
+ std::unordered_map<crypto::public_key, cryptonote::subaddress_index> subaddresses;
+ subaddresses[this->m_miners[this->real_source_idx].get_keys().m_account_address.m_spend_public_key] = {0,0};
+ if (!construct_tx_and_get_tx_key(this->m_miners[this->real_source_idx].get_keys(), subaddresses, this->m_sources, destinations, cryptonote::account_public_address{}, std::vector<uint8_t>(), m_tx, 0, tx_key, additional_tx_keys, rct))
return false;
get_transaction_prefix_hash(m_tx, m_tx_prefix_hash);
diff --git a/tests/performance_tests/construct_tx.h b/tests/performance_tests/construct_tx.h
index 90e4cf76e..e01ee5cfa 100644
--- a/tests/performance_tests/construct_tx.h
+++ b/tests/performance_tests/construct_tx.h
@@ -61,7 +61,7 @@ public:
for (size_t i = 0; i < out_count; ++i)
{
- m_destinations.push_back(tx_destination_entry(this->m_source_amount / out_count, m_alice.get_keys().m_account_address));
+ m_destinations.push_back(tx_destination_entry(this->m_source_amount / out_count, m_alice.get_keys().m_account_address, false));
}
return true;
@@ -70,7 +70,10 @@ public:
bool test()
{
crypto::secret_key tx_key;
- return cryptonote::construct_tx_and_get_tx_key(this->m_miners[this->real_source_idx].get_keys(), this->m_sources, m_destinations, std::vector<uint8_t>(), m_tx, 0, tx_key, rct);
+ std::vector<crypto::secret_key> additional_tx_keys;
+ std::unordered_map<crypto::public_key, cryptonote::subaddress_index> subaddresses;
+ subaddresses[this->m_miners[this->real_source_idx].get_keys().m_account_address.m_spend_public_key] = {0,0};
+ 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);
}
private:
diff --git a/tests/performance_tests/ge_frombytes_vartime.h b/tests/performance_tests/ge_frombytes_vartime.h
index 491cea097..a5e64aeb2 100644
--- a/tests/performance_tests/ge_frombytes_vartime.h
+++ b/tests/performance_tests/ge_frombytes_vartime.h
@@ -52,7 +52,7 @@ public:
m_alice.generate();
std::vector<tx_destination_entry> destinations;
- destinations.push_back(tx_destination_entry(1, m_alice.get_keys().m_account_address));
+ 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);
}
diff --git a/tests/performance_tests/generate_key_image_helper.h b/tests/performance_tests/generate_key_image_helper.h
index 1332e7f62..bc92303eb 100644
--- a/tests/performance_tests/generate_key_image_helper.h
+++ b/tests/performance_tests/generate_key_image_helper.h
@@ -45,6 +45,9 @@ public:
{
cryptonote::keypair in_ephemeral;
crypto::key_image ki;
- return cryptonote::generate_key_image_helper(m_bob.get_keys(), m_tx_pub_key, 0, in_ephemeral, ki);
+ std::unordered_map<crypto::public_key, cryptonote::subaddress_index> subaddresses;
+ subaddresses[m_bob.get_keys().m_account_address.m_spend_public_key] = {0,0};
+ crypto::public_key out_key = boost::get<cryptonote::txout_to_key>(m_tx.vout[0].target).key;
+ return cryptonote::generate_key_image_helper(m_bob.get_keys(), subaddresses, out_key, m_tx_pub_key, m_additional_tx_pub_keys, 0, in_ephemeral, ki);
}
};
diff --git a/tests/performance_tests/is_out_to_acc.h b/tests/performance_tests/is_out_to_acc.h
index ed8951659..12ef0f79f 100644
--- a/tests/performance_tests/is_out_to_acc.h
+++ b/tests/performance_tests/is_out_to_acc.h
@@ -44,7 +44,7 @@ public:
bool test()
{
const cryptonote::txout_to_key& tx_out = boost::get<cryptonote::txout_to_key>(m_tx.vout[0].target);
- return cryptonote::is_out_to_acc(m_bob.get_keys(), tx_out, m_tx_pub_key, 0);
+ return cryptonote::is_out_to_acc(m_bob.get_keys(), tx_out, m_tx_pub_key, m_additional_tx_pub_keys, 0);
}
};
diff --git a/tests/performance_tests/single_tx_test_base.h b/tests/performance_tests/single_tx_test_base.h
index 9e38d979b..f284b4198 100644
--- a/tests/performance_tests/single_tx_test_base.h
+++ b/tests/performance_tests/single_tx_test_base.h
@@ -47,6 +47,7 @@ public:
return false;
m_tx_pub_key = get_tx_pub_key_from_extra(m_tx);
+ m_additional_tx_pub_keys = get_additional_tx_pub_keys_from_extra(m_tx);
return true;
}
@@ -54,4 +55,5 @@ protected:
cryptonote::account_base m_bob;
cryptonote::transaction m_tx;
crypto::public_key m_tx_pub_key;
+ std::vector<crypto::public_key> m_additional_tx_pub_keys;
};