aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework/wallet_util.py
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2019-10-28 11:11:20 +0100
committerJon Atack <jon@atack.com>2019-11-24 23:08:38 +0100
commit33f5fc32e5bfbe1e89c4d20ce455bcc6dc194151 (patch)
tree541a9905f6291d56b1227e21827ebaaa100ca15a /test/functional/test_framework/wallet_util.py
parent0f3539ac6d772fc646b5f184fa1efe77bf632f6a (diff)
downloadbitcoin-33f5fc32e5bfbe1e89c4d20ce455bcc6dc194151.tar.xz
test: add rpc getaddressinfo labels test coverage
Diffstat (limited to 'test/functional/test_framework/wallet_util.py')
-rwxr-xr-xtest/functional/test_framework/wallet_util.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/functional/test_framework/wallet_util.py b/test/functional/test_framework/wallet_util.py
index c0dfa4c3f0..3d81a61120 100755
--- a/test/functional/test_framework/wallet_util.py
+++ b/test/functional/test_framework/wallet_util.py
@@ -88,6 +88,11 @@ def get_multisig(node):
p2sh_p2wsh_script=CScript([OP_HASH160, witness_script, OP_EQUAL]).hex(),
p2sh_p2wsh_addr=script_to_p2sh_p2wsh(script_code))
+def labels_value(name="", purpose="receive"):
+ """Generate a getaddressinfo labels array from a name and purpose.
+ Often used as the value of a labels kwarg for calling test_address below."""
+ return [{"name": name, "purpose": purpose}]
+
def test_address(node, address, **kwargs):
"""Get address info for `address` and test whether the returned values are as expected."""
addr_info = node.getaddressinfo(address)