mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-05 05:02:06 +02:00
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.
This commit is contained in:
@ -918,7 +918,7 @@ class TestNodeCLI():
|
||||
def send_cli(self, clicommand=None, *args, **kwargs):
|
||||
"""Run bitcoin-cli command. Deserializes returned string as python object."""
|
||||
pos_args = [arg_to_cli(arg) for arg in args]
|
||||
named_args = [str(key) + "=" + arg_to_cli(value) for (key, value) in kwargs.items()]
|
||||
named_args = [key + "=" + arg_to_cli(value) for (key, value) in kwargs.items() if value is not None]
|
||||
p_args = self.binaries.rpc_argv() + [f"-datadir={self.datadir}"] + self.options
|
||||
if named_args:
|
||||
p_args += ["-named"]
|
||||
|
@ -78,7 +78,6 @@ class AddressTypeTest(BitcoinTestFramework):
|
||||
]
|
||||
# whitelist peers to speed up tx relay / mempool sync
|
||||
self.noban_tx_relay = True
|
||||
self.supports_cli = False
|
||||
|
||||
def skip_test_if_missing_module(self):
|
||||
self.skip_if_no_wallet()
|
||||
|
Reference in New Issue
Block a user