mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
core_tests: add a test for a tx with empty bulletproof
This commit is contained in:
parent
a129bbd944
commit
6526d87f17
3 changed files with 20 additions and 0 deletions
|
@ -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");
|
||||
|
|
|
@ -162,6 +162,12 @@ struct gen_bp_tx_invalid_not_enough_proofs : public gen_bp_tx_validation_base
|
|||
};
|
||||
template<> struct get_test_options<gen_bp_tx_invalid_not_enough_proofs>: public get_test_options<gen_bp_tx_validation_base> {};
|
||||
|
||||
struct gen_bp_tx_invalid_empty_proofs : public gen_bp_tx_validation_base
|
||||
{
|
||||
bool generate(std::vector<test_event_entry>& events) const;
|
||||
};
|
||||
template<> struct get_test_options<gen_bp_tx_invalid_empty_proofs>: public get_test_options<gen_bp_tx_validation_base> {};
|
||||
|
||||
struct gen_bp_tx_invalid_too_many_proofs : public gen_bp_tx_validation_base
|
||||
{
|
||||
bool generate(std::vector<test_event_entry>& events) const;
|
||||
|
|
|
@ -234,6 +234,7 @@ int main(int argc, char* argv[])
|
|||
GENERATE_AND_PLAY(gen_bp_txs_valid_2_and_2);
|
||||
GENERATE_AND_PLAY(gen_bp_txs_invalid_2_and_8_2_and_16_16_1);
|
||||
GENERATE_AND_PLAY(gen_bp_tx_invalid_not_enough_proofs);
|
||||
GENERATE_AND_PLAY(gen_bp_tx_invalid_empty_proofs);
|
||||
GENERATE_AND_PLAY(gen_bp_tx_invalid_too_many_proofs);
|
||||
GENERATE_AND_PLAY(gen_bp_tx_invalid_wrong_amount);
|
||||
GENERATE_AND_PLAY(gen_bp_tx_invalid_borromean_type);
|
||||
|
|
Loading…
Reference in a new issue