aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2020-11-05 14:55:55 +0800
committerfanquake <fanquake@gmail.com>2020-11-05 14:56:02 +0800
commit6954e4d16c1c14142c400e561224fcc98bf6a519 (patch)
tree968b0a2a56763a7eb255305c35dd3ce39e4a94e1 /test
parent83650e4df5caac2dbe734f9021430e525d5cc6a5 (diff)
parentfae45c34d13330442d5135cb9ac5a56dc697497b (diff)
downloadbitcoin-6954e4d16c1c14142c400e561224fcc98bf6a519.tar.xz
Merge #20283: test: Only try witness deser when checking for witness deser failure
fae45c34d13330442d5135cb9ac5a56dc697497b test: Only try witness deserialize when checking for witness deserialize failure (MarcoFalke) Pull request description: Witness deserialize will fail always. (This is what the test is checking for) Consequently, non-witness deserialize is also tried, and it might succeed accidentally. Avoid that by not trying non-witness deserialize. Fixes #20249 ACKs for top commit: jnewbery: utACK fae45c34d1 Tree-SHA512: 45e65b31603e3ca839776a7ed30e363b32eba20dfb67b7b55bff06715876850d4f6ba22f8ea4911a62e1f8ffff395bf187b23c46ddc766516b97057df000deb3
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/p2p_segwit.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/functional/p2p_segwit.py b/test/functional/p2p_segwit.py
index 5c15538418..e99ecd8026 100755
--- a/test/functional/p2p_segwit.py
+++ b/test/functional/p2p_segwit.py
@@ -2097,14 +2097,14 @@ class SegWitTest(BitcoinTestFramework):
raw = self.nodes[0].createrawtransaction([{"txid": unspent['txid'], "vout": unspent['vout']}], {self.nodes[0].getnewaddress(): 1})
tx = FromHex(CTransaction(), raw)
- assert_raises_rpc_error(-22, "TX decode failed", self.nodes[0].decoderawtransaction, serialize_with_bogus_witness(tx).hex())
+ assert_raises_rpc_error(-22, "TX decode failed", self.nodes[0].decoderawtransaction, hexstring=serialize_with_bogus_witness(tx).hex(), iswitness=True)
with self.nodes[0].assert_debug_log(['Superfluous witness record']):
self.test_node.send_and_ping(msg_bogus_tx(tx))
raw = self.nodes[0].signrawtransactionwithwallet(raw)
assert raw['complete']
raw = raw['hex']
tx = FromHex(CTransaction(), raw)
- assert_raises_rpc_error(-22, "TX decode failed", self.nodes[0].decoderawtransaction, serialize_with_bogus_witness(tx).hex())
+ assert_raises_rpc_error(-22, "TX decode failed", self.nodes[0].decoderawtransaction, hexstring=serialize_with_bogus_witness(tx).hex(), iswitness=True)
with self.nodes[0].assert_debug_log(['Unknown transaction optional data']):
self.test_node.send_and_ping(msg_bogus_tx(tx))