mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
Merge #20303: fuzz: Assert expected DecodeHexTx behaviour when using legacy decoding
d7901ab8d2
fuzz: Assert expected DecodeHexTx behaviour when using legacy decoding (practicalswift) Pull request description: Assert expected `DecodeHexTx` behaviour when using legacy decoding. As suggested by MarcoFalke in https://github.com/bitcoin/bitcoin/pull/20290#issuecomment-720989597. ACKs for top commit: MarcoFalke: review ACKd7901ab8d2
Tree-SHA512: 3285680059e6fa73b0fb2c52b775f6319de1ac616f731206662b742764dc888cdfd1ac1f1fcfdfd5418d2006475a852d1c1a56a7035f772f0a6b2a84f5de93bc
This commit is contained in:
commit
f33e332541
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