aboutsummaryrefslogtreecommitdiff
path: root/test/functional/p2p-fingerprint.py
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2017-11-08 13:10:43 -0500
committerMarcoFalke <falke.marco@gmail.com>2017-11-08 13:11:07 -0500
commitf7388e93d3dd91a90239aedac4ec58404f103a2e (patch)
tree4427094650d2405728b243cdb63911b86bada368 /test/functional/p2p-fingerprint.py
parent0a2f46b0158b6fc7244a585913b0925c0acf707f (diff)
parent32ae82f5c3d51a66ad4deb84819809b890664245 (diff)
Merge #11182: [tests] Add P2P interface to TestNode
32ae82f5c [tests] use TestNode p2p connection in tests (John Newbery) 5e5725cc2 [tests] Add p2p connection to TestNode (John Newbery) b86c1cd20 [tests] fix TestNode.__getattr__() method (John Newbery) Pull request description: Final two steps of #10082 : Adding the "mininode" P2P interface to `TestNode` This PR adds the mininode P2P interface to `TestNode`. It simplifies the process for opening a P2P connection to the node-under-test from this: ```python node0 = NodeConnCB() connections = [] connections.append(NodeConn('127.0.0.1', p2p_port(0), self.nodes[0], node0)) node0.add_connection(connections[0]) ``` to this: ```python self.nodes[0].add_p2p_connection(p2p_conn_type=NodeConnCB) ``` The first commit adds the infrastructure to `test_node.py`. The second updates the individual test cases to use it. Can be separated if this is too much review for one PR. Tree-SHA512: 44f1a6320f44eefc70489ae8350c6a16ad1a6035e4b9b7bafbdf19f5905ed0e2db85beaaf4758eec3059dd89a375a47a45352a029f39f57a86ab38a9ae66650e
Diffstat (limited to 'test/functional/p2p-fingerprint.py')
-rwxr-xr-xtest/functional/p2p-fingerprint.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/test/functional/p2p-fingerprint.py b/test/functional/p2p-fingerprint.py
index fe60c6cd46..4b6446fc5b 100755
--- a/test/functional/p2p-fingerprint.py
+++ b/test/functional/p2p-fingerprint.py
@@ -14,7 +14,6 @@ from test_framework.blocktools import (create_block, create_coinbase)
from test_framework.mininode import (
CInv,
NetworkThread,
- NodeConn,
NodeConnCB,
msg_headers,
msg_block,
@@ -77,11 +76,7 @@ class P2PFingerprintTest(BitcoinTestFramework):
# This does not currently test that stale blocks timestamped within the
# last month but that have over a month's worth of work are also withheld.
def run_test(self):
- node0 = NodeConnCB()
-
- connections = []
- connections.append(NodeConn('127.0.0.1', p2p_port(0), self.nodes[0], node0))
- node0.add_connection(connections[0])
+ node0 = self.nodes[0].add_p2p_connection(NodeConnCB())
NetworkThread().start()
node0.wait_for_verack()