mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-29 10:19:26 +02:00
[refactor] clarify tests by referencing p2p objects directly
Use object returned from add_p2p_connection to refer to p2ps. Add a test class attribute if it needs to be used across many methods. Don't use the p2p property.
This commit is contained in:
@ -2096,14 +2096,14 @@ class SegWitTest(BitcoinTestFramework):
|
||||
tx = FromHex(CTransaction(), raw)
|
||||
assert_raises_rpc_error(-22, "TX decode failed", self.nodes[0].decoderawtransaction, serialize_with_bogus_witness(tx).hex())
|
||||
with self.nodes[0].assert_debug_log(['Superfluous witness record']):
|
||||
self.nodes[0].p2p.send_and_ping(msg_bogus_tx(tx))
|
||||
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())
|
||||
with self.nodes[0].assert_debug_log(['Unknown transaction optional data']):
|
||||
self.nodes[0].p2p.send_and_ping(msg_bogus_tx(tx))
|
||||
self.test_node.send_and_ping(msg_bogus_tx(tx))
|
||||
|
||||
@subtest # type: ignore
|
||||
def test_wtxid_relay(self):
|
||||
|
Reference in New Issue
Block a user