aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-10-29 13:33:08 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-10-29 13:33:48 +0100
commitffd8c41f36dc38db96bef169dbe2bfe20652d8f8 (patch)
tree69d8834549486396f8be36d5fe14574fe71e707d /tests
parentringct: always shutdown the boost io service (diff)
downloadmonero-ffd8c41f36dc38db96bef169dbe2bfe20652d8f8.tar.xz
ringct: check the size of amount_keys is the same as destinations
Diffstat (limited to 'tests')
-rw-r--r--tests/unit_tests/ringct.cpp5
-rw-r--r--tests/unit_tests/serialization.cpp1
2 files changed, 4 insertions, 2 deletions
diff --git a/tests/unit_tests/ringct.cpp b/tests/unit_tests/ringct.cpp
index 224e32e61..1abf2511d 100644
--- a/tests/unit_tests/ringct.cpp
+++ b/tests/unit_tests/ringct.cpp
@@ -246,7 +246,6 @@ TEST(ringct, range_proofs_with_fee)
//add txn fee for 1
//has no corresponding destination..
amounts.push_back(1);
- amount_keys.push_back(hash_to_scalar(zero()));
//add output for 12500
amounts.push_back(12500);
@@ -356,10 +355,12 @@ static rct::rctSig make_sample_rct_sig(int n_inputs, const uint64_t input_amount
for (int n = 0; n < n_outputs; ++n) {
amounts.push_back(output_amounts[n]);
- amount_keys.push_back(rct::hash_to_scalar(rct::zero()));
skpkGen(Sk, Pk);
if (n < n_outputs - 1 || !last_is_fee)
+ {
destinations.push_back(Pk);
+ amount_keys.push_back(rct::hash_to_scalar(rct::zero()));
+ }
}
return genRct(rct::zero(), sc, pc, destinations, amounts, amount_keys, 3);;
diff --git a/tests/unit_tests/serialization.cpp b/tests/unit_tests/serialization.cpp
index f51f9ec67..dc7f7cb06 100644
--- a/tests/unit_tests/serialization.cpp
+++ b/tests/unit_tests/serialization.cpp
@@ -559,6 +559,7 @@ TEST(Serialization, serializes_ringct_types)
rct::keyV amount_keys;
//add output 500
amounts.push_back(500);
+ amount_keys.push_back(rct::hash_to_scalar(rct::zero()));
rct::keyV destinations;
rct::key Sk, Pk;
rct::skpkGen(Sk, Pk);