mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Fix misleading "Method not found" multiwallet errors
Raise RPC_WALLET_NOT_SPECIFIED instead of RPC_METHOD_NOT_FOUND when a required wallet filename was not specified in an RPC call. Also raise more specific RPC_WALLET_NOT_FOUND error instead of RPC_INVALID_PARAMETER in case an invalid wallet was specified, for consistency.
This commit is contained in:
@@ -21,8 +21,11 @@ class MultiWalletTest(BitcoinTestFramework):
|
||||
w1 = self.nodes[0] / "wallet/w1"
|
||||
w1.generate(1)
|
||||
|
||||
# accessing invalid wallet fails
|
||||
assert_raises_jsonrpc(-18, "Requested wallet does not exist or is not loaded", (self.nodes[0] / "wallet/bad").getwalletinfo)
|
||||
|
||||
# accessing wallet RPC without using wallet endpoint fails
|
||||
assert_raises_jsonrpc(-32601, "Method not found", self.nodes[0].getwalletinfo)
|
||||
assert_raises_jsonrpc(-19, "Wallet file not specified", self.nodes[0].getwalletinfo)
|
||||
|
||||
# check w1 wallet balance
|
||||
w1_info = w1.getwalletinfo()
|
||||
|
||||
Reference in New Issue
Block a user