aboutsummaryrefslogtreecommitdiff
path: root/test/functional/rpc_blockchain.py
diff options
context:
space:
mode:
authorgzhao408 <gzhao408@berkeley.edu>2020-09-03 18:05:26 -0700
committergzhao408 <gzhao408@berkeley.edu>2020-09-10 07:37:14 -0700
commit784f757994c1306bb6584b14c0c78617d6248432 (patch)
treea884db60889e652e08236f668585d24aca65a3a6 /test/functional/rpc_blockchain.py
parentbd60a9a8edd4a3fe2f4f605b77cdae34969eaaf2 (diff)
downloadbitcoin-784f757994c1306bb6584b14c0c78617d6248432.tar.xz
[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.
Diffstat (limited to 'test/functional/rpc_blockchain.py')
-rwxr-xr-xtest/functional/rpc_blockchain.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/functional/rpc_blockchain.py b/test/functional/rpc_blockchain.py
index c005584485..35cea85c07 100755
--- a/test/functional/rpc_blockchain.py
+++ b/test/functional/rpc_blockchain.py
@@ -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)