mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-02 19:52:01 +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:
@ -317,7 +317,7 @@ class BlockchainTest(BitcoinTestFramework):
|
||||
def _test_waitforblockheight(self):
|
||||
self.log.info("Test waitforblockheight")
|
||||
node = self.nodes[0]
|
||||
node.add_p2p_connection(P2PInterface())
|
||||
peer = node.add_p2p_connection(P2PInterface())
|
||||
|
||||
current_height = node.getblock(node.getbestblockhash())['height']
|
||||
|
||||
@ -334,7 +334,7 @@ class BlockchainTest(BitcoinTestFramework):
|
||||
def solve_and_send_block(prevhash, height, time):
|
||||
b = create_block(prevhash, create_coinbase(height), time)
|
||||
b.solve()
|
||||
node.p2p.send_and_ping(msg_block(b))
|
||||
peer.send_and_ping(msg_block(b))
|
||||
return b
|
||||
|
||||
b21f = solve_and_send_block(int(b20hash, 16), 21, b20['time'] + 1)
|
||||
|
Reference in New Issue
Block a user