mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Remove wallet_accounts and generator maps (RIPD-804):
* Remove the deprecated wallet_accounts command. * Remove dead code for generator maps. * Remove the help for the obsolete wallet_add and wallet_claim commands (which have already been removed).
This commit is contained in:
@@ -60,30 +60,10 @@ Json::Value accountFromString (
|
||||
|
||||
// We allow the use of the seeds to access #0.
|
||||
// This is poor practice and merely for debugging convenience.
|
||||
RippleAddress naRegular0Public;
|
||||
RippleAddress naRegular0Private;
|
||||
|
||||
auto naGenerator = RippleAddress::createGeneratorPublic (naSeed);
|
||||
|
||||
naRegular0Public.setAccountPublic (naGenerator, 0);
|
||||
naRegular0Private.setAccountPrivate (naGenerator, naSeed, 0);
|
||||
|
||||
SLE::pointer sleGen = netOps.getGenerator (
|
||||
lrLedger, naRegular0Public.getAccountID ());
|
||||
|
||||
if (sleGen)
|
||||
{
|
||||
// Found master public key.
|
||||
Blob vucCipher = sleGen->getFieldVL (sfGenerator);
|
||||
Blob vucMasterGenerator = naRegular0Private.accountPrivateDecrypt (
|
||||
naRegular0Public, vucCipher);
|
||||
|
||||
if (vucMasterGenerator.empty ())
|
||||
rpcError (rpcNO_GEN_DECRYPT);
|
||||
|
||||
naGenerator.setGenerator (vucMasterGenerator);
|
||||
}
|
||||
// Otherwise, if we didn't find a generator map, assume it is a master
|
||||
// Generator maps don't exist. Assume it is a master
|
||||
// generator.
|
||||
|
||||
bIndex = !iIndex;
|
||||
|
||||
@@ -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/rpc/impl/GetMasterGenerator.h>
|
||||
|
||||
namespace ripple {
|
||||
namespace RPC {
|
||||
|
||||
// Look up the master public generator for a regular seed so we may index source accounts ids.
|
||||
// --> naRegularSeed
|
||||
// <-- naMasterGenerator
|
||||
Json::Value getMasterGenerator (
|
||||
Ledger::ref lrLedger, RippleAddress const& naRegularSeed,
|
||||
RippleAddress& naMasterGenerator, NetworkOPs& netOps)
|
||||
{
|
||||
RippleAddress na0Public; // To find the generator's index.
|
||||
RippleAddress na0Private; // To decrypt the master generator's cipher.
|
||||
RippleAddress naGenerator = RippleAddress::createGeneratorPublic (naRegularSeed);
|
||||
|
||||
na0Public.setAccountPublic (naGenerator, 0);
|
||||
na0Private.setAccountPrivate (naGenerator, naRegularSeed, 0);
|
||||
|
||||
SLE::pointer sleGen = netOps.getGenerator (lrLedger, na0Public.getAccountID ());
|
||||
|
||||
if (!sleGen)
|
||||
{
|
||||
// No account has been claimed or has had it password set for seed.
|
||||
return rpcError (rpcNO_ACCOUNT);
|
||||
}
|
||||
|
||||
Blob vucCipher = sleGen->getFieldVL (sfGenerator);
|
||||
Blob vucMasterGenerator = na0Private.accountPrivateDecrypt (na0Public, vucCipher);
|
||||
|
||||
if (vucMasterGenerator.empty ())
|
||||
{
|
||||
return rpcError (rpcFAIL_GEN_DECRYPT);
|
||||
}
|
||||
|
||||
naMasterGenerator.setGenerator (vucMasterGenerator);
|
||||
|
||||
return Json::Value (Json::objectValue);
|
||||
}
|
||||
|
||||
} // RPC
|
||||
} // ripple
|
||||
@@ -1,35 +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.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef RIPPLE_RPC_GETMASTERGENERATOR_H_INCLUDED
|
||||
#define RIPPLE_RPC_GETMASTERGENERATOR_H_INCLUDED
|
||||
|
||||
namespace ripple {
|
||||
namespace RPC {
|
||||
|
||||
Json::Value getMasterGenerator (
|
||||
Ledger::ref lrLedger,
|
||||
RippleAddress const& naRegularSeed,
|
||||
RippleAddress& naMasterGenerator,
|
||||
NetworkOPs& netOps);
|
||||
|
||||
} // RPC
|
||||
} // ripple
|
||||
|
||||
#endif
|
||||
@@ -149,7 +149,6 @@ HandlerTable HANDLERS({
|
||||
{ "unl_score", byRef (&doUnlScore), Role::ADMIN, NO_CONDITION },
|
||||
{ "validation_create", byRef (&doValidationCreate), Role::ADMIN, NO_CONDITION },
|
||||
{ "validation_seed", byRef (&doValidationSeed), Role::ADMIN, NO_CONDITION },
|
||||
{ "wallet_accounts", byRef (&doWalletAccounts), Role::USER, NO_CONDITION },
|
||||
{ "wallet_propose", byRef (&doWalletPropose), Role::ADMIN, NO_CONDITION },
|
||||
{ "wallet_seed", byRef (&doWalletSeed), Role::ADMIN, NO_CONDITION },
|
||||
|
||||
|
||||
Reference in New Issue
Block a user