mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Modify RPC and transactions to use quality flags for ripple.
This commit is contained in:
@@ -1316,15 +1316,15 @@ Json::Value RPCServer::doPeers(const Json::Value& params)
|
||||
}
|
||||
|
||||
// ripple <regular_seed> <paying_account>
|
||||
// <source_max> <source_currency> [<source_issuerID>] // XXX [noredeem] [noissue]
|
||||
// <source_max> <source_currency> [<source_issuerID>]
|
||||
// <path>+
|
||||
// full|partial <dest_account> <dest_amount> <dest_currency> [<dest_issuerID>]
|
||||
// full|partial limit|average <dest_account> <dest_amount> <dest_currency> [<dest_issuerID>]
|
||||
//
|
||||
// path:
|
||||
// path <path_element>+
|
||||
//
|
||||
// path_element:
|
||||
// account <accountID> [<currency>] [<issuerID>] [noredeem] [noissue]
|
||||
// account <accountID> [<currency>] [<issuerID>]
|
||||
// offer <currency> [<issuerID>]
|
||||
Json::Value RPCServer::doRipple(const Json::Value ¶ms)
|
||||
{
|
||||
@@ -1333,10 +1333,10 @@ Json::Value RPCServer::doRipple(const Json::Value ¶ms)
|
||||
uint160 uSrcCurrencyID;
|
||||
NewcoinAddress naSrcAccountID;
|
||||
NewcoinAddress naSrcIssuerID;
|
||||
bool bSrcRedeem = true;
|
||||
bool bSrcIssue = true;
|
||||
bool bPartial;
|
||||
bool bFull;
|
||||
bool bLimit;
|
||||
bool bAverage;
|
||||
NewcoinAddress naDstAccountID;
|
||||
STAmount saDstAmount;
|
||||
uint160 uDstCurrencyID;
|
||||
@@ -1366,18 +1366,6 @@ Json::Value RPCServer::doRipple(const Json::Value ¶ms)
|
||||
|
||||
int iArg = 4 + naSrcIssuerID.isValid();
|
||||
|
||||
if (params[iArg].asString() == "noredeem") // [noredeem]
|
||||
{
|
||||
++iArg;
|
||||
bSrcRedeem = false;
|
||||
}
|
||||
|
||||
if (params[iArg].asString() == "noissue") // [noissue]
|
||||
{
|
||||
++iArg;
|
||||
bSrcIssue = false;
|
||||
}
|
||||
|
||||
// XXX bSrcRedeem & bSrcIssue not used.
|
||||
STPath spPath;
|
||||
|
||||
@@ -1417,8 +1405,6 @@ Json::Value RPCServer::doRipple(const Json::Value ¶ms)
|
||||
NewcoinAddress naAccountID;
|
||||
uint160 uCurrencyID;
|
||||
NewcoinAddress naIssuerID;
|
||||
bool bRedeem = true;
|
||||
bool bIssue = true;
|
||||
|
||||
++iArg;
|
||||
|
||||
@@ -1437,24 +1423,10 @@ Json::Value RPCServer::doRipple(const Json::Value ¶ms)
|
||||
++iArg;
|
||||
}
|
||||
|
||||
if (params.size() != iArg && params[iArg].asString() == "noredeem") // [noredeem]
|
||||
{
|
||||
++iArg;
|
||||
bRedeem = false;
|
||||
}
|
||||
|
||||
if (params.size() != iArg && params[iArg].asString() == "noissue") // [noissue]
|
||||
{
|
||||
++iArg;
|
||||
bIssue = false;
|
||||
}
|
||||
|
||||
spPath.addElement(STPathElement(
|
||||
naAccountID.getAccountID(),
|
||||
uCurrencyID,
|
||||
naIssuerID.isValid() ? naIssuerID.getAccountID() : uint160(0),
|
||||
bRedeem,
|
||||
bIssue));
|
||||
naIssuerID.isValid() ? naIssuerID.getAccountID() : uint160(0)));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1486,6 +1458,19 @@ Json::Value RPCServer::doRipple(const Json::Value ¶ms)
|
||||
++iArg;
|
||||
}
|
||||
|
||||
// limit|average
|
||||
bLimit = params.size() != iArg ? params[iArg].asString() == "limit" : false;
|
||||
bAverage = params.size() != iArg ? params[iArg].asString() == "average" : false;
|
||||
|
||||
if (!bPartial && !bFull)
|
||||
{
|
||||
return RPCError(rpcINVALID_PARAMS);
|
||||
}
|
||||
else
|
||||
{
|
||||
++iArg;
|
||||
}
|
||||
|
||||
if (params.size() != iArg && !naDstAccountID.setAccountID(params[iArg++].asString())) // <dest_account>
|
||||
{
|
||||
return RPCError(rpcDST_ACT_MALFORMED);
|
||||
@@ -1543,7 +1528,9 @@ Json::Value RPCServer::doRipple(const Json::Value ¶ms)
|
||||
naDstAccountID,
|
||||
saDstAmount,
|
||||
saSrcAmountMax,
|
||||
spsPaths);
|
||||
spsPaths,
|
||||
bPartial,
|
||||
bLimit);
|
||||
|
||||
trans = mNetOps->submitTransaction(trans);
|
||||
|
||||
@@ -2564,7 +2551,7 @@ Json::Value RPCServer::doCommand(const std::string& command, Json::Value& params
|
||||
{ "password_fund", &RPCServer::doPasswordFund, 2, 3, false, optCurrent },
|
||||
{ "password_set", &RPCServer::doPasswordSet, 2, 3, false, optNetwork },
|
||||
{ "peers", &RPCServer::doPeers, 0, 0, true },
|
||||
{ "ripple", &RPCServer::doRipple, 8, -1, false, optCurrent|optClosed },
|
||||
{ "ripple", &RPCServer::doRipple, 9, -1, false, optCurrent|optClosed },
|
||||
{ "ripple_lines_get", &RPCServer::doRippleLinesGet, 1, 2, false, optCurrent },
|
||||
{ "ripple_line_set", &RPCServer::doRippleLineSet, 4, 7, false, optCurrent },
|
||||
{ "send", &RPCServer::doSend, 3, 9, false, optCurrent },
|
||||
|
||||
Reference in New Issue
Block a user