Remove unused legacy code

This commit is contained in:
Nik Bougalis
2014-04-04 16:46:59 -07:00
committed by Vinnie Falco
parent 81238e21a5
commit bec876d062
6 changed files with 1 additions and 189 deletions

View File

@@ -121,8 +121,6 @@ David Features:
- Replace C11X with BEAST_COMPILER_SUPPORTS_MOVE_SEMANTICS
- Remove "ENABLE_INSECURE" when the time is right.
- Go searching through VFALCO notes and fix everything
- Deal with function-level statics used for SqliteDatabase (like in

View File

@@ -84,11 +84,6 @@ void printHelp (const po::options_description& desc)
cerr << " book_offers <taker_pays> <taker_gets> [<taker [<ledger> [<limit> [<proof> [<marker>]]]]]" << endl;
cerr << " connect <ip> [<port>]" << endl;
cerr << " consensus_info" << endl;
#if ENABLE_INSECURE
cerr << " data_delete <key>" << endl;
cerr << " data_fetch <key>" << endl;
cerr << " data_store <key> <value>" << endl;
#endif
cerr << " get_counts" << endl;
cerr << " json <method> <json>" << endl;
cerr << " ledger [<id>|current|closed|validated] [full]" << endl;
@@ -174,7 +169,7 @@ int run (int argc, char** argv)
setCallingThreadName ("main");
int iResult = 0;
po::variables_map vm; // Map of options.
po::variables_map vm;
beast::String importDescription;
{

View File

@@ -868,85 +868,6 @@ Json::Value RPCHandler::doConnect (Json::Value params,
return "connecting";
}
#if ENABLE_INSECURE
// {
// key: <string>
// }
Json::Value RPCHandler::doDataDelete (Json::Value params, Resource::Charge& loadType, Application::ScopedLockType& masterLockHolder)
{
if (!params.isMember ("key"))
return RPC::missing_field_error ("key");
std::string strKey = params["key"].asString ();
Json::Value ret = Json::Value (Json::objectValue);
if (getApp().getLocalCredentials ().dataDelete (strKey))
{
ret["key"] = strKey;
}
else
{
ret = rpcError (rpcINTERNAL);
}
return ret;
}
#endif
#if ENABLE_INSECURE
// {
// key: <string>
// }
Json::Value RPCHandler::doDataFetch (Json::Value params, Resource::Charge& loadType, Application::ScopedLockType& masterLockHolder)
{
if (!params.isMember ("key"))
return RPC::missing_field_error ("key");
std::string strKey = params["key"].asString ();
std::string strValue;
Json::Value ret = Json::Value (Json::objectValue);
ret["key"] = strKey;
if (getApp().getLocalCredentials ().dataFetch (strKey, strValue))
ret["value"] = strValue;
return ret;
}
#endif
#if ENABLE_INSECURE
// {
// key: <string>
// value: <string>
// }
Json::Value RPCHandler::doDataStore (Json::Value params, Resource::Charge& loadType, Application::ScopedLockType& masterLockHolder)
{
if (!params.isMember ("key")
return RPC::missing_field_error ("key");
if (!params.isMember ("value")
return RPC::missing_field_error ("value");
std::string strKey = params["key"].asString ();
std::string strValue = params["value"].asString ();
Json::Value ret = Json::Value (Json::objectValue);
if (getApp().getLocalCredentials ().dataStore (strKey, strValue))
{
ret["key"] = strKey;
ret["value"] = strValue;
}
else
{
ret = rpcError (rpcINTERNAL);
}
return ret;
}
#endif
#if 0
// XXX Needs to be revised for new paradigm
@@ -2956,32 +2877,6 @@ Json::Value RPCHandler::doWalletSeed (Json::Value params, Resource::Charge& load
}
}
#if ENABLE_INSECURE
// TODO: for now this simply checks if this is the Config::ADMIN account
// TODO: need to prevent them hammering this over and over
// TODO: maybe a better way is only allow Config::ADMIN from local host
// {
// username: <string>,
// password: <string>
// }
Json::Value RPCHandler::doLogin (Json::Value params, Resource::Charge& loadType, Application::ScopedLockType& masterLockHolder)
{
if (!params.isMember ("username")
|| !params.isMember ("password"))
return rpcError (rpcINVALID_PARAMS);
if (params["username"].asString () == getConfig ().RPC_USER && params["password"].asString () == getConfig ().RPC_PASSWORD)
{
//mRole=ADMIN;
return "logged in";
}
else
{
return "nope";
}
}
#endif
static void textTime (std::string& text, int& seconds, const char* unitName, int unitVal)
{
int i = seconds / unitVal;
@@ -4371,14 +4266,6 @@ Json::Value RPCHandler::doCommand (const Json::Value& params, int iRole, Resourc
{ "wallet_propose", &RPCHandler::doWalletPropose, true, optNone },
{ "wallet_seed", &RPCHandler::doWalletSeed, true, optNone },
#if ENABLE_INSECURE
// XXX Unnecessary commands which should be removed.
{ "login", &RPCHandler::doLogin, true, optNone },
{ "data_delete", &RPCHandler::doDataDelete, true, optNone },
{ "data_fetch", &RPCHandler::doDataFetch, true, optNone },
{ "data_store", &RPCHandler::doDataStore, true, optNone },
#endif
// Evented methods
{ "subscribe", &RPCHandler::doSubscribe, false, optNone },
{ "unsubscribe", &RPCHandler::doUnsubscribe, false, optNone },

View File

@@ -165,13 +165,6 @@ private:
Json::Value doWalletUnlock (Json::Value params, Resource::Charge& loadType, Application::ScopedLockType& mlh);
Json::Value doWalletVerify (Json::Value params, Resource::Charge& loadType, Application::ScopedLockType& mlh);
#if ENABLE_INSECURE
Json::Value doDataDelete (Json::Value params, Resource::Charge& loadType, Application::ScopedLockType& mlh);
Json::Value doDataFetch (Json::Value params, Resource::Charge& loadType, Application::ScopedLockType& mlh);
Json::Value doDataStore (Json::Value params, Resource::Charge& loadType, Application::ScopedLockType& mlh);
Json::Value doLogin (Json::Value params, Resource::Charge& loadType, Application::ScopedLockType& mlh);
#endif
private:
NetworkOPs* mNetOps;
InfoSub::pointer mInfoSub;

View File

@@ -33,9 +33,6 @@ namespace ripple {
#define SYSTEM_CURRENCY_PARTS 1000000ull // 10^SYSTEM_CURRENCY_PRECISION
#define SYSTEM_CURRENCY_START (SYSTEM_CURRENCY_GIFT*SYSTEM_CURRENCY_USERS*SYSTEM_CURRENCY_PARTS)
// VFALCO NOTE Set this to 1 to enable code which is unnecessary
#define ENABLE_INSECURE 0
const int DOMAIN_BYTES_MAX = 256;
const int PUBLIC_BYTES_MAX = 33; // Maximum bytes for an account public key.

View File

@@ -332,43 +332,6 @@ private:
return jvRequest;
}
#if ENABLE_INSECURE
// data_delete <key>
Json::Value parseDataDelete (const Json::Value& jvParams)
{
Json::Value jvRequest (Json::objectValue);
jvRequest["key"] = jvParams[0u].asString ();
return jvRequest;
}
#endif
#if ENABLE_INSECURE
// data_fetch <key>
Json::Value parseDataFetch (const Json::Value& jvParams)
{
Json::Value jvRequest (Json::objectValue);
jvRequest["key"] = jvParams[0u].asString ();
return jvRequest;
}
#endif
#if ENABLE_INSECURE
// data_store <key> <value>
Json::Value parseDataStore (const Json::Value& jvParams)
{
Json::Value jvRequest (Json::objectValue);
jvRequest["key"] = jvParams[0u].asString ();
jvRequest["value"] = jvParams[1u].asString ();
return jvRequest;
}
#endif
// Return an error for attemping to subscribe/unsubscribe via RPC.
Json::Value parseEvented (const Json::Value& jvParams)
{
@@ -461,19 +424,6 @@ private:
return jvRequest;
}
#if ENABLE_INSECURE
// login <username> <password>
Json::Value parseLogin (const Json::Value& jvParams)
{
Json::Value jvRequest (Json::objectValue);
jvRequest["username"] = jvParams[0u].asString ();
jvRequest["password"] = jvParams[1u].asString ();
return jvRequest;
}
#endif
// log_level: Get log levels
// log_level <severity>: Set master log level to the specified severity
// log_level <partition> <severity>: Set specified partition to specified severity
@@ -901,14 +851,6 @@ public:
{ "wallet_seed", &RPCParser::parseWalletSeed, 0, 1 },
{ "internal", &RPCParser::parseInternal, 1, -1 },
#if ENABLE_INSECURE
// XXX Unnecessary commands which should be removed.
{ "login", &RPCParser::parseLogin, 2, 2 },
{ "data_delete", &RPCParser::parseDataDelete, 1, 1 },
{ "data_fetch", &RPCParser::parseDataFetch, 1, 1 },
{ "data_store", &RPCParser::parseDataStore, 2, 2 },
#endif
// Evented methods
{ "path_find", &RPCParser::parseEvented, -1, -1 },
{ "subscribe", &RPCParser::parseEvented, -1, -1 },