diff options
author | gzhao408 <gzhao408@berkeley.edu> | 2020-09-03 18:05:26 -0700 |
---|---|---|
committer | gzhao408 <gzhao408@berkeley.edu> | 2020-09-10 07:37:14 -0700 |
commit | 784f757994c1306bb6584b14c0c78617d6248432 (patch) | |
tree | a884db60889e652e08236f668585d24aca65a3a6 /test/functional/mining_basic.py | |
parent | bd60a9a8edd4a3fe2f4f605b77cdae34969eaaf2 (diff) | |
download | bitcoin-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/mining_basic.py')
-rwxr-xr-x | test/functional/mining_basic.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/functional/mining_basic.py b/test/functional/mining_basic.py index b13740750f..1b2c7644bd 100755 --- a/test/functional/mining_basic.py +++ b/test/functional/mining_basic.py @@ -234,9 +234,9 @@ class MiningTest(BitcoinTestFramework): assert_raises_rpc_error(-25, 'time-too-old', lambda: node.submitheader(hexdata=CBlockHeader(bad_block_time).serialize().hex())) # Should ask for the block from a p2p node, if they announce the header as well: - node.add_p2p_connection(P2PDataStore()) - node.p2p.wait_for_getheaders(timeout=5) # Drop the first getheaders - node.p2p.send_blocks_and_test(blocks=[block], node=node) + peer = node.add_p2p_connection(P2PDataStore()) + peer.wait_for_getheaders(timeout=5) # Drop the first getheaders + peer.send_blocks_and_test(blocks=[block], node=node) # Must be active now: assert chain_tip(block.hash, status='active', branchlen=0) in node.getchaintips() |