Skip to content

Commit 54d2872

Browse files
committed
test: Don't send empty named args with cli
If python passed None for an optional (i.e. 'null' is sent), this will lead to the arg being interpreted as not provided by bitcoind - except for string args, for which the arg is interpreted as as 'null' string. Bypass this by not sending named args to bitcoin-cli - so that the default value will actually be used. Also drops an unnecessary str() conversion, kwargs keys are always strings.
1 parent cca4220 commit 54d2872

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

test/functional/test_framework/test_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ def batch(self, requests):
918918
def send_cli(self, clicommand=None, *args, **kwargs):
919919
"""Run bitcoin-cli command. Deserializes returned string as python object."""
920920
pos_args = [arg_to_cli(arg) for arg in args]
921-
named_args = [str(key) + "=" + arg_to_cli(value) for (key, value) in kwargs.items()]
921+
named_args = [key + "=" + arg_to_cli(value) for (key, value) in kwargs.items() if value is not None]
922922
p_args = self.binaries.rpc_argv() + [f"-datadir={self.datadir}"] + self.options
923923
if named_args:
924924
p_args += ["-named"]

test/functional/wallet_address_types.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ def set_test_params(self):
7878
]
7979
# whitelist peers to speed up tx relay / mempool sync
8080
self.noban_tx_relay = True
81-
self.supports_cli = False
8281

8382
def skip_test_if_missing_module(self):
8483
self.skip_if_no_wallet()

0 commit comments

Comments
 (0)