mirror of
				https://github.com/bitcoin/bitcoin.git
				synced 2024-05-17 23:56:39 +00:00 
			
		
		
		
	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
This commit is contained in:
		
						commit
						6954e4d16c
					
				| @ -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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user