mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 10:38:42 +01:00
test: Only try witness deserialize when checking for witness deserialize failure
This commit is contained in:
parent
867dbeba5f
commit
fae45c34d1
@ -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))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user