aboutsummaryrefslogtreecommitdiff
path: root/tests/performance_tests
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-09-25 20:13:34 +0200
committerRiccardo Spagni <ric@spagni.net>2017-09-25 20:13:34 +0200
commit999c097941147d9ba409a816b38c0bccbad696dc (patch)
treee68e9702bce357621e02618936f49bf70174b775 /tests/performance_tests
parentMerge pull request #2500 (diff)
parentperformance_tests: add a test for is_out_to_acc_precomp (diff)
downloadmonero-999c097941147d9ba409a816b38c0bccbad696dc.tar.xz
Merge pull request #2439
06a681cf performance_tests: add a test for is_out_to_acc_precomp (moneromooo-monero) 2ec928ba wallet2: simplify tx processing a bit (moneromooo-monero) 740e6533 wallet2: factor some of the tx scanning code (moneromooo-monero)
Diffstat (limited to 'tests/performance_tests')
-rw-r--r--tests/performance_tests/is_out_to_acc.h22
-rw-r--r--tests/performance_tests/main.cpp1
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/performance_tests/is_out_to_acc.h b/tests/performance_tests/is_out_to_acc.h
index 656815db9..ed8951659 100644
--- a/tests/performance_tests/is_out_to_acc.h
+++ b/tests/performance_tests/is_out_to_acc.h
@@ -47,3 +47,25 @@ public:
return cryptonote::is_out_to_acc(m_bob.get_keys(), tx_out, m_tx_pub_key, 0);
}
};
+
+class test_is_out_to_acc_precomp : public single_tx_test_base
+{
+public:
+ static const size_t loop_count = 1000;
+
+ bool init()
+ {
+ if (!single_tx_test_base::init())
+ return false;
+ crypto::generate_key_derivation(m_tx_pub_key, m_bob.get_keys().m_view_secret_key, m_derivation);
+ return true;
+ }
+ 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_precomp(m_bob.get_keys().m_account_address.m_spend_public_key, tx_out, m_derivation, 0);
+ }
+
+private:
+ crypto::key_derivation m_derivation;
+};
diff --git a/tests/performance_tests/main.cpp b/tests/performance_tests/main.cpp
index cc9fe86ef..3c0283eca 100644
--- a/tests/performance_tests/main.cpp
+++ b/tests/performance_tests/main.cpp
@@ -100,6 +100,7 @@ int main(int argc, char** argv)
TEST_PERFORMANCE2(test_check_tx_signature, 100, true);
TEST_PERFORMANCE0(test_is_out_to_acc);
+ TEST_PERFORMANCE0(test_is_out_to_acc_precomp);
TEST_PERFORMANCE0(test_generate_key_image_helper);
TEST_PERFORMANCE0(test_generate_key_derivation);
TEST_PERFORMANCE0(test_generate_key_image);