Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/test_node.py
Show First 20 Lines • Show All 446 Lines • ▼ Show 20 Lines | def batch(self, requests): | ||||
results.append(dict(result=request())) | results.append(dict(result=request())) | ||||
except JSONRPCException as e: | except JSONRPCException as e: | ||||
results.append(dict(error=e)) | results.append(dict(error=e)) | ||||
return results | return results | ||||
def send_cli(self, command=None, *args, **kwargs): | def send_cli(self, command=None, *args, **kwargs): | ||||
"""Run bitcoin-cli command. Deserializes returned string as python object.""" | """Run bitcoin-cli command. Deserializes returned string as python object.""" | ||||
pos_args = [str(arg) for arg in args] | pos_args = [str(arg).lower() if type( | ||||
arg) is bool else str(arg) for arg in args] | |||||
named_args = [str(key) + "=" + str(value) | named_args = [str(key) + "=" + str(value) | ||||
for (key, value) in kwargs.items()] | for (key, value) in kwargs.items()] | ||||
assert not ( | assert not ( | ||||
pos_args and named_args), "Cannot use positional arguments and named arguments in the same bitcoin-cli call" | pos_args and named_args), "Cannot use positional arguments and named arguments in the same bitcoin-cli call" | ||||
p_args = [self.binary, "-datadir=" + self.datadir] + self.options | p_args = [self.binary, "-datadir=" + self.datadir] + self.options | ||||
if named_args: | if named_args: | ||||
p_args += ["-named"] | p_args += ["-named"] | ||||
Show All 21 Lines |