Remove zcrawreceive, zcrawjoinsplit, zcrawkeygen from default-allowed deprecated methods.

This commit is contained in:
Kris Nuttycombe 2022-04-21 16:47:56 -06:00
parent d6d3be9bf2
commit 4ea9de5ff6
5 changed files with 23 additions and 7 deletions

View File

@ -41,6 +41,13 @@ Option handling
is returned in addition to `pool` or `address_type` (which contain the
same information) in the results of RPC methods that return address metadata.
RPC Changes
-----------
- The deprecated `zcrawkeygen`, `zcrawreceive`, and `zcrawjoinsplit` RPC
methods are now disabled by default. Start with `-allowdeprecated=all`
or select individual features if you wish to continue using these APIs.
Build system
------------

View File

@ -31,8 +31,13 @@ class WalletDeprecationTest(BitcoinTestFramework):
# z_getnewaddress is deprecated, but enabled by default so it should succeed
self.nodes[0].z_getnewaddress()
# zcrawkeygen is enabled by default so should succeed.
self.nodes[0].zcrawkeygen()
# zcrawkeygen is deprecated, and not enabled by default so it should fail
errorString = ''
try:
self.nodes[0].zcrawkeygen()
except JSONRPCException as e:
errorString = e.error['message']
assert "DEPRECATED" in errorString
# restart with a specific selection of deprecated methods enabled
stop_nodes(self.nodes)

View File

@ -17,7 +17,7 @@ class JoinSplitTest(BitcoinTestFramework):
def setup_network(self):
self.nodes = []
self.is_network_split = False
self.nodes.append(start_node(0, self.options.tmpdir))
self.nodes.append(start_node(0, self.options.tmpdir, ["-allowdeprecated=all"]))
def run_test(self):
zckeypair = self.nodes[0].zcrawkeygen()

View File

@ -7,7 +7,7 @@
from test_framework.test_framework import BitcoinTestFramework
from test_framework.authproxy import JSONRPCException
from test_framework.util import assert_equal, connect_nodes, \
gather_inputs, sync_blocks
gather_inputs, start_nodes, sync_blocks
import time
@ -16,6 +16,10 @@ class JoinSplitTest(BitcoinTestFramework):
# Start with split network:
return super(JoinSplitTest, self).setup_network(True)
def setup_nodes(self):
return start_nodes(self.num_nodes, self.options.tmpdir,
extra_args = [["-allowdeprecated=all"]] * self.num_nodes)
def txid_in_mempool(self, node, txid):
exception_triggered = False

View File

@ -26,14 +26,14 @@ static const std::set<std::string> DEFAULT_ALLOW_DEPRECATED{{
"legacy_privacy",
"getnewaddress",
"z_getnewaddress",
"zcrawreceive",
"zcrawjoinsplit",
"zcrawkeygen",
"addrtype"
#endif
}};
static const std::set<std::string> DEFAULT_DENY_DEPRECATED{{
#ifdef ENABLE_WALLET
"zcrawreceive",
"zcrawjoinsplit",
"zcrawkeygen",
#endif
}};