aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorElliott Jin <elliott.jin@gmail.com>2020-09-17 00:32:01 -0700
committerElliott Jin <elliott.jin@gmail.com>2020-10-20 00:27:45 -0700
commitbe386840d4a394a1b6221fb7d0fa2b0bc4b1d413 (patch)
treef98ca6eef1e91537f0858b759841bae1b016f75b /test
parentf5bd46a4cc6d395ce71ecb99852c1774235a249c (diff)
downloadbitcoin-be386840d4a394a1b6221fb7d0fa2b0bc4b1d413.tar.xz
test: Replace use of (dis)?connect_nodes globals
A later scripted-diff commit replaces the majority of uses, which all follow this pattern: (dis)?connect_nodes(self.nodes[a], b) This commit replaces the few "special cases".
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/mempool_unbroadcast.py8
-rwxr-xr-xtest/functional/rpc_psbt.py3
2 files changed, 4 insertions, 7 deletions
diff --git a/test/functional/mempool_unbroadcast.py b/test/functional/mempool_unbroadcast.py
index abd5a03d95..b475b65e68 100755
--- a/test/functional/mempool_unbroadcast.py
+++ b/test/functional/mempool_unbroadcast.py
@@ -11,9 +11,7 @@ from test_framework.p2p import P2PTxInvStore
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_equal,
- connect_nodes,
create_confirmed_utxos,
- disconnect_nodes,
)
MAX_INITIAL_BROADCAST_DELAY = 15 * 60 # 15 minutes in seconds
@@ -36,7 +34,7 @@ class MempoolUnbroadcastTest(BitcoinTestFramework):
min_relay_fee = node.getnetworkinfo()["relayfee"]
utxos = create_confirmed_utxos(min_relay_fee, node, 10)
- disconnect_nodes(node, 1)
+ self.disconnect_nodes(0, 1)
self.log.info("Generate transactions that only node 0 knows about")
@@ -70,7 +68,7 @@ class MempoolUnbroadcastTest(BitcoinTestFramework):
self.restart_node(0)
self.log.info("Reconnect nodes & check if they are sent to node 1")
- connect_nodes(node, 1)
+ self.connect_nodes(0, 1)
# fast forward into the future & ensure that the second node has the txns
node.mockscheduler(MAX_INITIAL_BROADCAST_DELAY)
@@ -91,7 +89,7 @@ class MempoolUnbroadcastTest(BitcoinTestFramework):
time.sleep(2) # allow sufficient time for possibility of broadcast
assert_equal(len(conn.get_invs()), 0)
- disconnect_nodes(node, 1)
+ self.disconnect_nodes(0, 1)
node.disconnect_p2ps()
def test_txn_removal(self):
diff --git a/test/functional/rpc_psbt.py b/test/functional/rpc_psbt.py
index 10aebc2b1d..1e907cd4ae 100755
--- a/test/functional/rpc_psbt.py
+++ b/test/functional/rpc_psbt.py
@@ -13,7 +13,6 @@ from test_framework.util import (
assert_greater_than,
assert_raises_rpc_error,
connect_nodes,
- disconnect_nodes,
find_output,
)
@@ -46,7 +45,7 @@ class PSBTTest(BitcoinTestFramework):
# Disconnect offline node from others
# Topology of test network is linear, so this one call is enough
- disconnect_nodes(offline_node, 1)
+ self.disconnect_nodes(0, 1)
# Create watchonly on online_node
online_node.createwallet(wallet_name='wonline', disable_private_keys=True)