Skip to content

Commit f33e332

Browse files
author
MarcoFalke
committed
Merge bitcoin#20303: fuzz: Assert expected DecodeHexTx behaviour when using legacy decoding
d7901ab 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 bitcoin#20290 (comment). ACKs for top commit: MarcoFalke: review ACK d7901ab Tree-SHA512: 3285680059e6fa73b0fb2c52b775f6319de1ac616f731206662b742764dc888cdfd1ac1f1fcfdfd5418d2006475a852d1c1a56a7035f772f0a6b2a84f5de93bc
2 parents 6954e4d + d7901ab commit f33e332

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/test/fuzz/decode_tx.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@ void test_one_input(const std::vector<uint8_t>& buffer)
1919
const bool result_none = DecodeHexTx(mtx, tx_hex, false, false);
2020
const bool result_try_witness = DecodeHexTx(mtx, tx_hex, false, true);
2121
const bool result_try_witness_and_maybe_no_witness = DecodeHexTx(mtx, tx_hex, true, true);
22-
const bool result_try_no_witness = DecodeHexTx(mtx, tx_hex, true, false);
22+
CMutableTransaction no_witness_mtx;
23+
const bool result_try_no_witness = DecodeHexTx(no_witness_mtx, tx_hex, true, false);
2324
assert(!result_none);
2425
if (result_try_witness_and_maybe_no_witness) {
2526
assert(result_try_no_witness || result_try_witness);
2627
}
2728
if (result_try_no_witness) {
29+
assert(!no_witness_mtx.HasWitness());
2830
assert(result_try_witness_and_maybe_no_witness);
2931
}
3032
}

0 commit comments

Comments
 (0)