mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-26 22:15:52 +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:
@@ -3290,9 +3290,6 @@
|
|||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClInclude Include="..\..\src\ripple\rpc\handlers\Version.h">
|
<ClInclude Include="..\..\src\ripple\rpc\handlers\Version.h">
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClCompile Include="..\..\src\ripple\rpc\handlers\WalletAccounts.cpp">
|
|
||||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\src\ripple\rpc\handlers\WalletPropose.cpp">
|
<ClCompile Include="..\..\src\ripple\rpc\handlers\WalletPropose.cpp">
|
||||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
@@ -3316,11 +3313,6 @@
|
|||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClInclude Include="..\..\src\ripple\rpc\impl\DoPrint.h">
|
<ClInclude Include="..\..\src\ripple\rpc\impl\DoPrint.h">
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClCompile Include="..\..\src\ripple\rpc\impl\GetMasterGenerator.cpp">
|
|
||||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
|
||||||
</ClCompile>
|
|
||||||
<ClInclude Include="..\..\src\ripple\rpc\impl\GetMasterGenerator.h">
|
|
||||||
</ClInclude>
|
|
||||||
<ClCompile Include="..\..\src\ripple\rpc\impl\Handler.cpp">
|
<ClCompile Include="..\..\src\ripple\rpc\impl\Handler.cpp">
|
||||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
|||||||
@@ -3846,9 +3846,6 @@
|
|||||||
<ClInclude Include="..\..\src\ripple\rpc\handlers\Version.h">
|
<ClInclude Include="..\..\src\ripple\rpc\handlers\Version.h">
|
||||||
<Filter>ripple\rpc\handlers</Filter>
|
<Filter>ripple\rpc\handlers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClCompile Include="..\..\src\ripple\rpc\handlers\WalletAccounts.cpp">
|
|
||||||
<Filter>ripple\rpc\handlers</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\src\ripple\rpc\handlers\WalletPropose.cpp">
|
<ClCompile Include="..\..\src\ripple\rpc\handlers\WalletPropose.cpp">
|
||||||
<Filter>ripple\rpc\handlers</Filter>
|
<Filter>ripple\rpc\handlers</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
@@ -3876,12 +3873,6 @@
|
|||||||
<ClInclude Include="..\..\src\ripple\rpc\impl\DoPrint.h">
|
<ClInclude Include="..\..\src\ripple\rpc\impl\DoPrint.h">
|
||||||
<Filter>ripple\rpc\impl</Filter>
|
<Filter>ripple\rpc\impl</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClCompile Include="..\..\src\ripple\rpc\impl\GetMasterGenerator.cpp">
|
|
||||||
<Filter>ripple\rpc\impl</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClInclude Include="..\..\src\ripple\rpc\impl\GetMasterGenerator.h">
|
|
||||||
<Filter>ripple\rpc\impl</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClCompile Include="..\..\src\ripple\rpc\impl\Handler.cpp">
|
<ClCompile Include="..\..\src\ripple\rpc\impl\Handler.cpp">
|
||||||
<Filter>ripple\rpc\impl</Filter>
|
<Filter>ripple\rpc\impl</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
|||||||
@@ -1386,11 +1386,6 @@ SLE::pointer Ledger::getDirNode (uint256 const& uNodeIndex) const
|
|||||||
return getASNodeI (uNodeIndex, ltDIR_NODE);
|
return getASNodeI (uNodeIndex, ltDIR_NODE);
|
||||||
}
|
}
|
||||||
|
|
||||||
SLE::pointer Ledger::getGenerator (Account const& uGeneratorID) const
|
|
||||||
{
|
|
||||||
return getASNodeI (getGeneratorIndex (uGeneratorID), ltGENERATOR_MAP);
|
|
||||||
}
|
|
||||||
|
|
||||||
SLE::pointer
|
SLE::pointer
|
||||||
Ledger::getOffer (uint256 const& uIndex) const
|
Ledger::getOffer (uint256 const& uIndex) const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -342,12 +342,6 @@ public:
|
|||||||
std::vector<uint256> getNeededAccountStateHashes (
|
std::vector<uint256> getNeededAccountStateHashes (
|
||||||
int max, SHAMapSyncFilter* filter) const;
|
int max, SHAMapSyncFilter* filter) const;
|
||||||
|
|
||||||
//
|
|
||||||
// Generator Map functions
|
|
||||||
//
|
|
||||||
|
|
||||||
SLE::pointer getGenerator (Account const& uGeneratorID) const;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Offer functions
|
// Offer functions
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -290,10 +290,6 @@ Json::Value LedgerEntrySet::getJson (int) const
|
|||||||
entry[jss::type] = "dir_node";
|
entry[jss::type] = "dir_node";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ltGENERATOR_MAP:
|
|
||||||
entry[jss::type] = "generator_map";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ltRIPPLE_STATE:
|
case ltRIPPLE_STATE:
|
||||||
entry[jss::type] = "ripple_state";
|
entry[jss::type] = "ripple_state";
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -147,9 +147,6 @@ void printHelp (const po::options_description& desc)
|
|||||||
" unl_reset\n"
|
" unl_reset\n"
|
||||||
" validation_create [<seed>|<pass_phrase>|<key>]\n"
|
" validation_create [<seed>|<pass_phrase>|<key>]\n"
|
||||||
" validation_seed [<seed>|<pass_phrase>|<key>]\n"
|
" validation_seed [<seed>|<pass_phrase>|<key>]\n"
|
||||||
" wallet_accounts <seed>\n"
|
|
||||||
" wallet_add <regular_seed> <paying_account> <master_seed> [<initial_funds>] [<account_annotation>]\n"
|
|
||||||
" wallet_claim <master_seed> <regular_seed> [<source_tag>] [<account_annotation>]\n"
|
|
||||||
" wallet_propose [<passphrase>]\n"
|
" wallet_propose [<passphrase>]\n"
|
||||||
" wallet_seed [<seed>|<passphrase>|<passkey>]\n";
|
" wallet_seed [<seed>|<passphrase>|<passkey>]\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -260,8 +260,6 @@ public:
|
|||||||
std::function <bool (SLE::ref)> func) const override;
|
std::function <bool (SLE::ref)> func) const override;
|
||||||
AccountState::pointer getAccountState (
|
AccountState::pointer getAccountState (
|
||||||
Ledger::ref lrLedger, RippleAddress const& accountID);
|
Ledger::ref lrLedger, RippleAddress const& accountID);
|
||||||
SLE::pointer getGenerator (
|
|
||||||
Ledger::ref lrLedger, Account const& uGeneratorID);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Directory functions
|
// Directory functions
|
||||||
@@ -1196,15 +1194,6 @@ AccountState::pointer NetworkOPsImp::getAccountState (
|
|||||||
return lrLedger->getAccountState (accountID);
|
return lrLedger->getAccountState (accountID);
|
||||||
}
|
}
|
||||||
|
|
||||||
SLE::pointer NetworkOPsImp::getGenerator (
|
|
||||||
Ledger::ref lrLedger, Account const& uGeneratorID)
|
|
||||||
{
|
|
||||||
if (!lrLedger)
|
|
||||||
return SLE::pointer ();
|
|
||||||
|
|
||||||
return lrLedger->getGenerator (uGeneratorID);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Directory functions
|
// Directory functions
|
||||||
//
|
//
|
||||||
@@ -1295,7 +1284,6 @@ Json::Value NetworkOPsImp::getOwnerInfo (
|
|||||||
|
|
||||||
case ltACCOUNT_ROOT:
|
case ltACCOUNT_ROOT:
|
||||||
case ltDIR_NODE:
|
case ltDIR_NODE:
|
||||||
case ltGENERATOR_MAP:
|
|
||||||
default:
|
default:
|
||||||
assert (false);
|
assert (false);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -171,8 +171,6 @@ public:
|
|||||||
std::function <bool (SLE::ref)> func) const = 0;
|
std::function <bool (SLE::ref)> func) const = 0;
|
||||||
virtual AccountState::pointer getAccountState (Ledger::ref lrLedger,
|
virtual AccountState::pointer getAccountState (Ledger::ref lrLedger,
|
||||||
RippleAddress const& accountID) = 0;
|
RippleAddress const& accountID) = 0;
|
||||||
virtual SLE::pointer getGenerator (Ledger::ref lrLedger,
|
|
||||||
Account const& uGeneratorID) = 0;
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -721,16 +721,6 @@ private:
|
|||||||
return jvRequest;
|
return jvRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
// wallet_accounts <seed>
|
|
||||||
Json::Value parseWalletAccounts (Json::Value const& jvParams)
|
|
||||||
{
|
|
||||||
Json::Value jvRequest;
|
|
||||||
|
|
||||||
jvRequest[jss::seed] = jvParams[0u].asString ();
|
|
||||||
|
|
||||||
return jvRequest;
|
|
||||||
}
|
|
||||||
|
|
||||||
// wallet_propose [<passphrase>]
|
// wallet_propose [<passphrase>]
|
||||||
// <passphrase> is only for testing. Master seeds should only be generated randomly.
|
// <passphrase> is only for testing. Master seeds should only be generated randomly.
|
||||||
Json::Value parseWalletPropose (Json::Value const& jvParams)
|
Json::Value parseWalletPropose (Json::Value const& jvParams)
|
||||||
@@ -859,7 +849,6 @@ public:
|
|||||||
{ "validation_create", &RPCParser::parseValidationCreate, 0, 1 },
|
{ "validation_create", &RPCParser::parseValidationCreate, 0, 1 },
|
||||||
{ "validation_seed", &RPCParser::parseValidationSeed, 0, 1 },
|
{ "validation_seed", &RPCParser::parseValidationSeed, 0, 1 },
|
||||||
{ "version", &RPCParser::parseAsIs, 0, 0 },
|
{ "version", &RPCParser::parseAsIs, 0, 0 },
|
||||||
{ "wallet_accounts", &RPCParser::parseWalletAccounts, 1, 1 },
|
|
||||||
{ "wallet_propose", &RPCParser::parseWalletPropose, 0, 1 },
|
{ "wallet_propose", &RPCParser::parseWalletPropose, 0, 1 },
|
||||||
{ "wallet_seed", &RPCParser::parseWalletSeed, 0, 1 },
|
{ "wallet_seed", &RPCParser::parseWalletSeed, 0, 1 },
|
||||||
{ "internal", &RPCParser::parseInternal, 1, -1 },
|
{ "internal", &RPCParser::parseInternal, 1, -1 },
|
||||||
|
|||||||
@@ -110,10 +110,8 @@ enum error_code_i
|
|||||||
|
|
||||||
// Internal error (should never happen)
|
// Internal error (should never happen)
|
||||||
rpcINTERNAL, // Generic internal error.
|
rpcINTERNAL, // Generic internal error.
|
||||||
rpcFAIL_GEN_DECRYPT,
|
|
||||||
rpcNOT_IMPL,
|
rpcNOT_IMPL,
|
||||||
rpcNOT_SUPPORTED,
|
rpcNOT_SUPPORTED,
|
||||||
rpcNO_GEN_DECRYPT,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -50,8 +50,6 @@ enum LedgerEntryType
|
|||||||
*/
|
*/
|
||||||
ltDIR_NODE = 'd',
|
ltDIR_NODE = 'd',
|
||||||
|
|
||||||
ltGENERATOR_MAP = 'g',
|
|
||||||
|
|
||||||
/** Describes a trust line.
|
/** Describes a trust line.
|
||||||
*/
|
*/
|
||||||
ltRIPPLE_STATE = 'r',
|
ltRIPPLE_STATE = 'r',
|
||||||
|
|||||||
@@ -386,7 +386,6 @@ extern TypedField<STBlob> const sfPublicKey;
|
|||||||
extern SField const sfMessageKey;
|
extern SField const sfMessageKey;
|
||||||
extern TypedField<STBlob> const sfSigningPubKey;
|
extern TypedField<STBlob> const sfSigningPubKey;
|
||||||
extern SField const sfTxnSignature;
|
extern SField const sfTxnSignature;
|
||||||
extern SField const sfGenerator;
|
|
||||||
extern TypedField<STBlob> const sfSignature;
|
extern TypedField<STBlob> const sfSignature;
|
||||||
extern SField const sfDomain;
|
extern SField const sfDomain;
|
||||||
extern SField const sfFundCode;
|
extern SField const sfFundCode;
|
||||||
|
|||||||
@@ -64,7 +64,6 @@ public:
|
|||||||
add (rpcDST_ACT_MISSING, "dstActMissing", "Destination account does not exist.");
|
add (rpcDST_ACT_MISSING, "dstActMissing", "Destination account does not exist.");
|
||||||
add (rpcDST_AMT_MALFORMED, "dstAmtMalformed", "Destination amount/currency/issuer is malformed.");
|
add (rpcDST_AMT_MALFORMED, "dstAmtMalformed", "Destination amount/currency/issuer is malformed.");
|
||||||
add (rpcDST_ISR_MALFORMED, "dstIsrMalformed", "Destination issuer is malformed.");
|
add (rpcDST_ISR_MALFORMED, "dstIsrMalformed", "Destination issuer is malformed.");
|
||||||
add (rpcFAIL_GEN_DECRYPT, "failGenDecrypt", "Failed to decrypt generator.");
|
|
||||||
add (rpcFORBIDDEN, "forbidden", "Bad credentials.");
|
add (rpcFORBIDDEN, "forbidden", "Bad credentials.");
|
||||||
add (rpcGENERAL, "general", "Generic error reason.");
|
add (rpcGENERAL, "general", "Generic error reason.");
|
||||||
add (rpcGETS_ACT_MALFORMED, "getsActMalformed", "Gets account malformed.");
|
add (rpcGETS_ACT_MALFORMED, "getsActMalformed", "Gets account malformed.");
|
||||||
@@ -89,7 +88,6 @@ public:
|
|||||||
add (rpcNO_CLOSED, "noClosed", "Closed ledger is unavailable.");
|
add (rpcNO_CLOSED, "noClosed", "Closed ledger is unavailable.");
|
||||||
add (rpcNO_CURRENT, "noCurrent", "Current ledger is unavailable.");
|
add (rpcNO_CURRENT, "noCurrent", "Current ledger is unavailable.");
|
||||||
add (rpcNO_EVENTS, "noEvents", "Current transport does not support events.");
|
add (rpcNO_EVENTS, "noEvents", "Current transport does not support events.");
|
||||||
add (rpcNO_GEN_DECRYPT, "noGenDecrypt", "Password failed to decrypt master public generator.");
|
|
||||||
add (rpcNO_NETWORK, "noNetwork", "Not synced to Ripple network.");
|
add (rpcNO_NETWORK, "noNetwork", "Not synced to Ripple network.");
|
||||||
add (rpcNO_PATH, "noPath", "Unable to find a ripple path.");
|
add (rpcNO_PATH, "noPath", "Unable to find a ripple path.");
|
||||||
add (rpcNO_PERMISSION, "noPermission", "You don't have permission for this command.");
|
add (rpcNO_PERMISSION, "noPermission", "You don't have permission for this command.");
|
||||||
|
|||||||
@@ -54,10 +54,6 @@ LedgerFormats::LedgerFormats ()
|
|||||||
<< SOElement (sfIndexPrevious, SOE_OPTIONAL)
|
<< SOElement (sfIndexPrevious, SOE_OPTIONAL)
|
||||||
;
|
;
|
||||||
|
|
||||||
add ("GeneratorMap", ltGENERATOR_MAP)
|
|
||||||
<< SOElement (sfGenerator, SOE_REQUIRED)
|
|
||||||
;
|
|
||||||
|
|
||||||
add ("Offer", ltOFFER)
|
add ("Offer", ltOFFER)
|
||||||
<< SOElement (sfAccount, SOE_REQUIRED)
|
<< SOElement (sfAccount, SOE_REQUIRED)
|
||||||
<< SOElement (sfSequence, SOE_REQUIRED)
|
<< SOElement (sfSequence, SOE_REQUIRED)
|
||||||
|
|||||||
@@ -176,7 +176,6 @@ TypedField<STBlob> const sfSigningPubKey = make::one<STBlob>(&sfSigningPubKey
|
|||||||
TypedField<STBlob> const sfSignature = make::one<STBlob>(&sfSignature, STI_VL, 6, "Signature", SField::sMD_Default, false);
|
TypedField<STBlob> const sfSignature = make::one<STBlob>(&sfSignature, STI_VL, 6, "Signature", SField::sMD_Default, false);
|
||||||
SField const sfMessageKey = make::one(&sfMessageKey, STI_VL, 2, "MessageKey");
|
SField const sfMessageKey = make::one(&sfMessageKey, STI_VL, 2, "MessageKey");
|
||||||
SField const sfTxnSignature = make::one(&sfTxnSignature, STI_VL, 4, "TxnSignature", SField::sMD_Default, false);
|
SField const sfTxnSignature = make::one(&sfTxnSignature, STI_VL, 4, "TxnSignature", SField::sMD_Default, false);
|
||||||
SField const sfGenerator = make::one(&sfGenerator, STI_VL, 5, "Generator");
|
|
||||||
SField const sfDomain = make::one(&sfDomain, STI_VL, 7, "Domain");
|
SField const sfDomain = make::one(&sfDomain, STI_VL, 7, "Domain");
|
||||||
SField const sfFundCode = make::one(&sfFundCode, STI_VL, 8, "FundCode");
|
SField const sfFundCode = make::one(&sfFundCode, STI_VL, 8, "FundCode");
|
||||||
SField const sfRemoveCode = make::one(&sfRemoveCode, STI_VL, 9, "RemoveCode");
|
SField const sfRemoveCode = make::one(&sfRemoveCode, STI_VL, 9, "RemoveCode");
|
||||||
|
|||||||
@@ -161,7 +161,6 @@ Json::Value doAccountObjects (RPC::Context& context)
|
|||||||
|
|
||||||
// case ltACCOUNT_ROOT:
|
// case ltACCOUNT_ROOT:
|
||||||
// case ltDIR_NODE:
|
// case ltDIR_NODE:
|
||||||
// case ltGENERATOR_MAP:
|
|
||||||
default:
|
default:
|
||||||
if (! jv.isNull ())
|
if (! jv.isNull ())
|
||||||
jv = Json::nullValue;
|
jv = Json::nullValue;
|
||||||
|
|||||||
@@ -79,7 +79,6 @@ Json::Value doUnlScore (RPC::Context&);
|
|||||||
Json::Value doUnsubscribe (RPC::Context&);
|
Json::Value doUnsubscribe (RPC::Context&);
|
||||||
Json::Value doValidationCreate (RPC::Context&);
|
Json::Value doValidationCreate (RPC::Context&);
|
||||||
Json::Value doValidationSeed (RPC::Context&);
|
Json::Value doValidationSeed (RPC::Context&);
|
||||||
Json::Value doWalletAccounts (RPC::Context&);
|
|
||||||
Json::Value doWalletLock (RPC::Context&);
|
Json::Value doWalletLock (RPC::Context&);
|
||||||
Json::Value doWalletPropose (RPC::Context&);
|
Json::Value doWalletPropose (RPC::Context&);
|
||||||
Json::Value doWalletSeed (RPC::Context&);
|
Json::Value doWalletSeed (RPC::Context&);
|
||||||
|
|||||||
@@ -1,75 +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/Accounts.h>
|
|
||||||
#include <ripple/rpc/impl/GetMasterGenerator.h>
|
|
||||||
|
|
||||||
namespace ripple {
|
|
||||||
|
|
||||||
// {
|
|
||||||
// seed: <string>
|
|
||||||
// ledger_hash : <ledger>
|
|
||||||
// ledger_index : <ledger_index>
|
|
||||||
// }
|
|
||||||
Json::Value doWalletAccounts (RPC::Context& context)
|
|
||||||
{
|
|
||||||
Ledger::pointer ledger;
|
|
||||||
Json::Value jvResult
|
|
||||||
= RPC::lookupLedger (context.params, ledger, context.netOps);
|
|
||||||
|
|
||||||
if (!ledger)
|
|
||||||
return jvResult;
|
|
||||||
|
|
||||||
RippleAddress naSeed;
|
|
||||||
|
|
||||||
if (!context.params.isMember (jss::seed)
|
|
||||||
|| !naSeed.setSeedGeneric (context.params[jss::seed].asString ()))
|
|
||||||
{
|
|
||||||
return rpcError (rpcBAD_SEED);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Try the seed as a master seed.
|
|
||||||
RippleAddress naMasterGenerator
|
|
||||||
= RippleAddress::createGeneratorPublic (naSeed);
|
|
||||||
|
|
||||||
Json::Value jsonAccounts
|
|
||||||
= RPC::accounts (ledger, naMasterGenerator, context.netOps);
|
|
||||||
|
|
||||||
if (jsonAccounts.empty ())
|
|
||||||
{
|
|
||||||
// No account via seed as master, try seed a regular.
|
|
||||||
Json::Value ret = RPC::getMasterGenerator (
|
|
||||||
ledger, naSeed, naMasterGenerator, context.netOps);
|
|
||||||
|
|
||||||
if (!ret.empty ())
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
ret[jss::accounts]
|
|
||||||
= RPC::accounts (ledger, naMasterGenerator, context.netOps);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Had accounts via seed as master, return them.
|
|
||||||
return RPC::makeObjectValue (jsonAccounts, jss::accounts);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} // ripple
|
|
||||||
@@ -60,30 +60,10 @@ Json::Value accountFromString (
|
|||||||
|
|
||||||
// We allow the use of the seeds to access #0.
|
// We allow the use of the seeds to access #0.
|
||||||
// This is poor practice and merely for debugging convenience.
|
// This is poor practice and merely for debugging convenience.
|
||||||
RippleAddress naRegular0Public;
|
|
||||||
RippleAddress naRegular0Private;
|
|
||||||
|
|
||||||
auto naGenerator = RippleAddress::createGeneratorPublic (naSeed);
|
auto naGenerator = RippleAddress::createGeneratorPublic (naSeed);
|
||||||
|
|
||||||
naRegular0Public.setAccountPublic (naGenerator, 0);
|
// Generator maps don't exist. Assume it is a master
|
||||||
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.
|
// generator.
|
||||||
|
|
||||||
bIndex = !iIndex;
|
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 },
|
{ "unl_score", byRef (&doUnlScore), Role::ADMIN, NO_CONDITION },
|
||||||
{ "validation_create", byRef (&doValidationCreate), Role::ADMIN, NO_CONDITION },
|
{ "validation_create", byRef (&doValidationCreate), Role::ADMIN, NO_CONDITION },
|
||||||
{ "validation_seed", byRef (&doValidationSeed), 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_propose", byRef (&doWalletPropose), Role::ADMIN, NO_CONDITION },
|
||||||
{ "wallet_seed", byRef (&doWalletSeed), Role::ADMIN, NO_CONDITION },
|
{ "wallet_seed", byRef (&doWalletSeed), Role::ADMIN, NO_CONDITION },
|
||||||
|
|
||||||
|
|||||||
@@ -89,13 +89,11 @@
|
|||||||
#include <ripple/rpc/handlers/Unsubscribe.cpp>
|
#include <ripple/rpc/handlers/Unsubscribe.cpp>
|
||||||
#include <ripple/rpc/handlers/ValidationCreate.cpp>
|
#include <ripple/rpc/handlers/ValidationCreate.cpp>
|
||||||
#include <ripple/rpc/handlers/ValidationSeed.cpp>
|
#include <ripple/rpc/handlers/ValidationSeed.cpp>
|
||||||
#include <ripple/rpc/handlers/WalletAccounts.cpp>
|
|
||||||
#include <ripple/rpc/handlers/WalletPropose.cpp>
|
#include <ripple/rpc/handlers/WalletPropose.cpp>
|
||||||
#include <ripple/rpc/handlers/WalletSeed.cpp>
|
#include <ripple/rpc/handlers/WalletSeed.cpp>
|
||||||
|
|
||||||
#include <ripple/rpc/impl/AccountFromString.cpp>
|
#include <ripple/rpc/impl/AccountFromString.cpp>
|
||||||
#include <ripple/rpc/impl/Accounts.cpp>
|
#include <ripple/rpc/impl/Accounts.cpp>
|
||||||
#include <ripple/rpc/impl/GetMasterGenerator.cpp>
|
|
||||||
#include <ripple/rpc/impl/Handler.cpp>
|
#include <ripple/rpc/impl/Handler.cpp>
|
||||||
#include <ripple/rpc/impl/KeypairForSignature.cpp>
|
#include <ripple/rpc/impl/KeypairForSignature.cpp>
|
||||||
#include <ripple/rpc/impl/LegacyPathFind.cpp>
|
#include <ripple/rpc/impl/LegacyPathFind.cpp>
|
||||||
|
|||||||
Reference in New Issue
Block a user