diff --git a/src/ripple/rpc/handlers/AccountCurrencies.cpp b/src/ripple/rpc/handlers/AccountCurrencies.cpp index cb877ecdec..4b6f4d50e9 100644 --- a/src/ripple/rpc/handlers/AccountCurrencies.cpp +++ b/src/ripple/rpc/handlers/AccountCurrencies.cpp @@ -58,8 +58,8 @@ Json::Value doAccountCurrencies (RPC::Context& context) // Get info on account. bool bIndex; // out param RippleAddress naAccount; // out param - Json::Value jvAccepted (RPC::accountFromString ( - ledger, naAccount, bIndex, strIdent, iIndex, bStrict, context.netOps)); + Json::Value jvAccepted ( + RPC::accountFromString (naAccount, bIndex, strIdent, iIndex, bStrict)); if (!jvAccepted.empty ()) return jvAccepted; diff --git a/src/ripple/rpc/handlers/AccountInfo.cpp b/src/ripple/rpc/handlers/AccountInfo.cpp index 2fc773f37c..01f9d2fb52 100644 --- a/src/ripple/rpc/handlers/AccountInfo.cpp +++ b/src/ripple/rpc/handlers/AccountInfo.cpp @@ -56,8 +56,8 @@ Json::Value doAccountInfo (RPC::Context& context) // Get info on account. - Json::Value jvAccepted = RPC::accountFromString ( - ledger, naAccount, bIndex, strIdent, iIndex, bStrict, context.netOps); + auto jvAccepted = RPC::accountFromString ( + naAccount, bIndex, strIdent, iIndex, bStrict); if (!jvAccepted.empty ()) return jvAccepted; diff --git a/src/ripple/rpc/handlers/AccountLines.cpp b/src/ripple/rpc/handlers/AccountLines.cpp index 1d25122d6a..453b5edacc 100644 --- a/src/ripple/rpc/handlers/AccountLines.cpp +++ b/src/ripple/rpc/handlers/AccountLines.cpp @@ -91,11 +91,11 @@ Json::Value doAccountLines (RPC::Context& context) int iIndex (bIndex ? params[jss::account_index].asUInt () : 0); RippleAddress rippleAddress; - Json::Value const jv (RPC::accountFromString (ledger, rippleAddress, bIndex, - strIdent, iIndex, false, context.netOps)); + auto jv = RPC::accountFromString ( + rippleAddress, bIndex, strIdent, iIndex, false); if (! jv.empty ()) { - for (Json::Value::const_iterator it (jv.begin ()); it != jv.end (); ++it) + for (auto it = jv.begin (); it != jv.end (); ++it) result[it.memberName ()] = it.key (); return result; @@ -119,8 +119,8 @@ Json::Value doAccountLines (RPC::Context& context) if (bPeerIndex) result[jss::peer_index] = iPeerIndex; - result = RPC::accountFromString (ledger, rippleAddressPeer, bPeerIndex, - strPeer, iPeerIndex, false, context.netOps); + result = RPC::accountFromString ( + rippleAddressPeer, bPeerIndex, strPeer, iPeerIndex, false); if (! result.empty ()) return result; diff --git a/src/ripple/rpc/handlers/AccountObjects.cpp b/src/ripple/rpc/handlers/AccountObjects.cpp index 6458bd6695..da57ffa573 100644 --- a/src/ripple/rpc/handlers/AccountObjects.cpp +++ b/src/ripple/rpc/handlers/AccountObjects.cpp @@ -28,7 +28,7 @@ namespace ripple { -/** General RPC command that can retrieve objects in the account root. +/** General RPC command that can retrieve objects in the account root. { account: | account_index: // optional, defaults to 0 @@ -57,8 +57,8 @@ Json::Value doAccountObjects (RPC::Context& context) auto const strIdent = params[jss::account].asString (); auto iIndex = context.params.isMember (jss::account_index) ? context.params[jss::account_index].asUInt () : 0; - auto jv = RPC::accountFromString (ledger, raAccount, bIndex, - strIdent, iIndex, false, context.netOps); + auto jv = RPC::accountFromString ( + raAccount, bIndex, strIdent, iIndex, false); if (! jv.empty ()) { for (auto it = jv.begin (); it != jv.end (); ++it) @@ -100,7 +100,7 @@ Json::Value doAccountObjects (RPC::Context& context) { return t.first == filter; }); if (iter == types->end ()) return RPC::invalid_field_error (jss::type); - + type = iter->second; } @@ -120,7 +120,7 @@ Json::Value doAccountObjects (RPC::Context& context) std::min (limit, RPC::Tuning::maxObjectsPerRequest)); } } - + uint256 dirIndex; uint256 entryIndex; if (params.isMember (jss::marker)) @@ -128,7 +128,7 @@ Json::Value doAccountObjects (RPC::Context& context) auto const& marker = params[jss::marker]; if (! marker.isString ()) return RPC::expected_field_error (jss::marker, "string"); - + std::stringstream ss (marker.asString ()); std::string s; if (!std::getline(ss, s, ',')) @@ -139,7 +139,7 @@ Json::Value doAccountObjects (RPC::Context& context) if (! std::getline (ss, s, ',')) return RPC::invalid_field_error (jss::marker); - + if (! entryIndex.SetHex (s)) return RPC::invalid_field_error (jss::marker); } @@ -150,7 +150,7 @@ Json::Value doAccountObjects (RPC::Context& context) return RPC::invalid_field_error (jss::marker); } - result[jss::account] = raAccount.humanAccountID (); + result[jss::account] = raAccount.humanAccountID (); context.loadType = Resource::feeMediumBurdenRPC; return result; } diff --git a/src/ripple/rpc/handlers/AccountOffers.cpp b/src/ripple/rpc/handlers/AccountOffers.cpp index 74bd5477e2..bdce38bcf3 100644 --- a/src/ripple/rpc/handlers/AccountOffers.cpp +++ b/src/ripple/rpc/handlers/AccountOffers.cpp @@ -47,8 +47,8 @@ Json::Value doAccountOffers (RPC::Context& context) int const iIndex (bIndex ? params[jss::account_index].asUInt () : 0); RippleAddress rippleAddress; - Json::Value const jv (RPC::accountFromString (ledger, rippleAddress, bIndex, - strIdent, iIndex, false, context.netOps)); + Json::Value const jv = RPC::accountFromString ( + rippleAddress, bIndex, strIdent, iIndex, false); if (! jv.empty ()) { for (Json::Value::const_iterator it (jv.begin ()); it != jv.end (); ++it) diff --git a/src/ripple/rpc/handlers/NoRippleCheck.cpp b/src/ripple/rpc/handlers/NoRippleCheck.cpp index 1f26177290..edc7953d30 100644 --- a/src/ripple/rpc/handlers/NoRippleCheck.cpp +++ b/src/ripple/rpc/handlers/NoRippleCheck.cpp @@ -96,8 +96,8 @@ Json::Value doNoRippleCheck (RPC::Context& context) int iIndex (bIndex ? params[jss::account_index].asUInt () : 0); RippleAddress rippleAddress; - Json::Value const jv (RPC::accountFromString (ledger, rippleAddress, bIndex, - strIdent, iIndex, false, context.netOps)); + Json::Value const jv = RPC::accountFromString ( + rippleAddress, bIndex, strIdent, iIndex, false); if (! jv.empty ()) { for (Json::Value::const_iterator it (jv.begin ()); it != jv.end (); ++it) diff --git a/src/ripple/rpc/handlers/OwnerInfo.cpp b/src/ripple/rpc/handlers/OwnerInfo.cpp index 0096d0ca56..c87736d8e9 100644 --- a/src/ripple/rpc/handlers/OwnerInfo.cpp +++ b/src/ripple/rpc/handlers/OwnerInfo.cpp @@ -46,26 +46,22 @@ Json::Value doOwnerInfo (RPC::Context& context) auto const& closedLedger = context.netOps.getClosedLedger (); Json::Value jAccepted = RPC::accountFromString ( - closedLedger, raAccount, bIndex, strIdent, iIndex, - false, - context.netOps); + false); ret[jss::accepted] = jAccepted.empty () ? context.netOps.getOwnerInfo ( closedLedger, raAccount) : jAccepted; auto const& currentLedger = context.netOps.getCurrentLedger (); Json::Value jCurrent = RPC::accountFromString ( - currentLedger, raAccount, bIndex, strIdent, iIndex, - false, - context.netOps); + false); ret[jss::current] = jCurrent.empty () ? context.netOps.getOwnerInfo ( currentLedger, raAccount) : jCurrent; diff --git a/src/ripple/rpc/impl/AccountFromString.cpp b/src/ripple/rpc/impl/AccountFromString.cpp index cb6b09a389..cb4ae6f24f 100644 --- a/src/ripple/rpc/impl/AccountFromString.cpp +++ b/src/ripple/rpc/impl/AccountFromString.cpp @@ -29,13 +29,11 @@ namespace RPC { // // Returns a Json::objectValue, containing error information if there was one. Json::Value accountFromString ( - Ledger::ref lrLedger, RippleAddress& naAccount, bool& bIndex, std::string const& strIdent, int const iIndex, - bool const bStrict, - NetworkOPs& netOps) + bool const bStrict) { RippleAddress naSeed; diff --git a/src/ripple/rpc/impl/AccountFromString.h b/src/ripple/rpc/impl/AccountFromString.h index d4654355c4..130c7f2384 100644 --- a/src/ripple/rpc/impl/AccountFromString.h +++ b/src/ripple/rpc/impl/AccountFromString.h @@ -27,13 +27,11 @@ namespace ripple { namespace RPC { Json::Value accountFromString ( - Ledger::ref lrLedger, RippleAddress& naAccount, bool& bIndex, std::string const& strIdent, - const int iIndex, - const bool bStrict, - NetworkOPs& netOps); + int iIndex, + bool bStrict); } // RPC } // ripple