Skip to content

Commit fae45c3

Browse files
author
MarcoFalke
committed
test: Only try witness deserialize when checking for witness deserialize failure
1 parent 867dbeb commit fae45c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/functional/p2p_segwit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2097,14 +2097,14 @@ def serialize(self):
20972097

20982098
raw = self.nodes[0].createrawtransaction([{"txid": unspent['txid'], "vout": unspent['vout']}], {self.nodes[0].getnewaddress(): 1})
20992099
tx = FromHex(CTransaction(), raw)
2100-
assert_raises_rpc_error(-22, "TX decode failed", self.nodes[0].decoderawtransaction, serialize_with_bogus_witness(tx).hex())
2100+
assert_raises_rpc_error(-22, "TX decode failed", self.nodes[0].decoderawtransaction, hexstring=serialize_with_bogus_witness(tx).hex(), iswitness=True)
21012101
with self.nodes[0].assert_debug_log(['Superfluous witness record']):
21022102
self.test_node.send_and_ping(msg_bogus_tx(tx))
21032103
raw = self.nodes[0].signrawtransactionwithwallet(raw)
21042104
assert raw['complete']
21052105
raw = raw['hex']
21062106
tx = FromHex(CTransaction(), raw)
2107-
assert_raises_rpc_error(-22, "TX decode failed", self.nodes[0].decoderawtransaction, serialize_with_bogus_witness(tx).hex())
2107+
assert_raises_rpc_error(-22, "TX decode failed", self.nodes[0].decoderawtransaction, hexstring=serialize_with_bogus_witness(tx).hex(), iswitness=True)
21082108
with self.nodes[0].assert_debug_log(['Unknown transaction optional data']):
21092109
self.test_node.send_and_ping(msg_bogus_tx(tx))
21102110

0 commit comments

Comments
 (0)