mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
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
This commit is contained in:
parent
773a16daa3
commit
78d59f3397
@ -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()
|
||||
|
@ -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()
|
||||
|
||||
|
@ -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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user