Currently, unloadwallet
RPC call fails with a JSON parsing error when no wallet_name
argument is provided. This behavior is misleading because the error originates from a low-level JSON type mismatch, rather than clearly indicating that the wallet name or RPC endpoint (-rpcwallet=...
) is missing. Also, found out that the issue was noticed during its implementation but never addressed.
In addition, I’ve verified all RPC commands calls finding that getdescriptoractivity
had the same problem, but related to the array input types (blockhashes & descriptors), so I’ve corrected that RPC as well. For consistency I’ve added the missing logging info for each test case in test/functional/rpc_getdescriptoractivity.py
in preparation for the new test.
-Before
0./build/bin/bitcoin-cli -regtest -datadir=/tmp/btc unloadwallet
1error code: -3
2error message:
3JSON value of type number is not of expected type string
0./build/bin/bitcoin-cli -regtest -datadir=/tmp/btc getdescriptoractivity
1error code: -3
2error message:
3JSON value of type null is not of expected type array
0./build/bin/bitcoin-cli -regtest -datadir=/tmp/btc getdescriptoractivity '[]'
1error code: -3
2error message:
3JSON value of type null is not of expected type array
-After
0./build/bin/bitcoin-cli -regtest -datadir=/tmp/btc unloadwallet
1error code: -8
2error message:
3Either RPC endpoint wallet or wallet_name parameter must be provided
0./build/bin/bitcoin-cli -regtest -datadir=/tmp/btc getdescriptoractivity
1error code: -8
2error message:
3At least 1 blockhash or 1 descriptor must be specified.
0./build/bin/bitcoin-cli -regtest -datadir=/tmp/btc getdescriptoractivity '[]'
1error code: -8
2error message:
3At least 1 blockhash or 1 descriptor must be specified.