mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Remove obsolete Internal command (RIPD-888)
This commit is contained in:
@@ -3123,10 +3123,6 @@
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\rpc\handlers\Handlers.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\rpc\handlers\Internal.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\rpc\handlers\LedgerAccept.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
@@ -3331,8 +3327,6 @@
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\rpc\impl\WSInfoSub.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\rpc\InternalHandler.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\rpc\json_body.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\rpc\RipplePathFind.h">
|
||||
|
||||
@@ -3615,9 +3615,6 @@
|
||||
<ClInclude Include="..\..\src\ripple\rpc\handlers\Handlers.h">
|
||||
<Filter>ripple\rpc\handlers</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\rpc\handlers\Internal.cpp">
|
||||
<Filter>ripple\rpc\handlers</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\rpc\handlers\LedgerAccept.cpp">
|
||||
<Filter>ripple\rpc\handlers</Filter>
|
||||
</ClCompile>
|
||||
@@ -3786,9 +3783,6 @@
|
||||
<ClInclude Include="..\..\src\ripple\rpc\impl\WSInfoSub.h">
|
||||
<Filter>ripple\rpc\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\rpc\InternalHandler.h">
|
||||
<Filter>ripple\rpc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\rpc\json_body.h">
|
||||
<Filter>ripple\rpc</Filter>
|
||||
</ClInclude>
|
||||
|
||||
@@ -222,7 +222,7 @@ public:
|
||||
Json::Value& entry = (ret[inboundEntry.to_string()] = Json::objectValue);
|
||||
entry[jss::local] = localBalance;
|
||||
entry[jss::remote] = inboundEntry.remote_balance;
|
||||
entry[jss::type] = "outbound";
|
||||
entry[jss::type] = "inbound";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of rippled: https://github.com/ripple/rippled
|
||||
Copyright (c) 2012, 2013 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.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef RIPPLE_RPC_INTERNALHANDLER_H_INCLUDED
|
||||
#define RIPPLE_RPC_INTERNALHANDLER_H_INCLUDED
|
||||
|
||||
namespace ripple {
|
||||
namespace RPC {
|
||||
|
||||
/** To dynamically add custom or experimental RPC handlers, construct a new
|
||||
* instance of InternalHandler with your own handler function. */
|
||||
struct InternalHandler
|
||||
{
|
||||
using handler_t = Json::Value (*) (const Json::Value&);
|
||||
|
||||
InternalHandler (const std::string& name, handler_t handler)
|
||||
: name_ (name),
|
||||
handler_ (handler)
|
||||
{
|
||||
nextHandler_ = InternalHandler::headHandler;
|
||||
InternalHandler::headHandler = this;
|
||||
}
|
||||
|
||||
InternalHandler* nextHandler_;
|
||||
std::string name_;
|
||||
handler_t handler_;
|
||||
|
||||
static InternalHandler* headHandler;
|
||||
};
|
||||
|
||||
} // RPC
|
||||
} // ripple
|
||||
|
||||
#endif
|
||||
@@ -42,7 +42,6 @@ Json::Value doFee (RPC::Context&);
|
||||
Json::Value doFetchInfo (RPC::Context&);
|
||||
Json::Value doGatewayBalances (RPC::Context&);
|
||||
Json::Value doGetCounts (RPC::Context&);
|
||||
Json::Value doInternal (RPC::Context&);
|
||||
Json::Value doLedgerAccept (RPC::Context&);
|
||||
Json::Value doLedgerCleaner (RPC::Context&);
|
||||
Json::Value doLedgerClosed (RPC::Context&);
|
||||
|
||||
@@ -1,62 +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 <BeastConfig.h>
|
||||
#include <ripple/basics/Log.h>
|
||||
#include <ripple/json/json_value.h>
|
||||
#include <ripple/json/json_writer.h>
|
||||
#include <ripple/net/RPCErr.h>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
#include <ripple/protocol/JsonFields.h>
|
||||
#include <ripple/rpc/Context.h>
|
||||
#include <ripple/rpc/InternalHandler.h>
|
||||
#include <string>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
RPC::InternalHandler* RPC::InternalHandler::headHandler = nullptr;
|
||||
|
||||
Json::Value doInternal (RPC::Context& context)
|
||||
{
|
||||
// Used for debug or special-purpose RPC commands
|
||||
if (!context.params.isMember (jss::internal_command))
|
||||
return rpcError (rpcINVALID_PARAMS);
|
||||
|
||||
auto name = context.params[jss::internal_command].asString ();
|
||||
auto params = context.params[jss::params];
|
||||
|
||||
for (auto* h = RPC::InternalHandler::headHandler; h; )
|
||||
{
|
||||
if (name == h->name_)
|
||||
{
|
||||
JLOG (context.j.warn())
|
||||
<< "Internal command " << name << ": " << params;
|
||||
Json::Value ret = h->handler_ (params);
|
||||
JLOG (context.j.warn())
|
||||
<< "Internal command returns: " << ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
h = h->nextHandler_;
|
||||
}
|
||||
|
||||
return rpcError (rpcBAD_SYNTAX);
|
||||
}
|
||||
|
||||
} // ripple
|
||||
@@ -114,7 +114,6 @@ Handler handlerArray[] {
|
||||
{ "consensus_info", byRef (&doConsensusInfo), Role::ADMIN, NO_CONDITION },
|
||||
{ "gateway_balances", byRef (&doGatewayBalances), Role::USER, NO_CONDITION },
|
||||
{ "get_counts", byRef (&doGetCounts), Role::ADMIN, NO_CONDITION },
|
||||
{ "internal", byRef (&doInternal), Role::ADMIN, NO_CONDITION },
|
||||
{ "feature", byRef (&doFeature), Role::ADMIN, NO_CONDITION },
|
||||
{ "fee", byRef (&doFee), Role::USER, NO_CONDITION },
|
||||
{ "fetch_info", byRef (&doFetchInfo), Role::ADMIN, NO_CONDITION },
|
||||
|
||||
@@ -48,7 +48,6 @@
|
||||
#include <ripple/rpc/handlers/FetchInfo.cpp>
|
||||
#include <ripple/rpc/handlers/GatewayBalances.cpp>
|
||||
#include <ripple/rpc/handlers/GetCounts.cpp>
|
||||
#include <ripple/rpc/handlers/Internal.cpp>
|
||||
#include <ripple/rpc/handlers/LedgerHandler.cpp>
|
||||
#include <ripple/rpc/handlers/LedgerAccept.cpp>
|
||||
#include <ripple/rpc/handlers/LedgerCleanerHandler.cpp>
|
||||
|
||||
Reference in New Issue
Block a user