From cbf1a85013ced069c2cbfd962d2e9bdc7ad4ebea Mon Sep 17 00:00:00 2001 From: Alfredo Garcia Date: Sat, 26 Oct 2019 12:52:36 -0300 Subject: [PATCH 1/2] remove z_mergetoaddress from experimental --- src/init.cpp | 2 -- src/test/rpc_wallet_tests.cpp | 11 ----------- src/wallet/rpcwallet.cpp | 12 ------------ 3 files changed, 25 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index aeb8c5a6c..104b4f844 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -845,8 +845,6 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) return InitError(_("Setting the size of shielded pools to zero requires -experimentalfeatures.")); } else if (mapArgs.count("-paymentdisclosure")) { return InitError(_("Payment disclosure requires -experimentalfeatures.")); - } else if (mapArgs.count("-zmergetoaddress")) { - return InitError(_("RPC method z_mergetoaddress requires -experimentalfeatures.")); } else if (mapArgs.count("-insightexplorer")) { return InitError(_("Insight explorer requires -experimentalfeatures.")); } diff --git a/src/test/rpc_wallet_tests.cpp b/src/test/rpc_wallet_tests.cpp index abae7ce78..ce41d839c 100644 --- a/src/test/rpc_wallet_tests.cpp +++ b/src/test/rpc_wallet_tests.cpp @@ -1663,13 +1663,6 @@ BOOST_AUTO_TEST_CASE(rpc_z_mergetoaddress_parameters) LOCK(pwalletMain->cs_wallet); - CheckRPCThrows("z_mergetoaddress 1 2", - "Error: z_mergetoaddress is disabled. Run './zcash-cli help z_mergetoaddress' for instructions on how to enable this feature."); - - // Set global state required for z_mergetoaddress - fExperimentalMode = true; - mapArgs["-zmergetoaddress"] = "1"; - BOOST_CHECK_THROW(CallRPC("z_mergetoaddress"), runtime_error); BOOST_CHECK_THROW(CallRPC("z_mergetoaddress toofewargs"), runtime_error); BOOST_CHECK_THROW(CallRPC("z_mergetoaddress just too many args present for this method"), runtime_error); @@ -1807,10 +1800,6 @@ BOOST_AUTO_TEST_CASE(rpc_z_mergetoaddress_parameters) } catch (const UniValue& objError) { BOOST_CHECK( find_error(objError, "Invalid recipient address")); } - - // Un-set global state - fExperimentalMode = false; - mapArgs.erase("-zmergetoaddress"); } diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 3852b8e02..0b7e6364f 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -4266,17 +4266,9 @@ UniValue z_mergetoaddress(const UniValue& params, bool fHelp) if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - string enableArg = "zmergetoaddress"; - auto fEnableMergeToAddress = fExperimentalMode && GetBoolArg("-" + enableArg, false); - std::string strDisabledMsg = ""; - if (!fEnableMergeToAddress) { - strDisabledMsg = experimentalDisabledHelpMsg("z_mergetoaddress", enableArg); - } - if (fHelp || params.size() < 2 || params.size() > 6) throw runtime_error( "z_mergetoaddress [\"fromaddress\", ... ] \"toaddress\" ( fee ) ( transparent_limit ) ( shielded_limit ) ( memo )\n" - + strDisabledMsg + "\nMerge multiple UTXOs and notes into a single UTXO or note. Coinbase UTXOs are ignored; use `z_shieldcoinbase`" "\nto combine those into a single note." "\n\nThis is an asynchronous operation, and UTXOs selected for merging will be locked. If there is an error, they" @@ -4327,10 +4319,6 @@ UniValue z_mergetoaddress(const UniValue& params, bool fHelp) + HelpExampleRpc("z_mergetoaddress", "[\"ANY_SAPLING\", \"t1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\"], \"ztestsapling19rnyu293v44f0kvtmszhx35lpdug574twc0lwyf4s7w0umtkrdq5nfcauxrxcyfmh3m7slemqsj\"") ); - if (!fEnableMergeToAddress) { - throw JSONRPCError(RPC_WALLET_ERROR, "Error: z_mergetoaddress is disabled. Run './zcash-cli help z_mergetoaddress' for instructions on how to enable this feature."); - } - LOCK2(cs_main, pwalletMain->cs_wallet); bool useAnyUTXO = false; From 01998bdc9e3294966f3ca04c0d8d47893045c5d3 Mon Sep 17 00:00:00 2001 From: Alfredo Garcia Date: Wed, 6 Nov 2019 10:57:10 -0300 Subject: [PATCH 2/2] remove zmergetoaddress from experimental state in rpc-tests --- qa/rpc-tests/mergetoaddress_helper.py | 4 ++-- qa/rpc-tests/mergetoaddress_mixednotes.py | 4 +--- qa/rpc-tests/wallet_changeaddresses.py | 3 +-- qa/rpc-tests/wallet_sapling.py | 4 +--- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/qa/rpc-tests/mergetoaddress_helper.py b/qa/rpc-tests/mergetoaddress_helper.py index 653a2882f..e76d6a562 100755 --- a/qa/rpc-tests/mergetoaddress_helper.py +++ b/qa/rpc-tests/mergetoaddress_helper.py @@ -41,12 +41,12 @@ class MergeToAddressHelper: initialize_chain_clean(test.options.tmpdir, 4) def setup_network(self, test, additional_args=[]): - args = ['-debug=zrpcunsafe', '-experimentalfeatures', '-zmergetoaddress'] + args = ['-debug=zrpcunsafe'] args += additional_args test.nodes = [] test.nodes.append(start_node(0, test.options.tmpdir, args)) test.nodes.append(start_node(1, test.options.tmpdir, args)) - args2 = ['-debug=zrpcunsafe', '-experimentalfeatures', '-zmergetoaddress', '-mempooltxinputlimit=7'] + args2 = ['-debug=zrpcunsafe', '-mempooltxinputlimit=7'] args2 += additional_args test.nodes.append(start_node(2, test.options.tmpdir, args2)) connect_nodes_bi(test.nodes, 0, 1) diff --git a/qa/rpc-tests/mergetoaddress_mixednotes.py b/qa/rpc-tests/mergetoaddress_mixednotes.py index be78d1444..7c2cc4e40 100755 --- a/qa/rpc-tests/mergetoaddress_mixednotes.py +++ b/qa/rpc-tests/mergetoaddress_mixednotes.py @@ -14,9 +14,7 @@ from mergetoaddress_helper import assert_mergetoaddress_exception class MergeToAddressMixedNotes(BitcoinTestFramework): def setup_nodes(self): - return start_nodes(4, self.options.tmpdir, [[ - '-experimentalfeatures', '-zmergetoaddress' - ]] * 4) + return start_nodes(4, self.options.tmpdir) def setup_chain(self): print("Initializing test directory " + self.options.tmpdir) diff --git a/qa/rpc-tests/wallet_changeaddresses.py b/qa/rpc-tests/wallet_changeaddresses.py index ceb8b0094..379a2a3bd 100755 --- a/qa/rpc-tests/wallet_changeaddresses.py +++ b/qa/rpc-tests/wallet_changeaddresses.py @@ -27,8 +27,7 @@ class WalletChangeAddressesTest(BitcoinTestFramework): args = [ '-nuparams=5ba81b19:1', # Overwinter '-nuparams=76b809bb:1', # Sapling - '-txindex', # Avoid JSONRPC error: No information available about transaction - '-experimentalfeatures', '-zmergetoaddress', + '-txindex' # Avoid JSONRPC error: No information available about transaction ] self.nodes = [] self.nodes.append(start_node(0, self.options.tmpdir, args)) diff --git a/qa/rpc-tests/wallet_sapling.py b/qa/rpc-tests/wallet_sapling.py index ca42893dd..b9bfa1f57 100755 --- a/qa/rpc-tests/wallet_sapling.py +++ b/qa/rpc-tests/wallet_sapling.py @@ -20,9 +20,7 @@ from decimal import Decimal class WalletSaplingTest(BitcoinTestFramework): def setup_nodes(self): - return start_nodes(4, self.options.tmpdir, [[ - '-experimentalfeatures', '-zmergetoaddress', - ]] * 4) + return start_nodes(4, self.options.tmpdir) def run_test(self): # Sanity-check the test harness