mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 06:49:38 -04:00
test: Remove unused RPCOverloadWrapper is_cli field
This commit is contained in:
parent
d62c2d82e1
commit
cccc1f4e91
1 changed files with 4 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2017-2022 The Bitcoin Core developers
|
# Copyright (c) 2017-present The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Class for bitcoind node under test"""
|
"""Class for bitcoind node under test"""
|
||||||
|
@ -209,7 +209,7 @@ class TestNode():
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name):
|
||||||
"""Dispatches any unrecognised messages to the RPC connection or a CLI instance."""
|
"""Dispatches any unrecognised messages to the RPC connection or a CLI instance."""
|
||||||
if self.use_cli:
|
if self.use_cli:
|
||||||
return getattr(RPCOverloadWrapper(self.cli, True), name)
|
return getattr(RPCOverloadWrapper(self.cli), name)
|
||||||
else:
|
else:
|
||||||
assert self.rpc_connected and self.rpc is not None, self._node_msg("Error: no RPC connection")
|
assert self.rpc_connected and self.rpc is not None, self._node_msg("Error: no RPC connection")
|
||||||
return getattr(RPCOverloadWrapper(self.rpc), name)
|
return getattr(RPCOverloadWrapper(self.rpc), name)
|
||||||
|
@ -374,7 +374,7 @@ class TestNode():
|
||||||
|
|
||||||
def get_wallet_rpc(self, wallet_name):
|
def get_wallet_rpc(self, wallet_name):
|
||||||
if self.use_cli:
|
if self.use_cli:
|
||||||
return RPCOverloadWrapper(self.cli("-rpcwallet={}".format(wallet_name)), True)
|
return RPCOverloadWrapper(self.cli("-rpcwallet={}".format(wallet_name)))
|
||||||
else:
|
else:
|
||||||
assert self.rpc_connected and self.rpc, self._node_msg("RPC not connected")
|
assert self.rpc_connected and self.rpc, self._node_msg("RPC not connected")
|
||||||
wallet_path = "wallet/{}".format(urllib.parse.quote(wallet_name))
|
wallet_path = "wallet/{}".format(urllib.parse.quote(wallet_name))
|
||||||
|
@ -925,9 +925,8 @@ class TestNodeCLI():
|
||||||
return cli_stdout.rstrip("\n")
|
return cli_stdout.rstrip("\n")
|
||||||
|
|
||||||
class RPCOverloadWrapper():
|
class RPCOverloadWrapper():
|
||||||
def __init__(self, rpc, cli=False):
|
def __init__(self, rpc):
|
||||||
self.rpc = rpc
|
self.rpc = rpc
|
||||||
self.is_cli = cli
|
|
||||||
|
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name):
|
||||||
return getattr(self.rpc, name)
|
return getattr(self.rpc, name)
|
||||||
|
|
Loading…
Add table
Reference in a new issue