mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-23 07:10:53 +00:00
refactor: Use more scoped enums (#7086)
This commit is contained in:
@@ -146,17 +146,17 @@ rpf(jtx::Account const& src,
|
||||
std::optional<PathAsset> const& srcAsset,
|
||||
std::optional<AccountID> const& srcIssuer)
|
||||
{
|
||||
json::Value jv = json::ObjectValue;
|
||||
json::Value jv = json::ValueType::Object;
|
||||
jv[jss::command] = "ripple_path_find";
|
||||
jv[jss::source_account] = toBase58(src);
|
||||
jv[jss::destination_account] = toBase58(dst);
|
||||
jv[jss::destination_amount] = dstAmount.getJson(JsonOptions::KNone);
|
||||
jv[jss::destination_amount] = dstAmount.getJson(JsonOptions::Values::None);
|
||||
if (sendMax)
|
||||
jv[jss::send_max] = sendMax->getJson(JsonOptions::KNone);
|
||||
jv[jss::send_max] = sendMax->getJson(JsonOptions::Values::None);
|
||||
if (srcAsset)
|
||||
{
|
||||
auto& sc = jv[jss::source_currencies] = json::ArrayValue;
|
||||
json::Value j = json::ObjectValue;
|
||||
auto& sc = jv[jss::source_currencies] = json::ValueType::Array;
|
||||
json::Value j = json::ValueType::Object;
|
||||
addSourceAsset(j, *srcAsset, srcIssuer);
|
||||
sc.append(j);
|
||||
}
|
||||
@@ -210,18 +210,18 @@ findPathsRequest(
|
||||
{},
|
||||
{}};
|
||||
|
||||
json::Value params = json::ObjectValue;
|
||||
json::Value params = json::ValueType::Object;
|
||||
params[jss::command] = "ripple_path_find";
|
||||
params[jss::source_account] = toBase58(src);
|
||||
params[jss::destination_account] = toBase58(dst);
|
||||
params[jss::destination_amount] = saDstAmount.getJson(JsonOptions::KNone);
|
||||
params[jss::destination_amount] = saDstAmount.getJson(JsonOptions::Values::None);
|
||||
if (saSendMax)
|
||||
params[jss::send_max] = saSendMax->getJson(JsonOptions::KNone);
|
||||
params[jss::send_max] = saSendMax->getJson(JsonOptions::Values::None);
|
||||
|
||||
if (srcAsset)
|
||||
{
|
||||
auto& sc = params[jss::source_currencies] = json::ArrayValue;
|
||||
json::Value j = json::ObjectValue;
|
||||
auto& sc = params[jss::source_currencies] = json::ValueType::Array;
|
||||
json::Value j = json::ValueType::Object;
|
||||
addSourceAsset(j, *srcAsset, srcIssuer);
|
||||
sc.append(j);
|
||||
}
|
||||
@@ -434,7 +434,7 @@ ledgerEntryState(Env& env, Account const& acctA, Account const& acctB, std::stri
|
||||
json::Value jvParams;
|
||||
jvParams[jss::ledger_index] = "current";
|
||||
jvParams[jss::ripple_state][jss::currency] = currency;
|
||||
jvParams[jss::ripple_state][jss::accounts] = json::ArrayValue;
|
||||
jvParams[jss::ripple_state][jss::accounts] = json::ValueType::Array;
|
||||
jvParams[jss::ripple_state][jss::accounts].append(acctA.human());
|
||||
jvParams[jss::ripple_state][jss::accounts].append(acctB.human());
|
||||
return env.rpc("json", "ledger_entry", to_string(jvParams))[jss::result];
|
||||
@@ -499,7 +499,7 @@ create(
|
||||
jv[jss::TransactionType] = jss::PaymentChannelCreate;
|
||||
jv[jss::Account] = to_string(account);
|
||||
jv[jss::Destination] = to_string(to);
|
||||
jv[jss::Amount] = amount.getJson(JsonOptions::KNone);
|
||||
jv[jss::Amount] = amount.getJson(JsonOptions::Values::None);
|
||||
jv[jss::SettleDelay] = settleDelay.count();
|
||||
jv[sfPublicKey.fieldName] = strHex(pk.slice());
|
||||
if (cancelAfter)
|
||||
@@ -520,7 +520,7 @@ fund(
|
||||
jv[jss::TransactionType] = jss::PaymentChannelFund;
|
||||
jv[jss::Account] = to_string(account);
|
||||
jv[sfChannel.fieldName] = to_string(channel);
|
||||
jv[jss::Amount] = amount.getJson(JsonOptions::KNone);
|
||||
jv[jss::Amount] = amount.getJson(JsonOptions::Values::None);
|
||||
if (expiration)
|
||||
jv[sfExpiration.fieldName] = expiration->time_since_epoch().count();
|
||||
return jv;
|
||||
@@ -540,9 +540,9 @@ claim(
|
||||
jv[jss::Account] = to_string(account);
|
||||
jv["Channel"] = to_string(channel);
|
||||
if (amount)
|
||||
jv[jss::Amount] = amount->getJson(JsonOptions::KNone);
|
||||
jv[jss::Amount] = amount->getJson(JsonOptions::Values::None);
|
||||
if (balance)
|
||||
jv["Balance"] = balance->getJson(JsonOptions::KNone);
|
||||
jv["Balance"] = balance->getJson(JsonOptions::Values::None);
|
||||
if (signature)
|
||||
jv["Signature"] = strHex(*signature);
|
||||
if (pk)
|
||||
@@ -760,7 +760,7 @@ coverDeposit(
|
||||
jv[sfTransactionType] = jss::LoanBrokerCoverDeposit;
|
||||
jv[sfAccount] = to_string(account);
|
||||
jv[sfLoanBrokerID] = to_string(brokerID);
|
||||
jv[sfAmount] = amount.getJson(JsonOptions::KNone);
|
||||
jv[sfAmount] = amount.getJson(JsonOptions::Values::None);
|
||||
jv[sfFlags] = flags;
|
||||
return jv;
|
||||
}
|
||||
@@ -776,7 +776,7 @@ coverWithdraw(
|
||||
jv[sfTransactionType] = jss::LoanBrokerCoverWithdraw;
|
||||
jv[sfAccount] = to_string(account);
|
||||
jv[sfLoanBrokerID] = to_string(brokerID);
|
||||
jv[sfAmount] = amount.getJson(JsonOptions::KNone);
|
||||
jv[sfAmount] = amount.getJson(JsonOptions::Values::None);
|
||||
jv[sfFlags] = flags;
|
||||
return jv;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user