diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-07-26 10:21:28 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-09-11 13:38:18 +0000 |
commit | 6526d87f17a153a6a7f9f1e81a53b113c20e5f3b (patch) | |
tree | 8de15cde5ac705d8b5aa10168671aa535253b8df /tests/core_tests/bulletproofs.cpp | |
parent | multiexp: fix maxscalar off by one (diff) | |
download | monero-6526d87f17a153a6a7f9f1e81a53b113c20e5f3b.tar.xz |
core_tests: add a test for a tx with empty bulletproof
Diffstat (limited to 'tests/core_tests/bulletproofs.cpp')
-rw-r--r-- | tests/core_tests/bulletproofs.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/core_tests/bulletproofs.cpp b/tests/core_tests/bulletproofs.cpp index 3b3039a18..aea502faa 100644 --- a/tests/core_tests/bulletproofs.cpp +++ b/tests/core_tests/bulletproofs.cpp @@ -297,6 +297,19 @@ bool gen_bp_tx_invalid_not_enough_proofs::generate(std::vector<test_event_entry> }); } +bool gen_bp_tx_invalid_empty_proofs::generate(std::vector<test_event_entry>& events) const +{ + DEFINE_TESTS_ERROR_CONTEXT("gen_bp_tx_invalid_empty_proofs"); + const size_t mixin = 10; + const uint64_t amounts_paid[] = {50000, 50000, (uint64_t)-1}; + const rct::RangeProofType range_proof_type[] = { rct::RangeProofBulletproof }; + return generate_with(events, mixin, 1, amounts_paid, false, range_proof_type, NULL, [&](cryptonote::transaction &tx, size_t idx){ + CHECK_TEST_CONDITION(tx.rct_signatures.type == rct::RCTTypeBulletproof); + tx.rct_signatures.p.bulletproofs.clear(); + return true; + }); +} + bool gen_bp_tx_invalid_too_many_proofs::generate(std::vector<test_event_entry>& events) const { DEFINE_TESTS_ERROR_CONTEXT("gen_bp_tx_invalid_too_many_proofs"); |