Merge pull request #5947 from nuttycom/deprecation/gettransaction_vjoinsplit

Deprecate vjoinsplit attribute of gettransaction result.
This commit is contained in:
Kris Nuttycombe 2022-07-01 12:03:27 -06:00 committed by GitHub
commit 2e6a251de7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 4 deletions

View File

@ -55,6 +55,11 @@ default as of release 5.3.0.
using this metadata be updated to use the `pool` or `address_type`
attributes, which have replaced the `type` attribute, as appropriate.
### Deprecated in 5.1.0
- `wallettxvjoinsplit` - The `vjoinsplit` attribute returned by the
`gettransaction` RPC method is deprecated.
Stage 2
-------

View File

@ -25,3 +25,12 @@ by default, but may be be reenabled using `-allowdeprecated=<feature>`.
`allowdeprecated=dumpwallet`. `dumpwallet` should not be used; it is
unsafe for backup purposes as it does not return any key information
for keys used to derive shielded addresses. Use `z_exportwallet` instead.
As of this release, the following features are deprecated, but remain available
by default. These features may be disabled by setting `-allowdeprecated=none`.
After at least 3 minor-version releases, these features will be disabled by
default and the following flags to `-allowdeprecated` will be required to
permit their continued use:
- `wallettxvjoinsplit` - controls availability of the deprecated `vjoinsplit`
attribute returned by the `gettransaction` RPC method.

View File

@ -25,6 +25,7 @@ bool fEnableZCRawJoinSplit = true;
bool fEnableZCRawKeygen = true;
bool fEnableAddrTypeField = true;
bool fEnableDumpWallet = true;
bool fEnableWalletTxVJoinSplit = true;
#endif
static const std::string CLIENT_VERSION_STR = FormatVersion(CLIENT_VERSION);
@ -107,6 +108,7 @@ std::optional<std::string> SetAllowedDeprecatedFeaturesFromCLIArgs() {
fEnableZCRawKeygen = allowdeprecated.count("zcrawkeygen") > 0;
fEnableAddrTypeField = allowdeprecated.count("addrtype") > 0;
fEnableDumpWallet = allowdeprecated.count("dumpwallet") > 0;
fEnableWalletTxVJoinSplit = allowdeprecated.count("wallettxvjoinsplit") > 0;
#endif
return std::nullopt;

View File

@ -33,7 +33,8 @@ static const std::set<std::string> DEFAULT_ALLOW_DEPRECATED{{
"z_getbalance",
"z_gettotalbalance",
"z_listaddresses",
"addrtype"
"addrtype",
"wallettxvjoinsplit"
#endif
}};
static const std::set<std::string> DEFAULT_DENY_DEPRECATED{{
@ -59,6 +60,7 @@ extern bool fEnableZCRawJoinSplit;
extern bool fEnableZCRawKeygen;
extern bool fEnableAddrTypeField;
extern bool fEnableDumpWallet;
extern bool fEnableWalletTxVJoinSplit;
#endif
/**

View File

@ -151,7 +151,9 @@ void WalletTxToJSON(const CWalletTx& wtx, UniValue& entry)
for (const std::pair<string, string>& item : wtx.mapValue)
entry.pushKV(item.first, item.second);
entry.pushKV("vjoinsplit", TxJoinSplitToJSON(wtx));
if (fEnableWalletTxVJoinSplit) {
entry.pushKV("vjoinsplit", TxJoinSplitToJSON(wtx));
}
}
UniValue getnewaddress(const UniValue& params, bool fHelp)
@ -1701,7 +1703,9 @@ UniValue gettransaction(const UniValue& params, bool fHelp)
if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error(
"gettransaction \"txid\" ( includeWatchonly )\n"
"\nReturns detailed information about in-wallet transaction <txid>.\n"
"\nReturns detailed information about in-wallet transaction <txid>. This does not\n"
"include complete information about shielded components of the transaction; to obtain\n"
"details about shielded components of the transaction use `z_viewtransaction`.\n"
"\nArguments:\n"
"1. \"txid\" (string, required) The transaction id\n"
"2. \"includeWatchonly\" (bool, optional, default=false) Whether to include watchonly addresses in balance calculation and details[]\n"
@ -1727,7 +1731,7 @@ UniValue gettransaction(const UniValue& params, bool fHelp)
" }\n"
" ,...\n"
" ],\n"
" \"vjoinsplit\" : [\n"
" \"vjoinsplit\" : (DEPRECATED) [\n"
" {\n"
" \"anchor\" : \"treestateref\", (string) Merkle root of note commitment tree\n"
" \"nullifiers\" : [ string, ... ] (string) Nullifiers of input notes\n"