From 7e936187ac94379583540b1fa370ee8adc559027 Mon Sep 17 00:00:00 2001 From: "Nikolaos D. Bougalis" Date: Thu, 25 Jan 2018 23:34:58 -0800 Subject: [PATCH] Remove deprecated wallet_seed RPC endpoint --- Builds/VisualStudio2015/RippleD.vcxproj | 4 -- .../VisualStudio2015/RippleD.vcxproj.filters | 3 -- src/ripple/net/impl/RPCCall.cpp | 12 ----- src/ripple/protocol/JsonFields.h | 9 ++-- src/ripple/rpc/handlers/Handlers.h | 6 --- src/ripple/rpc/handlers/WalletSeed.cpp | 54 ------------------- src/ripple/rpc/impl/Handler.cpp | 1 - src/ripple/unity/rpcx2.cpp | 1 - 8 files changed, 4 insertions(+), 86 deletions(-) delete mode 100644 src/ripple/rpc/handlers/WalletSeed.cpp diff --git a/Builds/VisualStudio2015/RippleD.vcxproj b/Builds/VisualStudio2015/RippleD.vcxproj index 085e8c31d6..f682212b20 100644 --- a/Builds/VisualStudio2015/RippleD.vcxproj +++ b/Builds/VisualStudio2015/RippleD.vcxproj @@ -2834,10 +2834,6 @@ - - True - True - True True diff --git a/Builds/VisualStudio2015/RippleD.vcxproj.filters b/Builds/VisualStudio2015/RippleD.vcxproj.filters index 1ef8b433b9..7e954e279b 100644 --- a/Builds/VisualStudio2015/RippleD.vcxproj.filters +++ b/Builds/VisualStudio2015/RippleD.vcxproj.filters @@ -3297,9 +3297,6 @@ ripple\rpc\handlers - - ripple\rpc\handlers - ripple\rpc\impl diff --git a/src/ripple/net/impl/RPCCall.cpp b/src/ripple/net/impl/RPCCall.cpp index 741240db82..041921dc38 100644 --- a/src/ripple/net/impl/RPCCall.cpp +++ b/src/ripple/net/impl/RPCCall.cpp @@ -1000,17 +1000,6 @@ private: return jvRequest; } - // wallet_seed [||] - Json::Value parseWalletSeed (Json::Value const& jvParams) - { - Json::Value jvRequest{Json::objectValue}; - - if (jvParams.size ()) - jvRequest[jss::secret] = jvParams[0u].asString (); - - return jvRequest; - } - // parse gateway balances // gateway_balances [] [ [ ]] @@ -1138,7 +1127,6 @@ public: { "validation_seed", &RPCParser::parseValidationSeed, 0, 1 }, { "version", &RPCParser::parseAsIs, 0, 0 }, { "wallet_propose", &RPCParser::parseWalletPropose, 0, 1 }, - { "wallet_seed", &RPCParser::parseWalletSeed, 0, 1 }, { "internal", &RPCParser::parseInternal, 1, -1 }, // Evented methods diff --git a/src/ripple/protocol/JsonFields.h b/src/ripple/protocol/JsonFields.h index 58e5e3690a..950298eb85 100644 --- a/src/ripple/protocol/JsonFields.h +++ b/src/ripple/protocol/JsonFields.h @@ -71,7 +71,6 @@ JSS ( account_objects ); // out: AccountObjects JSS ( account_root ); // in: LedgerEntry JSS ( accounts ); // in: LedgerEntry, Subscribe, // handlers/Ledger, Unsubscribe - // out: WalletAccounts JSS ( accounts_proposed ); // in: Subscribe, Unsubscribe JSS ( action ); JSS ( acquiring ); // out: LedgerRequest @@ -139,7 +138,7 @@ JSS ( dbKBTotal ); // out: getCounts JSS ( dbKBTransaction ); // out: getCounts JSS ( debug_signing ); // in: TransactionSign JSS ( delivered_amount ); // out: addPaymentDeliveredAmount -JSS ( deprecated ); // out: WalletSeed +JSS ( deprecated ); // out JSS ( descending ); // in: AccountTx* JSS ( destination_account ); // in: PathRequest, RipplePathFind, account_lines // out: AccountChannels @@ -217,7 +216,7 @@ JSS ( issuer ); // in: RipplePathFind, Subscribe, // out: paths/Node, STPathSet, STAmount JSS ( jsonrpc ); // json version JSS ( jq_trans_overflow ); // JobQueue transaction limit overflow. -JSS ( key ); // out: WalletSeed +JSS ( key ); // out JSS ( key_type ); // in/out: WalletPropose, TransactionSign JSS ( latency ); // out: PeerImp JSS ( last ); // out: RPCVersion @@ -370,10 +369,10 @@ JSS ( role ); // out: Ping.cpp JSS ( rt_accounts ); // in: Subscribe, Unsubscribe JSS ( sanity ); // out: PeerImp JSS ( search_depth ); // in: RipplePathFind -JSS ( secret ); // in: TransactionSign, WalletSeed, +JSS ( secret ); // in: TransactionSign, // ValidationCreate, ValidationSeed, // channel_authorize -JSS ( seed ); // in: WalletAccounts, out: WalletSeed +JSS ( seed ); // JSS ( seed_hex ); // in: WalletPropose, TransactionSign JSS ( send_currencies ); // out: AccountCurrencies JSS ( send_max ); // in: PathRequest, RipplePathFind diff --git a/src/ripple/rpc/handlers/Handlers.h b/src/ripple/rpc/handlers/Handlers.h index 42b1250747..bdb5bf5401 100644 --- a/src/ripple/rpc/handlers/Handlers.h +++ b/src/ripple/rpc/handlers/Handlers.h @@ -65,8 +65,6 @@ Json::Value doRandom (RPC::Context&); Json::Value doRipplePathFind (RPC::Context&); Json::Value doServerInfo (RPC::Context&); // for humans Json::Value doServerState (RPC::Context&); // for machines -Json::Value doSessionClose (RPC::Context&); -Json::Value doSessionOpen (RPC::Context&); Json::Value doSign (RPC::Context&); Json::Value doSignFor (RPC::Context&); Json::Value doStop (RPC::Context&); @@ -80,11 +78,7 @@ Json::Value doUnlList (RPC::Context&); Json::Value doUnsubscribe (RPC::Context&); Json::Value doValidationCreate (RPC::Context&); Json::Value doValidationSeed (RPC::Context&); -Json::Value doWalletLock (RPC::Context&); Json::Value doWalletPropose (RPC::Context&); -Json::Value doWalletSeed (RPC::Context&); -Json::Value doWalletUnlock (RPC::Context&); -Json::Value doWalletVerify (RPC::Context&); Json::Value doValidators (RPC::Context&); Json::Value doValidatorListSites (RPC::Context&); } // ripple diff --git a/src/ripple/rpc/handlers/WalletSeed.cpp b/src/ripple/rpc/handlers/WalletSeed.cpp deleted file mode 100644 index 2efdb34096..0000000000 --- a/src/ripple/rpc/handlers/WalletSeed.cpp +++ /dev/null @@ -1,54 +0,0 @@ -//------------------------------------------------------------------------------ -/* - This file is part of rippled: https://github.com/ripple/rippled - Copyright (c) 2012-2014 Ripple Labs Inc. - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ -//============================================================================== - -#include -#include -#include -#include -#include -#include -#include - -namespace ripple { - -// { -// secret: -// } -Json::Value doWalletSeed (RPC::Context& context) -{ - boost::optional seed; - - bool bSecret = context.params.isMember (jss::secret); - - if (bSecret) - seed = parseGenericSeed (context.params[jss::secret].asString ()); - else - seed = randomSeed (); - - if (!seed) - return rpcError (rpcBAD_SEED); - - Json::Value obj (Json::objectValue); - obj[jss::seed] = toBase58(*seed); - obj[jss::key] = seedAs1751(*seed); - obj[jss::deprecated] = "Use wallet_propose instead"; - return obj; -} - -} // ripple diff --git a/src/ripple/rpc/impl/Handler.cpp b/src/ripple/rpc/impl/Handler.cpp index c7d5540e35..c15bcac3ec 100644 --- a/src/ripple/rpc/impl/Handler.cpp +++ b/src/ripple/rpc/impl/Handler.cpp @@ -154,7 +154,6 @@ Handler handlerArray[] { { "validators", byRef (&doValidators), Role::ADMIN, NO_CONDITION }, { "validator_list_sites", byRef (&doValidatorListSites), Role::ADMIN, NO_CONDITION }, { "wallet_propose", byRef (&doWalletPropose), Role::ADMIN, NO_CONDITION }, - { "wallet_seed", byRef (&doWalletSeed), Role::ADMIN, NO_CONDITION }, // Evented methods { "subscribe", byRef (&doSubscribe), Role::USER, NO_CONDITION }, diff --git a/src/ripple/unity/rpcx2.cpp b/src/ripple/unity/rpcx2.cpp index 6f2e940b7e..5bc0ac566a 100644 --- a/src/ripple/unity/rpcx2.cpp +++ b/src/ripple/unity/rpcx2.cpp @@ -51,7 +51,6 @@ #include #include #include -#include #include #include