diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-11-05 07:57:25 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-11-05 07:57:28 +0100 |
commit | f33e3325417988711476fd4703ac013d13a5de46 (patch) | |
tree | 5093e82d5ee28a57e673ffb9ab2e7df550ab4701 /src | |
parent | 6954e4d16c1c14142c400e561224fcc98bf6a519 (diff) | |
parent | d7901ab8d2fdd2f6e68c4fa48078111bf5f0fa73 (diff) | |
download | bitcoin-f33e3325417988711476fd4703ac013d13a5de46.tar.xz |
Merge #20303: fuzz: Assert expected DecodeHexTx behaviour when using legacy decoding
d7901ab8d2fdd2f6e68c4fa48078111bf5f0fa73 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 ACK d7901ab8d2fdd2f6e68c4fa48078111bf5f0fa73
Tree-SHA512: 3285680059e6fa73b0fb2c52b775f6319de1ac616f731206662b742764dc888cdfd1ac1f1fcfdfd5418d2006475a852d1c1a56a7035f772f0a6b2a84f5de93bc
Diffstat (limited to 'src')
-rw-r--r-- | src/test/fuzz/decode_tx.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/fuzz/decode_tx.cpp b/src/test/fuzz/decode_tx.cpp index a29686cbdd..a2b18c0365 100644 --- a/src/test/fuzz/decode_tx.cpp +++ b/src/test/fuzz/decode_tx.cpp @@ -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); } } |