aboutsummaryrefslogtreecommitdiff
path: root/test/functional/feature_versionbits_warning.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/feature_versionbits_warning.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/feature_versionbits_warning.py')
-rwxr-xr-xtest/functional/feature_versionbits_warning.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/functional/feature_versionbits_warning.py b/test/functional/feature_versionbits_warning.py
index e1016e1581..2e4f4796b0 100755
--- a/test/functional/feature_versionbits_warning.py
+++ b/test/functional/feature_versionbits_warning.py
@@ -61,7 +61,7 @@ class VersionBitsWarningTest(BitcoinTestFramework):
def run_test(self):
node = self.nodes[0]
- node.add_p2p_connection(P2PInterface())
+ peer = node.add_p2p_connection(P2PInterface())
node_deterministic_address = node.get_deterministic_priv_key().address
# Mine one period worth of blocks
@@ -69,7 +69,7 @@ class VersionBitsWarningTest(BitcoinTestFramework):
self.log.info("Check that there is no warning if previous VB_BLOCKS have <VB_THRESHOLD blocks with unknown versionbits version.")
# Build one period of blocks with < VB_THRESHOLD blocks signaling some unknown bit
- self.send_blocks_with_version(node.p2p, VB_THRESHOLD - 1, VB_UNKNOWN_VERSION)
+ self.send_blocks_with_version(peer, VB_THRESHOLD - 1, VB_UNKNOWN_VERSION)
node.generatetoaddress(VB_PERIOD - VB_THRESHOLD + 1, node_deterministic_address)
# Check that we're not getting any versionbit-related errors in get*info()
@@ -77,7 +77,7 @@ class VersionBitsWarningTest(BitcoinTestFramework):
assert not VB_PATTERN.match(node.getnetworkinfo()["warnings"])
# Build one period of blocks with VB_THRESHOLD blocks signaling some unknown bit
- self.send_blocks_with_version(node.p2p, VB_THRESHOLD, VB_UNKNOWN_VERSION)
+ self.send_blocks_with_version(peer, VB_THRESHOLD, VB_UNKNOWN_VERSION)
node.generatetoaddress(VB_PERIOD - VB_THRESHOLD, node_deterministic_address)
self.log.info("Check that there is a warning if previous VB_BLOCKS have >=VB_THRESHOLD blocks with unknown versionbits version.")