aboutsummaryrefslogtreecommitdiff
path: root/test/functional/rpc_psbt.py
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-10-21 14:43:06 +0200
committerMarcoFalke <falke.marco@gmail.com>2020-10-21 14:43:12 +0200
commit47fc883106fb939db0212751c2edb3d5f7430689 (patch)
treecc3d9e6b519de0aa37bf1d70cff34b3e14d5bcd3 /test/functional/rpc_psbt.py
parent0f86e7f1285c6de697d144a0e68bbd67f4900e19 (diff)
parent3c7d9ab8c8ec5284cdad1a53ee310b79b931f12f (diff)
downloadbitcoin-47fc883106fb939db0212751c2edb3d5f7430689.tar.xz
Merge #19967: test: Replace (dis)?connect_nodes globals with TestFramework methods
3c7d9ab8c8ec5284cdad1a53ee310b79b931f12f test: Move (dis)?connect_nodes globals into TestFramework as helpers (Elliott Jin) 4b16c614616c1ff09e5b1dcd58516bcb9a88e5e8 scripted-diff: test: Replace uses of (dis)?connect_nodes global (Prayank) be386840d4a394a1b6221fb7d0fa2b0bc4b1d413 test: Replace use of (dis)?connect_nodes globals (Elliott Jin) Pull request description: `util.py` defines global helper functions `connect_nodes` and `disconnect_nodes`; however, these functions are confusing because they take a node and an index (instead of two indexes). The `TestFramework` object has enough context to convert from `i` to `self.nodes[i]`, so we can replace all instances of `connect_nodes(self.nodes[a], b)` with `self.connect_nodes(a, b)`. Similarly, we can replace instances of `disconnect_nodes`. The approach taken in this PR builds on #19945 but uses a scripted-diff for the majority of the changes. Fixes: #19821 ACKs for top commit: MarcoFalke: ACK 3c7d9ab8c8ec5284cdad1a53ee310b79b931f12f guggero: ACK 3c7d9ab8 Tree-SHA512: e027092748602904abcd986d7299624c8754c3236314b6d8e392e306741c212f266c2207e385adfb194f67ae6559a585ee7b15d639b1d65c4651dbf503e5931a
Diffstat (limited to 'test/functional/rpc_psbt.py')
-rwxr-xr-xtest/functional/rpc_psbt.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/test/functional/rpc_psbt.py b/test/functional/rpc_psbt.py
index 10aebc2b1d..32dc2f8644 100755
--- a/test/functional/rpc_psbt.py
+++ b/test/functional/rpc_psbt.py
@@ -12,8 +12,6 @@ from test_framework.util import (
assert_equal,
assert_greater_than,
assert_raises_rpc_error,
- connect_nodes,
- disconnect_nodes,
find_output,
)
@@ -46,7 +44,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)
@@ -80,8 +78,8 @@ class PSBTTest(BitcoinTestFramework):
wonline.unloadwallet()
# Reconnect
- connect_nodes(self.nodes[0], 1)
- connect_nodes(self.nodes[0], 2)
+ self.connect_nodes(0, 1)
+ self.connect_nodes(0, 2)
def assert_change_type(self, psbtx, expected_type):
"""Assert that the given PSBT has a change output with the given type."""