aboutsummaryrefslogtreecommitdiff
path: root/tests/performance_tests/check_tx_signature.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-01-14 23:05:48 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-09-11 13:37:27 +0000
commitf34e2e20bdfbefa171e3bbb46615b2b0513ca394 (patch)
treedc599b945e82ebe99b3d08afe4334752c7ac017d /tests/performance_tests/check_tx_signature.h
parentperformance_tests: add a --verbose flag, and default to terse (diff)
downloadmonero-f34e2e20bdfbefa171e3bbb46615b2b0513ca394.tar.xz
performance_tests: add tx checking tests with more than 2 outputs
Diffstat (limited to 'tests/performance_tests/check_tx_signature.h')
-rw-r--r--tests/performance_tests/check_tx_signature.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/performance_tests/check_tx_signature.h b/tests/performance_tests/check_tx_signature.h
index ec570e69d..93a8304be 100644
--- a/tests/performance_tests/check_tx_signature.h
+++ b/tests/performance_tests/check_tx_signature.h
@@ -40,15 +40,17 @@
#include "multi_tx_test_base.h"
-template<size_t a_ring_size, bool a_rct>
+template<size_t a_ring_size, size_t a_outputs, bool a_rct, bool a_bulletproof>
class test_check_tx_signature : private multi_tx_test_base<a_ring_size>
{
static_assert(0 < a_ring_size, "ring_size must be greater than 0");
public:
- static const size_t loop_count = a_rct ? 10 : a_ring_size < 100 ? 100 : 10;
+ static const size_t loop_count = a_rct ? (a_ring_size <= 2 ? 50 : 10) : a_ring_size < 100 ? 100 : 10;
static const size_t ring_size = a_ring_size;
+ static const size_t outputs = a_outputs;
static const bool rct = a_rct;
+ static const bool bulletproof = a_bulletproof;
typedef multi_tx_test_base<a_ring_size> base_class;
@@ -62,13 +64,15 @@ 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, false));
+ destinations.push_back(tx_destination_entry(this->m_source_amount - outputs + 1, m_alice.get_keys().m_account_address, false));
+ for (size_t n = 1; n < outputs; ++n)
+ destinations.push_back(tx_destination_entry(1, m_alice.get_keys().m_account_address, false));
crypto::secret_key tx_key;
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))
+ 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, bulletproof))
return false;
get_transaction_prefix_hash(m_tx, m_tx_prefix_hash);