From c30fe3066abd62bb174b724ebdc4289b11d73b9b Mon Sep 17 00:00:00 2001 From: wilsonianb Date: Mon, 11 Jul 2016 16:16:57 -0700 Subject: [PATCH] Remove deprecated unl_add and unl_delete commands --- Builds/VisualStudio2015/RippleD.vcxproj | 8 --- .../VisualStudio2015/RippleD.vcxproj.filters | 6 -- src/ripple/net/impl/RPCCall.cpp | 33 ---------- src/ripple/protocol/JsonFields.h | 4 +- src/ripple/rpc/handlers/Handlers.h | 7 -- src/ripple/rpc/handlers/UnlAdd.cpp | 64 ------------------- src/ripple/rpc/handlers/UnlDelete.cpp | 59 ----------------- src/ripple/rpc/impl/Handler.cpp | 2 - src/ripple/unity/rpcx.cpp | 2 - 9 files changed, 2 insertions(+), 183 deletions(-) delete mode 100644 src/ripple/rpc/handlers/UnlAdd.cpp delete mode 100644 src/ripple/rpc/handlers/UnlDelete.cpp diff --git a/Builds/VisualStudio2015/RippleD.vcxproj b/Builds/VisualStudio2015/RippleD.vcxproj index fdf8c7e9d..75f46490a 100644 --- a/Builds/VisualStudio2015/RippleD.vcxproj +++ b/Builds/VisualStudio2015/RippleD.vcxproj @@ -2969,14 +2969,6 @@ True True - - True - True - - - True - True - True True diff --git a/Builds/VisualStudio2015/RippleD.vcxproj.filters b/Builds/VisualStudio2015/RippleD.vcxproj.filters index c1ddfe060..063b12fe2 100644 --- a/Builds/VisualStudio2015/RippleD.vcxproj.filters +++ b/Builds/VisualStudio2015/RippleD.vcxproj.filters @@ -3540,12 +3540,6 @@ ripple\rpc\handlers - - ripple\rpc\handlers - - - ripple\rpc\handlers - ripple\rpc\handlers diff --git a/src/ripple/net/impl/RPCCall.cpp b/src/ripple/net/impl/RPCCall.cpp index 6f300c094..e2f7681b6 100644 --- a/src/ripple/net/impl/RPCCall.cpp +++ b/src/ripple/net/impl/RPCCall.cpp @@ -874,37 +874,6 @@ private: return jvRequest; } - // unl_add | [] - Json::Value parseUnlAdd (Json::Value const& jvParams) - { - std::string strNode = jvParams[0u].asString (); - std::string strComment = (jvParams.size () == 2) ? jvParams[1u].asString () : ""; - - if (strNode.length ()) - { - Json::Value jvRequest; - - jvRequest[jss::node] = strNode; - - if (strComment.length ()) - jvRequest[jss::comment] = strComment; - - return jvRequest; - } - - return rpcError (rpcINVALID_PARAMS); - } - - // unl_delete | - Json::Value parseUnlDelete (Json::Value const& jvParams) - { - Json::Value jvRequest; - - jvRequest[jss::node] = jvParams[0u].asString (); - - return jvRequest; - } - // validation_create [||] // // NOTE: It is poor security to specify secret information on the command line. This information might be saved in the command @@ -1078,8 +1047,6 @@ public: { "tx", &RPCParser::parseTx, 1, 2 }, { "tx_account", &RPCParser::parseTxAccount, 1, 7 }, { "tx_history", &RPCParser::parseTxHistory, 1, 1 }, - { "unl_add", &RPCParser::parseUnlAdd, 1, 2 }, - { "unl_delete", &RPCParser::parseUnlDelete, 1, 1 }, { "unl_list", &RPCParser::parseAsIs, 0, 0 }, { "validation_create", &RPCParser::parseValidationCreate, 0, 1 }, { "validation_seed", &RPCParser::parseValidationSeed, 0, 1 }, diff --git a/src/ripple/protocol/JsonFields.h b/src/ripple/protocol/JsonFields.h index a8f15c7da..9a97b8801 100644 --- a/src/ripple/protocol/JsonFields.h +++ b/src/ripple/protocol/JsonFields.h @@ -119,7 +119,7 @@ JSS ( closed_ledger ); // out: NetworkOPs JSS ( cluster ); // out: UniqueNodeList, PeerImp JSS ( code ); // out: errors JSS ( command ); // in: RPCHandler -JSS ( comment ); // in: UnlAdd +JSS ( comment ); // out: UnlList JSS ( complete ); // out: NetworkOPs, InboundLedger JSS ( complete_ledgers ); // out: NetworkOPs, PeerImp JSS ( consensus ); // out: NetworkOPs, LedgerConsensus @@ -288,7 +288,7 @@ JSS ( needed_transaction_hashes ); // out: InboundLedger JSS ( network_ledger ); // out: NetworkOPs JSS ( no_ripple ); // out: AccountLines JSS ( no_ripple_peer ); // out: AccountLines -JSS ( node ); // in: UnlAdd, UnlDelete +JSS ( node ); // out: LedgerEntry JSS ( node_binary ); // out: LedgerEntry JSS ( node_hit_rate ); // out: GetCounts JSS ( node_read_bytes ); // out: GetCounts diff --git a/src/ripple/rpc/handlers/Handlers.h b/src/ripple/rpc/handlers/Handlers.h index d2b932da5..65b4f841c 100644 --- a/src/ripple/rpc/handlers/Handlers.h +++ b/src/ripple/rpc/handlers/Handlers.h @@ -76,14 +76,7 @@ Json::Value doSubscribe (RPC::Context&); Json::Value doTransactionEntry (RPC::Context&); Json::Value doTx (RPC::Context&); Json::Value doTxHistory (RPC::Context&); -Json::Value doUnlAdd (RPC::Context&); -Json::Value doUnlDelete (RPC::Context&); -Json::Value doUnlFetch (RPC::Context&); Json::Value doUnlList (RPC::Context&); -Json::Value doUnlLoad (RPC::Context&); -Json::Value doUnlNetwork (RPC::Context&); -Json::Value doUnlReset (RPC::Context&); -Json::Value doUnlScore (RPC::Context&); Json::Value doUnsubscribe (RPC::Context&); Json::Value doValidationCreate (RPC::Context&); Json::Value doValidationSeed (RPC::Context&); diff --git a/src/ripple/rpc/handlers/UnlAdd.cpp b/src/ripple/rpc/handlers/UnlAdd.cpp deleted file mode 100644 index b195e13bc..000000000 --- a/src/ripple/rpc/handlers/UnlAdd.cpp +++ /dev/null @@ -1,64 +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 -#include -#include -#include -#include - -namespace ripple { - -// { -// node: , -// comment: // optional -// } -Json::Value doUnlAdd (RPC::Context& context) -{ - auto lock = make_lock(context.app.getMasterMutex()); - - if (!context.params.isMember (jss::node)) - return rpcError (rpcINVALID_PARAMS); - - auto const id = parseBase58( - TokenType::TOKEN_NODE_PUBLIC, - context.params[jss::node].asString ()); - - if (!id) - return rpcError (rpcINVALID_PARAMS); - - auto const added = context.app.validators().insertPermanentKey ( - *id, - context.params.isMember (jss::comment) - ? context.params[jss::comment].asString () - : ""); - - Json::Value ret (Json::objectValue); - ret[jss::pubkey_validator] = context.params[jss::node]; - ret[jss::status] = added ? "added" : "already present"; - return ret; -} - -} // ripple diff --git a/src/ripple/rpc/handlers/UnlDelete.cpp b/src/ripple/rpc/handlers/UnlDelete.cpp deleted file mode 100644 index abdf60820..000000000 --- a/src/ripple/rpc/handlers/UnlDelete.cpp +++ /dev/null @@ -1,59 +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 -#include -#include -#include - -namespace ripple { - -// { -// node: | -// } -Json::Value doUnlDelete (RPC::Context& context) -{ - auto lock = make_lock(context.app.getMasterMutex()); - - if (!context.params.isMember (jss::node)) - return rpcError (rpcINVALID_PARAMS); - - auto const id = parseBase58( - TokenType::TOKEN_NODE_PUBLIC, - context.params[jss::node].asString ()); - - if (!id) - return rpcError (rpcINVALID_PARAMS); - - auto const removed = - context.app.validators().removePermanentKey (*id); - - Json::Value ret (Json::objectValue); - ret[jss::pubkey_validator] = context.params[jss::node]; - ret[jss::status] = removed ? "removed" : "not present"; - return ret; -} - -} // ripple diff --git a/src/ripple/rpc/impl/Handler.cpp b/src/ripple/rpc/impl/Handler.cpp index e4e32ee94..c49820adf 100644 --- a/src/ripple/rpc/impl/Handler.cpp +++ b/src/ripple/rpc/impl/Handler.cpp @@ -149,8 +149,6 @@ Handler handlerArray[] { { "transaction_entry", byRef (&doTransactionEntry), Role::USER, NO_CONDITION }, { "tx", byRef (&doTx), Role::USER, NEEDS_NETWORK_CONNECTION }, { "tx_history", byRef (&doTxHistory), Role::USER, NO_CONDITION }, - { "unl_add", byRef (&doUnlAdd), Role::ADMIN, NO_CONDITION }, - { "unl_delete", byRef (&doUnlDelete), Role::ADMIN, NO_CONDITION }, { "unl_list", byRef (&doUnlList), Role::ADMIN, NO_CONDITION }, { "validation_create", byRef (&doValidationCreate), Role::ADMIN, NO_CONDITION }, { "validation_seed", byRef (&doValidationSeed), Role::ADMIN, NO_CONDITION }, diff --git a/src/ripple/unity/rpcx.cpp b/src/ripple/unity/rpcx.cpp index e36e3713a..5db0e2e8d 100644 --- a/src/ripple/unity/rpcx.cpp +++ b/src/ripple/unity/rpcx.cpp @@ -80,8 +80,6 @@ #include #include #include -#include -#include #include #include #include