Remove `dumpwallet` RPC method

The RPC method handler is left in as a tombstone, to redirect callers to
the replacement method (as this is an upstream Bitcoin Core RPC method
that users may expect to be present).
This commit is contained in:
Jack Grigg 2022-12-03 04:07:59 +00:00
parent ca85cfbab3
commit 2651451454
8 changed files with 18 additions and 58 deletions

View File

@ -74,10 +74,3 @@ The following features are disabled by default, and will be removed in release 5
- `zcrawreceive` - The `zcrawreceive` RPC method is disabled.
- `zcrawjoinsplit` - The `zcrawjoinsplit` RPC method is disabled.
- `zcrawkeygen` - The `zcrawkeygen` RPC method is disabled.
### Disabled in 5.0.1
The following features are disabled by default, and will be removed in release 5.3.0.
- `dumpwallet` - The `dumpwallet` RPC method is disabled.

View File

@ -135,9 +135,3 @@ rescan:
```bash
$ zcash-cli help importprivkey
```
### Using `dumpwallet`
This command inherited from Bitcoin is deprecated and should not be used. It
will export private keys in a similar fashion as `z_exportwallet` but only for
transparent addresses.

View File

@ -13,3 +13,10 @@ RPC Changes
case, they would (properly) require that the transaction didnt have any
change, but this could be confusing, as the documentation stated that these
two conditions (using "ANY\_TADDR" and disallowing change) wouldnt coincide.
[Deprecations](https://zcash.github.io/zcash/user/deprecation.html)
--------------
The following previously-deprecated features have been removed:
- `dumpwallet`

View File

@ -38,8 +38,7 @@ Options:
selected from among {"none", "addrtype", "getnewaddress",
"getrawchangeaddress", "legacy_privacy", "wallettxvjoinsplit",
"z_getbalance", "z_getnewaddress", "z_gettotalbalance",
"z_listaddresses", "dumpwallet", "zcrawjoinsplit", "zcrawkeygen",
"zcrawreceive"}
"z_listaddresses", "zcrawjoinsplit", "zcrawkeygen", "zcrawreceive"}
-blocknotify=<cmd>
Execute command when the best block changes (%s in cmd is replaced by

View File

@ -17,7 +17,7 @@ Then 5 iterations of 1/2/3 sending coins amongst
themselves to get transactions in the wallets,
and the miner mining one block.
Wallets are backed up using dumpwallet/backupwallet.
Wallets are backed up using z_exportwallet/backupwallet.
Then 5 more iterations of transactions and mining a block.
Miner then generates 101 more blocks, so any
@ -64,12 +64,7 @@ class WalletBackupTest(BitcoinTestFramework):
ed2 = "-exportdir=" + self.options.tmpdir + "/node2"
# nodes 1, 2,3 are spenders, let's give them a keypool=100
extra_args = [
["-keypool=100", ed0, "-allowdeprecated=dumpwallet"],
["-keypool=100", ed1, "-allowdeprecated=dumpwallet"],
["-keypool=100", ed2, "-allowdeprecated=dumpwallet"],
[]
]
extra_args = [["-keypool=100", ed0], ["-keypool=100", ed1], ["-keypool=100", ed2], []]
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, extra_args)
connect_nodes(self.nodes[0], 3)
connect_nodes(self.nodes[1], 3)
@ -145,15 +140,15 @@ class WalletBackupTest(BitcoinTestFramework):
logging.info("Backing up")
tmpdir = self.options.tmpdir
self.nodes[0].backupwallet("walletbak")
self.nodes[0].dumpwallet("walletdump")
self.nodes[0].z_exportwallet("walletdump")
self.nodes[1].backupwallet("walletbak")
self.nodes[1].dumpwallet("walletdump")
self.nodes[1].z_exportwallet("walletdump")
self.nodes[2].backupwallet("walletbak")
self.nodes[2].dumpwallet("walletdump")
self.nodes[2].z_exportwallet("walletdump")
# Verify dumpwallet cannot overwrite an existing file
# Verify z_exportwallet cannot overwrite an existing file
try:
self.nodes[2].dumpwallet("walletdump")
self.nodes[2].z_exportwallet("walletdump")
assert(False)
except JSONRPCException as e:
errorString = e.error['message']

