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/feature_maxuploadtarget.py | |
parent | bd60a9a8edd4a3fe2f4f605b77cdae34969eaaf2 (diff) |
[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/feature_maxuploadtarget.py')
-rwxr-xr-x | test/functional/feature_maxuploadtarget.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/functional/feature_maxuploadtarget.py b/test/functional/feature_maxuploadtarget.py index e5c62d1ea7..d0a94658ff 100755 --- a/test/functional/feature_maxuploadtarget.py +++ b/test/functional/feature_maxuploadtarget.py @@ -145,16 +145,16 @@ class MaxUploadTest(BitcoinTestFramework): self.restart_node(0, ["-whitelist=download@127.0.0.1", "-maxuploadtarget=1"]) # Reconnect to self.nodes[0] - self.nodes[0].add_p2p_connection(TestP2PConn()) + peer = self.nodes[0].add_p2p_connection(TestP2PConn()) #retrieve 20 blocks which should be enough to break the 1MB limit getdata_request.inv = [CInv(MSG_BLOCK, big_new_block)] for i in range(20): - self.nodes[0].p2p.send_and_ping(getdata_request) - assert_equal(self.nodes[0].p2p.block_receive_map[big_new_block], i+1) + peer.send_and_ping(getdata_request) + assert_equal(peer.block_receive_map[big_new_block], i+1) getdata_request.inv = [CInv(MSG_BLOCK, big_old_block)] - self.nodes[0].p2p.send_and_ping(getdata_request) + peer.send_and_ping(getdata_request) self.log.info("Peer still connected after trying to download old block (download permission)") peer_info = self.nodes[0].getpeerinfo() |