Skip to content

Commit d5800da

Browse files
committed
[test] Remove final references to mininode
1 parent 5e8df33 commit d5800da

File tree

8 files changed

+18
-14
lines changed

8 files changed

+18
-14
lines changed

test/functional/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ Base class for functional tests.
127127
#### [util.py](test_framework/util.py)
128128
Generally useful functions.
129129

130-
#### [mininode.py](test_framework/mininode.py)
131-
Basic code to support P2P connectivity to a bitcoind.
130+
#### [p2p.py](test_framework/p2p.py)
131+
Test objects for interacting with a bitcoind node over the p2p interface.
132132

133133
#### [script.py](test_framework/script.py)
134134
Utilities for manipulating transaction scripts (originally from python-bitcoinlib)

test/functional/example_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def run_test(self):
167167
height = self.nodes[0].getblockcount()
168168

169169
for _ in range(10):
170-
# Use the mininode and blocktools functionality to manually build a block
170+
# Use the blocktools functionality to manually build a block.
171171
# Calling the generate() rpc is easier, but this allows us to exactly
172172
# control the blocks and transactions.
173173
block = create_block(self.tip, create_coinbase(height+1), self.block_time)

test/functional/feature_block.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
from test_framework.util import assert_equal
5454
from data import invalid_txs
5555

56-
# Use this class for tests that require behavior other than normal "mininode" behavior.
56+
# Use this class for tests that require behavior other than normal p2p behavior.
5757
# For now, it is used to serialize a bloated varint (b64).
5858
class CBrokenBlock(CBlock):
5959
def initialize(self, base_block):

test/functional/p2p_permissions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def check_tx_relay(self):
109109
self.sync_all()
110110

111111
self.log.debug("Create a connection from a forcerelay peer that rebroadcasts raw txs")
112-
# A python mininode is needed to send the raw transaction directly. If a full node was used, it could only
112+
# A test framework p2p connection is needed to send the raw transaction directly. If a full node was used, it could only
113113
# rebroadcast via the inv-getdata mechanism. However, even for forcerelay connections, a full node would
114114
# currently not request a txid that is already in the mempool.
115115
self.restart_node(1, extra_args=["[email protected]"])

test/functional/p2p_segwit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ def __init__(self, wtxidrelay=False):
153153
self.lastgetdata = []
154154
self.wtxidrelay = wtxidrelay
155155

156-
# Avoid sending out msg_getdata in the mininode thread as a reply to invs.
157-
# They are not needed and would only lead to races because we send msg_getdata out in the test thread
156+
# Don't send getdata message replies to invs automatically.
157+
# We'll send the getdata messages explicitly in the test logic.
158158
def on_inv(self, message):
159159
pass
160160

test/functional/test_framework/messages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
MIN_VERSION_SUPPORTED = 60001
3434
MY_VERSION = 70016 # past wtxid relay
35-
MY_SUBVERSION = b"/python-mininode-tester:0.0.3/"
35+
MY_SUBVERSION = b"/python-p2p-tester:0.0.3/"
3636
MY_RELAY = 1 # from version 70001 onwards, fRelay should be appended to version messages (BIP37)
3737

3838
MAX_LOCATOR_SZ = 101

test/functional/test_framework/p2p.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44
# Copyright (c) 2010-2020 The Bitcoin Core developers
55
# Distributed under the MIT software license, see the accompanying
66
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
7-
"""Bitcoin P2P network half-a-node.
8-
9-
This python code was modified from ArtForz' public domain half-a-node, as
10-
found in the mini-node branch of http://github.com/jgarzik/pynode.
7+
"""Test objects for interacting with a bitcoind node over the p2p protocol.
8+
9+
The P2PInterface objects interact with the bitcoind nodes under test using the
10+
node's p2p interface. They can be used to send messages to the node, and
11+
callbacks can be registered that execute when messages are received from the
12+
node. Messages are sent to/received from the node on an asyncio event loop.
13+
State held inside the objects must be guarded by the p2p_lock to avoid data
14+
races between the main testing thread and the event loop.
1115
1216
P2PConnection: A low-level connection object to a node's P2P interface
1317
P2PInterface: A high-level interface object for communicating to a node over P2P

test/functional/test_framework/test_node.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ def p2p(self):
551551
assert self.p2ps, self._node_msg("No p2p connection")
552552
return self.p2ps[0]
553553

554-
def num_connected_mininodes(self):
554+
def num_test_p2p_connections(self):
555555
"""Return number of test framework p2p connections to the node."""
556556
return len([peer for peer in self.getpeerinfo() if peer['subver'] == MY_SUBVERSION])
557557

@@ -560,7 +560,7 @@ def disconnect_p2ps(self):
560560
for p in self.p2ps:
561561
p.peer_disconnect()
562562
del self.p2ps[:]
563-
wait_until(lambda: self.num_connected_mininodes() == 0)
563+
wait_until(lambda: self.num_test_p2p_connections() == 0)
564564

565565

566566
class TestNodeCLIAttr:

0 commit comments

Comments
 (0)