Remove unused parameters to accountFromString.

This commit is contained in:
Tom Ritchford
2015-06-08 16:00:13 -04:00
committed by Nik Bougalis
parent f237187b0d
commit c2814308f1
9 changed files with 26 additions and 34 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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>|<account_public_key>
account_index: <integer> // 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;
}

View File

@@ -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)

View File

@@ -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)

View File

@@ -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;

View File

@@ -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;

View File

@@ -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