From 78d59f33975d9f9ed98fff6496978b0ac3db26cb Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Tue, 20 Mar 2018 06:44:19 -0400 Subject: [PATCH] Merge #12728: [tests] rename TestNode to TestP2PConn in tests 728667b771 scripted-diff: rename TestNode to TestP2PConn in tests (John Newbery) Pull request description: Several test scripts define a subclass of P2PInterface called TestNode. This commit renames those to TestP2PConn since we already have a TestNode class in the test framework. Tree-SHA512: fc8472677312ad000560fa491b680a441d05c0fee5f8eea2d031d326d81e56d231c235930c0d09dd10afc98d7255fa9f9309d5e2ae6c252bc188a5951644a5b8 --- test/functional/maxuploadtarget.py | 6 +++--- test/functional/p2p-compactblocks.py | 10 +++++----- test/functional/p2p-timeouts.py | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/test/functional/maxuploadtarget.py b/test/functional/maxuploadtarget.py index fc91524873..66a899b3d4 100755 --- a/test/functional/maxuploadtarget.py +++ b/test/functional/maxuploadtarget.py @@ -16,7 +16,7 @@ from test_framework.mininode import * from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * -class TestNode(P2PInterface): +class TestP2PConn(P2PInterface): def __init__(self): super().__init__() self.block_receive_map = defaultdict(int) @@ -59,7 +59,7 @@ class MaxUploadTest(BitcoinTestFramework): p2p_conns = [] for _ in range(3): - p2p_conns.append(self.nodes[0].add_p2p_connection(TestNode())) + p2p_conns.append(self.nodes[0].add_p2p_connection(TestP2PConn())) network_thread_start() for p2pc in p2p_conns: @@ -151,7 +151,7 @@ class MaxUploadTest(BitcoinTestFramework): self.start_node(0, ["-whitelist=127.0.0.1", "-maxuploadtarget=1", "-blockmaxsize=999000", "-maxtipage="+str(2*60*60*24*7), "-mocktime="+str(current_mocktime)]) # Reconnect to self.nodes[0] - self.nodes[0].add_p2p_connection(TestNode()) + self.nodes[0].add_p2p_connection(TestP2PConn()) network_thread_start() self.nodes[0].p2p.wait_for_verack() diff --git a/test/functional/p2p-compactblocks.py b/test/functional/p2p-compactblocks.py index 68741a100c..1ae8f773f0 100755 --- a/test/functional/p2p-compactblocks.py +++ b/test/functional/p2p-compactblocks.py @@ -11,8 +11,8 @@ from test_framework.util import * from test_framework.blocktools import create_block, create_coinbase from test_framework.script import CScript, OP_TRUE -# TestNode: A peer we use to send messages to dashd, and store responses. -class TestNode(P2PInterface): +# TestP2PConn: A peer we use to send messages to dashd, and store responses. +class TestP2PConn(P2PInterface): def __init__(self): super().__init__() self.last_sendcmpct = [] @@ -713,9 +713,9 @@ class CompactBlocksTest(BitcoinTestFramework): def run_test(self): # Setup the p2p connections and start up the network thread. - self.test_node = self.nodes[0].add_p2p_connection(TestNode()) - self.second_node = self.nodes[1].add_p2p_connection(TestNode(), services=NODE_NETWORK) - self.old_node = self.nodes[1].add_p2p_connection(TestNode(), services=NODE_NETWORK) + self.test_node = self.nodes[0].add_p2p_connection(TestP2PConn()) + self.second_node = self.nodes[1].add_p2p_connection(TestP2PConn(), services=NODE_NETWORK) + self.old_node = self.nodes[1].add_p2p_connection(TestP2PConn(), services=NODE_NETWORK) network_thread_start() diff --git a/test/functional/p2p-timeouts.py b/test/functional/p2p-timeouts.py index 4f48536297..a487f1a68e 100755 --- a/test/functional/p2p-timeouts.py +++ b/test/functional/p2p-timeouts.py @@ -27,7 +27,7 @@ from test_framework.mininode import * from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * -class TestNode(P2PInterface): +class TestP2PConn(P2PInterface): def on_version(self, message): # Don't send a verack in response pass @@ -41,9 +41,9 @@ class TimeoutsTest(BitcoinTestFramework): def run_test(self): # Setup the p2p connections and start up the network thread. - no_verack_node = self.nodes[0].add_p2p_connection(TestNode()) - no_version_node = self.nodes[0].add_p2p_connection(TestNode(), send_version=False) - no_send_node = self.nodes[0].add_p2p_connection(TestNode(), send_version=False) + no_verack_node = self.nodes[0].add_p2p_connection(TestP2PConn()) + no_version_node = self.nodes[0].add_p2p_connection(TestP2PConn(), send_version=False) + no_send_node = self.nodes[0].add_p2p_connection(TestP2PConn(), send_version=False) network_thread_start()