View File

@ -24,7 +24,6 @@ bool fEnableZCRawReceive = true;
bool fEnableZCRawJoinSplit = true;
bool fEnableZCRawKeygen = true;
bool fEnableAddrTypeField = true;
bool fEnableDumpWallet = true;
bool fEnableWalletTxVJoinSplit = true;
#endif
@ -107,7 +106,6 @@ std::optional<std::string> SetAllowedDeprecatedFeaturesFromCLIArgs() {
fEnableZCRawJoinSplit = allowdeprecated.count("zcrawjoinsplit") > 0;
fEnableZCRawKeygen = allowdeprecated.count("zcrawkeygen") > 0;
fEnableAddrTypeField = allowdeprecated.count("addrtype") > 0;
fEnableDumpWallet = allowdeprecated.count("dumpwallet") > 0;
fEnableWalletTxVJoinSplit = allowdeprecated.count("wallettxvjoinsplit") > 0;
#endif

View File

@ -39,7 +39,6 @@ static const std::set<std::string> DEFAULT_ALLOW_DEPRECATED{{
}};
static const std::set<std::string> DEFAULT_DENY_DEPRECATED{{
#ifdef ENABLE_WALLET
"dumpwallet",
"zcrawreceive",
"zcrawjoinsplit",
"zcrawkeygen"
@ -59,7 +58,6 @@ extern bool fEnableZCRawReceive;
extern bool fEnableZCRawJoinSplit;
extern bool fEnableZCRawKeygen;
extern bool fEnableAddrTypeField;
extern bool fEnableDumpWallet;
extern bool fEnableWalletTxVJoinSplit;
#endif

View File

@ -348,12 +348,12 @@ UniValue importwallet(const UniValue& params, bool fHelp)
if (fHelp || params.size() != 1)
throw runtime_error(
"importwallet \"filename\"\n"
"\nImports taddr keys from a wallet dump file (see dumpwallet).\n"
"\nImports taddr keys from a wallet dump file (see z_exportwallet).\n"
"\nArguments:\n"
"1. \"filename\" (string, required) The wallet file\n"
"\nExamples:\n"
"\nDump the wallet\n"
+ HelpExampleCli("dumpwallet", "\"nameofbackup\"") +
+ HelpExampleCli("z_exportwallet", "\"nameofbackup\"") +
"\nImport the wallet\n"
+ HelpExampleCli("importwallet", "\"path/to/exportdir/nameofbackup\"") +
"\nImport using the json rpc call\n"
@ -546,31 +546,7 @@ UniValue z_exportwallet(const UniValue& params, bool fHelp)
UniValue dumpwallet(const UniValue& params, bool fHelp)
{
if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue;
if (!fEnableDumpWallet)
throw runtime_error(
"dumpwallet is DEPRECATED and will be removed in a future release\n"
"\nUse z_exportwallet instead, or restart with `-allowdeprecated=dumpwallet`\n"
"if you require backward compatibility.\n"
"See https://zcash.github.io/zcash/user/deprecation.html for more information.");
if (fHelp || params.size() != 1)
throw runtime_error(
"dumpwallet \"filename\"\n"
"\nDEPRECATED. Please use the z_exportwallet RPC instead.\n"
"\nDumps taddr wallet keys in a human-readable format. Overwriting an existing file is not permitted.\n"
"\nArguments:\n"
"1. \"filename\" (string, required) The filename, saved in folder set by zcashd -exportdir option\n"
"\nResult:\n"
"\"path\" (string) The full path of the destination file\n"
"\nExamples:\n"
+ HelpExampleCli("dumpwallet", "\"test\"")
+ HelpExampleRpc("dumpwallet", "\"test\"")
);
return dumpwallet_impl(params, false);
throw JSONRPCError(RPC_METHOD_NOT_FOUND, "dumpwallet has been removed. Use z_exportwallet instead.");
}
UniValue dumpwallet_impl(const UniValue& params, bool fDumpZKeys)