mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 09:46:52 -05:00
fuzz: Assert expected DecodeHexTx behaviour when using legacy decoding
This commit is contained in:
parent
88776c2926
commit
d7901ab8d2
1 changed files with 3 additions and 1 deletions
|
@ -19,12 +19,14 @@ void test_one_input(const std::vector<uint8_t>& buffer)
|
|||
const bool result_none = DecodeHexTx(mtx, tx_hex, false, false);
|
||||
const bool result_try_witness = DecodeHexTx(mtx, tx_hex, false, true);
|
||||
const bool result_try_witness_and_maybe_no_witness = DecodeHexTx(mtx, tx_hex, true, true);
|
||||
const bool result_try_no_witness = DecodeHexTx(mtx, tx_hex, true, false);
|
||||
CMutableTransaction no_witness_mtx;
|
||||
const bool result_try_no_witness = DecodeHexTx(no_witness_mtx, tx_hex, true, false);
|
||||
assert(!result_none);
|
||||
if (result_try_witness_and_maybe_no_witness) {
|
||||
assert(result_try_no_witness || result_try_witness);
|
||||
}
|
||||
if (result_try_no_witness) {
|
||||
assert(!no_witness_mtx.HasWitness());
|
||||
assert(result_try_witness_and_maybe_no_witness);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue