aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2017-07-17 05:42:30 -0400
committerRussell Yanofsky <russ@yanofsky.org>2017-07-26 02:48:15 -0400
commite526b3d34c20cd723b08252638d10a7584b697cb (patch)
tree21f1193f8cc46dd043cf4acfac0797feac5de192 /test
parent04d395e8327d512ae31d8e024d95e2d1e1729954 (diff)
downloadbitcoin-e526b3d34c20cd723b08252638d10a7584b697cb.tar.xz
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.
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/multiwallet.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/functional/multiwallet.py b/test/functional/multiwallet.py
index f0929a8e28..173f06cf5d 100755
--- a/test/functional/multiwallet.py
+++ b/test/functional/multiwallet.py
@@ -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()