mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-22 23:00:55 +00:00
refactor: Use more scoped enums (#7086)
This commit is contained in:
@@ -25,23 +25,20 @@ class CaptureLogs : public Logs
|
||||
std::stringstream& strm_;
|
||||
|
||||
public:
|
||||
CaptureSink(
|
||||
beast::severities::Severity threshold,
|
||||
std::mutex& mutex,
|
||||
std::stringstream& strm)
|
||||
CaptureSink(beast::Severity threshold, std::mutex& mutex, std::stringstream& strm)
|
||||
: beast::Journal::Sink(threshold, false), strmMutex_(mutex), strm_(strm)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
write(beast::severities::Severity level, std::string const& text) override
|
||||
write(beast::Severity level, std::string const& text) override
|
||||
{
|
||||
std::scoped_lock const lock(strmMutex_);
|
||||
strm_ << text;
|
||||
}
|
||||
|
||||
void
|
||||
writeAlways(beast::severities::Severity level, std::string const& text) override
|
||||
writeAlways(beast::Severity level, std::string const& text) override
|
||||
{
|
||||
std::scoped_lock const lock(strmMutex_);
|
||||
strm_ << text;
|
||||
@@ -49,7 +46,7 @@ class CaptureLogs : public Logs
|
||||
};
|
||||
|
||||
public:
|
||||
explicit CaptureLogs(std::string* pResult) : Logs(beast::severities::KInfo), pResult_(pResult)
|
||||
explicit CaptureLogs(std::string* pResult) : Logs(beast::Severity::Info), pResult_(pResult)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -59,7 +56,7 @@ public:
|
||||
}
|
||||
|
||||
std::unique_ptr<beast::Journal::Sink>
|
||||
makeSink(std::string const& partition, beast::severities::Severity threshold) override
|
||||
makeSink(std::string const& partition, beast::Severity threshold) override
|
||||
{
|
||||
return std::make_unique<CaptureSink>(threshold, strmMutex_, strm_);
|
||||
}
|
||||
|
||||
@@ -16,20 +16,20 @@ class CheckMessageLogs : public Logs
|
||||
CheckMessageLogs& owner_;
|
||||
|
||||
public:
|
||||
CheckMessageSink(beast::severities::Severity threshold, CheckMessageLogs& owner)
|
||||
CheckMessageSink(beast::Severity threshold, CheckMessageLogs& owner)
|
||||
: beast::Journal::Sink(threshold, false), owner_(owner)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
write(beast::severities::Severity level, std::string const& text) override
|
||||
write(beast::Severity level, std::string const& text) override
|
||||
{
|
||||
if (text.find(owner_.msg_) != std::string::npos)
|
||||
*owner_.pFound_ = true;
|
||||
}
|
||||
|
||||
void
|
||||
writeAlways(beast::severities::Severity level, std::string const& text) override
|
||||
writeAlways(beast::Severity level, std::string const& text) override
|
||||
{
|
||||
write(level, text);
|
||||
}
|
||||
@@ -43,12 +43,12 @@ public:
|
||||
found
|
||||
*/
|
||||
CheckMessageLogs(std::string msg, bool* pFound)
|
||||
: Logs{beast::severities::KDebug}, msg_{std::move(msg)}, pFound_{pFound}
|
||||
: Logs{beast::Severity::Debug}, msg_{std::move(msg)}, pFound_{pFound}
|
||||
{
|
||||
}
|
||||
|
||||
std::unique_ptr<beast::Journal::Sink>
|
||||
makeSink(std::string const& partition, beast::severities::Severity threshold) override
|
||||
makeSink(std::string const& partition, beast::Severity threshold) override
|
||||
{
|
||||
return std::make_unique<CheckMessageSink>(threshold, *this);
|
||||
}
|
||||
|
||||
@@ -103,15 +103,14 @@ class SuiteLogs : public Logs
|
||||
beast::unit_test::Suite& suite_;
|
||||
|
||||
public:
|
||||
explicit SuiteLogs(beast::unit_test::Suite& suite)
|
||||
: Logs(beast::severities::KError), suite_(suite)
|
||||
explicit SuiteLogs(beast::unit_test::Suite& suite) : Logs(beast::Severity::Error), suite_(suite)
|
||||
{
|
||||
}
|
||||
|
||||
~SuiteLogs() override = default;
|
||||
|
||||
std::unique_ptr<beast::Journal::Sink>
|
||||
makeSink(std::string const& partition, beast::severities::Severity threshold) override
|
||||
makeSink(std::string const& partition, beast::Severity threshold) override
|
||||
{
|
||||
return std::make_unique<SuiteJournalSink>(partition, threshold, suite_);
|
||||
}
|
||||
@@ -155,7 +154,7 @@ private:
|
||||
beast::unit_test::Suite& suite,
|
||||
std::unique_ptr<Config> config,
|
||||
std::unique_ptr<Logs> logs,
|
||||
beast::severities::Severity thresh);
|
||||
beast::Severity thresh);
|
||||
~AppBundle();
|
||||
};
|
||||
|
||||
@@ -188,7 +187,7 @@ public:
|
||||
std::unique_ptr<Config> config,
|
||||
FeatureBitset features,
|
||||
std::unique_ptr<Logs> logs = nullptr,
|
||||
beast::severities::Severity thresh = beast::severities::KError)
|
||||
beast::Severity thresh = beast::Severity::Error)
|
||||
: test(suite)
|
||||
, bundle_(suite, std::move(config), std::move(logs), thresh)
|
||||
, journal{bundle_.app->getJournal("Env")}
|
||||
@@ -235,7 +234,7 @@ public:
|
||||
Env(beast::unit_test::Suite& suite,
|
||||
std::unique_ptr<Config> config,
|
||||
std::unique_ptr<Logs> logs = nullptr,
|
||||
beast::severities::Severity thresh = beast::severities::KError)
|
||||
beast::Severity thresh = beast::Severity::Error)
|
||||
: Env(suite, std::move(config), testableAmendments(), std::move(logs), thresh)
|
||||
{
|
||||
}
|
||||
@@ -249,8 +248,7 @@ public:
|
||||
*
|
||||
* @param suite the current unit_test::suite
|
||||
*/
|
||||
Env(beast::unit_test::Suite& suite,
|
||||
beast::severities::Severity thresh = beast::severities::KError)
|
||||
Env(beast::unit_test::Suite& suite, beast::Severity thresh = beast::Severity::Error)
|
||||
: Env(suite, envconfig(), nullptr, thresh)
|
||||
{
|
||||
}
|
||||
@@ -606,7 +604,7 @@ public:
|
||||
void
|
||||
signAndSubmit(
|
||||
JTx const& jt,
|
||||
json::Value params = json::NullValue,
|
||||
json::Value params = json::ValueType::Null,
|
||||
std::source_location const& loc = std::source_location::current());
|
||||
|
||||
/** Check expected postconditions
|
||||
|
||||
@@ -27,7 +27,7 @@ private:
|
||||
}
|
||||
|
||||
void
|
||||
operator()(json::Value const& params = json::NullValue)
|
||||
operator()(json::Value const& params = json::ValueType::Null)
|
||||
{
|
||||
env_.signAndSubmit(jt_, params, loc_);
|
||||
}
|
||||
|
||||
@@ -397,7 +397,7 @@ public:
|
||||
Serializer s;
|
||||
jt.stx->add(s);
|
||||
|
||||
json::Value args{json::ObjectValue};
|
||||
json::Value args{json::ValueType::Object};
|
||||
|
||||
args[jss::tx_blob] = strHex(s.slice());
|
||||
args[jss::fail_hard] = true;
|
||||
@@ -715,7 +715,7 @@ public:
|
||||
}
|
||||
|
||||
{
|
||||
auto params = json::Value(json::NullValue);
|
||||
auto params = json::Value(json::ValueType::Null);
|
||||
envs(noop(alice), Fee(kNONE), Seq(kNONE))(params);
|
||||
|
||||
// Make sure we get the right account back.
|
||||
@@ -728,7 +728,7 @@ public:
|
||||
}
|
||||
|
||||
{
|
||||
auto params = json::Value(json::ObjectValue);
|
||||
auto params = json::Value(json::ValueType::Object);
|
||||
// Force the factor low enough to fail
|
||||
params[jss::fee_mult_max] = 1;
|
||||
params[jss::fee_div_max] = 2;
|
||||
@@ -867,7 +867,7 @@ public:
|
||||
return cfg;
|
||||
}),
|
||||
nullptr,
|
||||
beast::severities::KDisabled};
|
||||
beast::Severity::Disabled};
|
||||
});
|
||||
pass();
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ TestPath::addHelper(First&& first, Rest&&... rest)
|
||||
inline json::Value
|
||||
TestPath::json() const
|
||||
{
|
||||
return path.getJson(JsonOptions::KNone);
|
||||
return path.getJson(JsonOptions::Values::None);
|
||||
}
|
||||
|
||||
class PathSet
|
||||
@@ -170,7 +170,7 @@ public:
|
||||
json() const
|
||||
{
|
||||
json::Value v;
|
||||
v["Paths"] = paths.getJson(JsonOptions::KNone);
|
||||
v["Paths"] = paths.getJson(JsonOptions::Values::None);
|
||||
return v;
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
struct Uint256Field : public JTxField<SF_UINT256, uint256, std::string>
|
||||
struct UInt256Field : public JTxField<SF_UINT256, uint256, std::string>
|
||||
{
|
||||
using SF = SF_UINT256;
|
||||
using SV = uint256;
|
||||
@@ -112,7 +112,7 @@ protected:
|
||||
using base::value_;
|
||||
|
||||
public:
|
||||
explicit Uint256Field(SF const& sfield, SV const& value) : JTxField(sfield, value)
|
||||
explicit UInt256Field(SF const& sfield, SV const& value) : JTxField(sfield, value)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ public:
|
||||
[[nodiscard]] OV
|
||||
value() const override
|
||||
{
|
||||
return value_.getJson(JsonOptions::KNone);
|
||||
return value_.getJson(JsonOptions::Values::None);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -714,7 +714,7 @@ create(A const& account, A const& dest, STAmount const& sendMax)
|
||||
{
|
||||
json::Value jv;
|
||||
jv[sfAccount.jsonName] = to_string(account);
|
||||
jv[sfSendMax.jsonName] = sendMax.getJson(JsonOptions::KNone);
|
||||
jv[sfSendMax.jsonName] = sendMax.getJson(JsonOptions::Values::None);
|
||||
jv[sfDestination.jsonName] = to_string(dest);
|
||||
jv[sfTransactionType.jsonName] = jss::CheckCreate;
|
||||
return jv;
|
||||
@@ -856,7 +856,7 @@ coverWithdraw(
|
||||
json::Value
|
||||
coverClawback(AccountID const& account, std::uint32_t flags = 0);
|
||||
|
||||
auto const kLOAN_BROKER_ID = JTxFieldWrapper<Uint256Field>(sfLoanBrokerID);
|
||||
auto const kLOAN_BROKER_ID = JTxFieldWrapper<UInt256Field>(sfLoanBrokerID);
|
||||
|
||||
auto const kMANAGEMENT_FEE_RATE =
|
||||
valueUnitWrapper<SF_UINT16, unit::TenthBipsTag>(sfManagementFeeRate);
|
||||
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
auto wsc = makeWSClient(env.app().config());
|
||||
{
|
||||
json::Value jv;
|
||||
jv["streams"] = json::ArrayValue;
|
||||
jv["streams"] = json::ValueType::Array;
|
||||
jv["streams"].append("ledger");
|
||||
}
|
||||
env.fund(XRP(10000), "alice");
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
void
|
||||
operator()(jtx::Env&, jtx::JTx& jtx) const
|
||||
{
|
||||
auto& arr(jtx.jv[sfCredentialIDs.jsonName] = json::ArrayValue);
|
||||
auto& arr(jtx.jv[sfCredentialIDs.jsonName] = json::ValueType::Array);
|
||||
for (auto const& hash : credentials_)
|
||||
arr.append(hash);
|
||||
}
|
||||
|
||||
@@ -141,8 +141,8 @@ AMM::createJv(
|
||||
{
|
||||
json::Value jv;
|
||||
jv[jss::Account] = to_string(account);
|
||||
jv[jss::Amount] = asset1.getJson(JsonOptions::KNone);
|
||||
jv[jss::Amount2] = asset2.getJson(JsonOptions::KNone);
|
||||
jv[jss::Amount] = asset1.getJson(JsonOptions::Values::None);
|
||||
jv[jss::Amount2] = asset2.getJson(JsonOptions::Values::None);
|
||||
jv[jss::TradingFee] = tfee;
|
||||
jv[jss::TransactionType] = jss::AMMCreate;
|
||||
|
||||
@@ -199,14 +199,14 @@ AMM::ammRpcInfo(
|
||||
if (asset1 || asset2)
|
||||
{
|
||||
if (asset1)
|
||||
jv[jss::asset] = STIssue(sfAsset, *asset1).getJson(JsonOptions::KNone);
|
||||
jv[jss::asset] = STIssue(sfAsset, *asset1).getJson(JsonOptions::Values::None);
|
||||
if (asset2)
|
||||
jv[jss::asset2] = STIssue(sfAsset2, *asset2).getJson(JsonOptions::KNone);
|
||||
jv[jss::asset2] = STIssue(sfAsset2, *asset2).getJson(JsonOptions::Values::None);
|
||||
}
|
||||
else if (!ammAccount)
|
||||
{
|
||||
jv[jss::asset] = STIssue(sfAsset, asset1_.asset()).getJson(JsonOptions::KNone);
|
||||
jv[jss::asset2] = STIssue(sfAsset2, asset2_.asset()).getJson(JsonOptions::KNone);
|
||||
jv[jss::asset] = STIssue(sfAsset, asset1_.asset()).getJson(JsonOptions::Values::None);
|
||||
jv[jss::asset2] = STIssue(sfAsset2, asset2_.asset()).getJson(JsonOptions::Values::None);
|
||||
}
|
||||
if (ammAccount)
|
||||
jv[jss::amm_account] = to_string(*ammAccount);
|
||||
@@ -217,7 +217,7 @@ AMM::ammRpcInfo(
|
||||
: env_.rpc(apiVersion, "json", "amm_info", to_string(jv)));
|
||||
if (jr.isObject() && jr.isMember(jss::result) && jr[jss::result].isMember(jss::status))
|
||||
return jr[jss::result];
|
||||
return json::NullValue;
|
||||
return json::ValueType::Null;
|
||||
}
|
||||
|
||||
std::tuple<STAmount, STAmount, STAmount>
|
||||
@@ -374,13 +374,13 @@ AMM::setTokens(json::Value& jv, std::optional<std::pair<Asset, Asset>> const& as
|
||||
{
|
||||
if (assets)
|
||||
{
|
||||
jv[jss::Asset] = STIssue(sfAsset, assets->first).getJson(JsonOptions::KNone);
|
||||
jv[jss::Asset2] = STIssue(sfAsset, assets->second).getJson(JsonOptions::KNone);
|
||||
jv[jss::Asset] = STIssue(sfAsset, assets->first).getJson(JsonOptions::Values::None);
|
||||
jv[jss::Asset2] = STIssue(sfAsset, assets->second).getJson(JsonOptions::Values::None);
|
||||
}
|
||||
else
|
||||
{
|
||||
jv[jss::Asset] = STIssue(sfAsset, asset1_.asset()).getJson(JsonOptions::KNone);
|
||||
jv[jss::Asset2] = STIssue(sfAsset, asset2_.asset()).getJson(JsonOptions::KNone);
|
||||
jv[jss::Asset] = STIssue(sfAsset, asset1_.asset()).getJson(JsonOptions::Values::None);
|
||||
jv[jss::Asset2] = STIssue(sfAsset, asset2_.asset()).getJson(JsonOptions::Values::None);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -392,8 +392,8 @@ AMM::depositJv(DepositArg const& arg)
|
||||
Throw<std::runtime_error>("AMM::depositJv: account or assets not set");
|
||||
|
||||
jv[jss::Account] = arg.account->human();
|
||||
jv[jss::Asset] = STIssue(sfAsset, arg.assets->first).getJson(JsonOptions::KNone);
|
||||
jv[jss::Asset2] = STIssue(sfAsset, arg.assets->second).getJson(JsonOptions::KNone);
|
||||
jv[jss::Asset] = STIssue(sfAsset, arg.assets->first).getJson(JsonOptions::Values::None);
|
||||
jv[jss::Asset2] = STIssue(sfAsset, arg.assets->second).getJson(JsonOptions::Values::None);
|
||||
if (arg.tokens)
|
||||
arg.tokens->tokens().setJson(jv[jss::LPTokenOut]);
|
||||
if (arg.asset1In)
|
||||
@@ -538,8 +538,8 @@ AMM::withdrawJv(WithdrawArg const& arg)
|
||||
if (!arg.account || !arg.assets)
|
||||
Throw<std::runtime_error>("AMM::withdrawJv: account or assets not set");
|
||||
jv[jss::Account] = arg.account->human();
|
||||
jv[jss::Asset] = STIssue(sfAsset, arg.assets->first).getJson(JsonOptions::KNone);
|
||||
jv[jss::Asset2] = STIssue(sfAsset, arg.assets->second).getJson(JsonOptions::KNone);
|
||||
jv[jss::Asset] = STIssue(sfAsset, arg.assets->first).getJson(JsonOptions::Values::None);
|
||||
jv[jss::Asset2] = STIssue(sfAsset, arg.assets->second).getJson(JsonOptions::Values::None);
|
||||
if (arg.tokens)
|
||||
arg.tokens->tokens().setJson(jv[jss::LPTokenIn]);
|
||||
if (arg.asset1Out)
|
||||
@@ -674,8 +674,8 @@ AMM::voteJv(VoteArg const& arg)
|
||||
if (!arg.account || !arg.assets)
|
||||
Throw<std::runtime_error>("AMM::withdrawJv: account or assets not set");
|
||||
jv[jss::Account] = arg.account->human();
|
||||
jv[jss::Asset] = STIssue(sfAsset, arg.assets->first).getJson(JsonOptions::KNone);
|
||||
jv[jss::Asset2] = STIssue(sfAsset, arg.assets->second).getJson(JsonOptions::KNone);
|
||||
jv[jss::Asset] = STIssue(sfAsset, arg.assets->first).getJson(JsonOptions::Values::None);
|
||||
jv[jss::Asset2] = STIssue(sfAsset, arg.assets->second).getJson(JsonOptions::Values::None);
|
||||
jv[jss::TradingFee] = arg.tfee;
|
||||
if (arg.flags)
|
||||
jv[jss::Flags] = *arg.flags;
|
||||
@@ -758,7 +758,7 @@ AMM::bid(BidArg const& arg)
|
||||
}
|
||||
if (!arg.authAccounts.empty())
|
||||
{
|
||||
json::Value accounts(json::ArrayValue);
|
||||
json::Value accounts(json::ValueType::Array);
|
||||
for (auto const& account : arg.authAccounts)
|
||||
{
|
||||
json::Value acct;
|
||||
@@ -875,8 +875,8 @@ AMM::deleteJv(AccountID const& account, Asset const& asset1, Asset const& asset2
|
||||
{
|
||||
json::Value jv;
|
||||
jv[jss::Account] = to_string(account);
|
||||
jv[jss::Asset] = STIssue(sfAsset, asset1).getJson(JsonOptions::KNone);
|
||||
jv[jss::Asset2] = STIssue(sfAsset, asset2).getJson(JsonOptions::KNone);
|
||||
jv[jss::Asset] = STIssue(sfAsset, asset1).getJson(JsonOptions::Values::None);
|
||||
jv[jss::Asset2] = STIssue(sfAsset, asset2).getJson(JsonOptions::Values::None);
|
||||
|
||||
jv[jss::TransactionType] = jss::AMMDelete;
|
||||
|
||||
@@ -909,7 +909,7 @@ ammClawback(
|
||||
jv[jss::Asset] = toJson(asset);
|
||||
jv[jss::Asset2] = toJson(asset2);
|
||||
if (amount)
|
||||
jv[jss::Amount] = amount->getJson(JsonOptions::KNone);
|
||||
jv[jss::Amount] = amount->getJson(JsonOptions::Values::None);
|
||||
|
||||
return jv;
|
||||
}
|
||||
|
||||
@@ -73,19 +73,19 @@ Env::AppBundle::AppBundle(
|
||||
beast::unit_test::Suite& suite,
|
||||
std::unique_ptr<Config> config,
|
||||
std::unique_ptr<Logs> logs,
|
||||
beast::severities::Severity thresh)
|
||||
beast::Severity thresh)
|
||||
: AppBundle()
|
||||
{
|
||||
using namespace beast::severities;
|
||||
using beast::Severity;
|
||||
if (logs)
|
||||
{
|
||||
setDebugLogSink(logs->makeSink("Debug", KFatal));
|
||||
setDebugLogSink(logs->makeSink("Debug", Severity::Fatal));
|
||||
}
|
||||
else
|
||||
{
|
||||
logs = std::make_unique<SuiteLogs>(suite);
|
||||
// Use kFatal threshold to reduce noise from STObject.
|
||||
setDebugLogSink(std::make_unique<SuiteJournalSink>("Debug", KFatal, suite));
|
||||
setDebugLogSink(std::make_unique<SuiteJournalSink>("Debug", Severity::Fatal, suite));
|
||||
}
|
||||
auto tk = std::make_unique<ManualTimeKeeper>();
|
||||
timeKeeper = tk.get();
|
||||
|
||||
@@ -124,7 +124,7 @@ public:
|
||||
}
|
||||
if (params)
|
||||
{
|
||||
json::Value& ja = jr[jss::params] = json::ArrayValue;
|
||||
json::Value& ja = jr[jss::params] = json::ValueType::Array;
|
||||
ja.append(params);
|
||||
}
|
||||
req.body() = to_string(jr);
|
||||
|
||||
@@ -167,7 +167,7 @@ Oracle::aggregatePrice(
|
||||
std::optional<AnyValue> const& timeThreshold)
|
||||
{
|
||||
json::Value jv;
|
||||
json::Value jvOracles(json::ArrayValue);
|
||||
json::Value jvOracles(json::ValueType::Array);
|
||||
if (oracles)
|
||||
{
|
||||
for (auto const& id : *oracles)
|
||||
@@ -205,7 +205,7 @@ Oracle::aggregatePrice(
|
||||
return jr;
|
||||
}
|
||||
}
|
||||
return json::NullValue;
|
||||
return json::ValueType::Null;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -269,7 +269,7 @@ Oracle::set(UpdateArg const& arg)
|
||||
duration_cast<seconds>(env_.current()->header().closeTime.time_since_epoch()).count() +
|
||||
kEPOCH_OFFSET.count());
|
||||
}
|
||||
json::Value dataSeries(json::ArrayValue);
|
||||
json::Value dataSeries(json::ValueType::Array);
|
||||
auto assetToStr = [](std::string const& s) {
|
||||
// assume standard currency
|
||||
if (s.size() == 3)
|
||||
@@ -361,7 +361,7 @@ Oracle::ledgerEntry(
|
||||
if (jr.isMember(jss::result) && jr[jss::result].isMember(jss::status))
|
||||
return jr[jss::result];
|
||||
}
|
||||
return json::NullValue;
|
||||
return json::ValueType::Null;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ outer(jtx::Account const& account, uint32_t seq, STAmount const& fee, std::uint3
|
||||
json::Value jv;
|
||||
jv[jss::TransactionType] = jss::Batch;
|
||||
jv[jss::Account] = account.human();
|
||||
jv[jss::RawTransactions] = json::Value{json::ArrayValue};
|
||||
jv[jss::RawTransactions] = json::Value{json::ValueType::Array};
|
||||
jv[jss::Sequence] = seq;
|
||||
jv[jss::Flags] = flags;
|
||||
jv[jss::Fee] = to_string(fee);
|
||||
|
||||
@@ -16,7 +16,7 @@ cash(jtx::Account const& dest, uint256 const& checkId, STAmount const& amount)
|
||||
{
|
||||
json::Value jv;
|
||||
jv[sfAccount.jsonName] = dest.human();
|
||||
jv[sfAmount.jsonName] = amount.getJson(JsonOptions::KNone);
|
||||
jv[sfAmount.jsonName] = amount.getJson(JsonOptions::Values::None);
|
||||
jv[sfCheckID.jsonName] = to_string(checkId);
|
||||
jv[sfTransactionType.jsonName] = jss::CheckCash;
|
||||
return jv;
|
||||
@@ -28,7 +28,7 @@ cash(jtx::Account const& dest, uint256 const& checkId, DeliverMin const& atLeast
|
||||
{
|
||||
json::Value jv;
|
||||
jv[sfAccount.jsonName] = dest.human();
|
||||
jv[sfDeliverMin.jsonName] = atLeast.value.getJson(JsonOptions::KNone);
|
||||
jv[sfDeliverMin.jsonName] = atLeast.value.getJson(JsonOptions::Values::None);
|
||||
jv[sfCheckID.jsonName] = to_string(checkId);
|
||||
jv[sfTransactionType.jsonName] = jss::CheckCash;
|
||||
return jv;
|
||||
|
||||
@@ -22,7 +22,7 @@ set(jtx::Account const& account,
|
||||
jv[jss::TransactionType] = jss::DelegateSet;
|
||||
jv[jss::Account] = account.human();
|
||||
jv[sfAuthorize.jsonName] = authorize.human();
|
||||
json::Value permissionsJson(json::ArrayValue);
|
||||
json::Value permissionsJson(json::ValueType::Array);
|
||||
for (auto const& permission : permissions)
|
||||
{
|
||||
json::Value permissionValue;
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace xrpl::test::jtx {
|
||||
void
|
||||
DeliverMin::operator()(Env& env, JTx& jt) const
|
||||
{
|
||||
jt.jv[jss::DeliverMin] = amount_.getJson(JsonOptions::KNone);
|
||||
jt.jv[jss::DeliverMin] = amount_.getJson(JsonOptions::Values::None);
|
||||
}
|
||||
|
||||
} // namespace xrpl::test::jtx
|
||||
|
||||
@@ -39,7 +39,7 @@ authCredentials(jtx::Account const& account, std::vector<AuthorizeCredentials> c
|
||||
{
|
||||
json::Value jv;
|
||||
jv[sfAccount.jsonName] = account.human();
|
||||
jv[sfAuthorizeCredentials.jsonName] = json::ArrayValue;
|
||||
jv[sfAuthorizeCredentials.jsonName] = json::ValueType::Array;
|
||||
auto& arr(jv[sfAuthorizeCredentials.jsonName]);
|
||||
for (auto const& o : auth)
|
||||
{
|
||||
@@ -57,7 +57,7 @@ unauthCredentials(jtx::Account const& account, std::vector<AuthorizeCredentials>
|
||||
{
|
||||
json::Value jv;
|
||||
jv[sfAccount.jsonName] = account.human();
|
||||
jv[sfUnauthorizeCredentials.jsonName] = json::ArrayValue;
|
||||
jv[sfUnauthorizeCredentials.jsonName] = json::ValueType::Array;
|
||||
auto& arr(jv[sfUnauthorizeCredentials.jsonName]);
|
||||
for (auto const& o : auth)
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@ create(AccountID const& account, AccountID const& to, STAmount const& amount)
|
||||
jv[jss::Flags] = tfFullyCanonicalSig;
|
||||
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);
|
||||
return jv;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ Fee::operator()(Env& env, JTx& jt) const
|
||||
}
|
||||
else if (amount_)
|
||||
{
|
||||
jt[sfFee] = amount_->getJson(JsonOptions::KNone);
|
||||
jt[sfFee] = amount_->getJson(JsonOptions::Values::None);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ Msig::operator()(Env& env, JTx& jt) const
|
||||
}
|
||||
else if (sigObject.isNull())
|
||||
{
|
||||
sigObject = json::Value(json::ObjectValue);
|
||||
sigObject = json::Value(json::ValueType::Object);
|
||||
}
|
||||
std::optional<STObject> st;
|
||||
try
|
||||
|
||||
@@ -19,8 +19,8 @@ offer(
|
||||
{
|
||||
json::Value jv;
|
||||
jv[jss::Account] = account.human();
|
||||
jv[jss::TakerPays] = takerPays.getJson(JsonOptions::KNone);
|
||||
jv[jss::TakerGets] = takerGets.getJson(JsonOptions::KNone);
|
||||
jv[jss::TakerPays] = takerPays.getJson(JsonOptions::Values::None);
|
||||
jv[jss::TakerGets] = takerGets.getJson(JsonOptions::Values::None);
|
||||
if (flags != 0u)
|
||||
jv[jss::Flags] = flags;
|
||||
jv[jss::TransactionType] = jss::OfferCreate;
|
||||
|
||||
@@ -61,20 +61,20 @@ Paths::operator()(Env& env, JTx& jt) const
|
||||
// VFALCO TODO API to allow caller to examine the STPathSet
|
||||
// VFALCO isDefault should be renamed to empty()
|
||||
if (!found.isDefault())
|
||||
jv[jss::Paths] = found.getJson(JsonOptions::KNone);
|
||||
jv[jss::Paths] = found.getJson(JsonOptions::Values::None);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
Path::Path(STPath const& p)
|
||||
{
|
||||
jv_ = p.getJson(JsonOptions::KNone);
|
||||
jv_ = p.getJson(JsonOptions::Values::None);
|
||||
}
|
||||
|
||||
json::Value&
|
||||
Path::create()
|
||||
{
|
||||
return jv_.append(json::ObjectValue);
|
||||
return jv_.append(json::ValueType::Object);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -16,7 +16,7 @@ pay(AccountID const& account, AccountID const& to, AnyAmount amount)
|
||||
amount.to(to);
|
||||
json::Value jv;
|
||||
jv[jss::Account] = to_string(account);
|
||||
jv[jss::Amount] = amount.value.getJson(JsonOptions::KNone);
|
||||
jv[jss::Amount] = amount.value.getJson(JsonOptions::Values::None);
|
||||
jv[jss::Destination] = to_string(to);
|
||||
jv[jss::TransactionType] = jss::Payment;
|
||||
jv[jss::Flags] = tfFullyCanonicalSig;
|
||||
|
||||
@@ -35,10 +35,10 @@ setTx(AccountID const& account, Credentials const& credentials, std::optional<ui
|
||||
if (domain)
|
||||
jv[sfDomainID] = to_string(*domain);
|
||||
|
||||
json::Value acceptedCredentials(json::ArrayValue);
|
||||
json::Value acceptedCredentials(json::ValueType::Array);
|
||||
for (auto const& credential : credentials)
|
||||
{
|
||||
json::Value object(json::ObjectValue);
|
||||
json::Value object(json::ValueType::Object);
|
||||
object[sfCredential] = credential.toJson();
|
||||
acceptedCredentials.append(std::move(object));
|
||||
}
|
||||
@@ -51,7 +51,7 @@ setTx(AccountID const& account, Credentials const& credentials, std::optional<ui
|
||||
json::Value
|
||||
deleteTx(AccountID const& account, uint256 const& domain)
|
||||
{
|
||||
json::Value jv{json::ObjectValue};
|
||||
json::Value jv{json::ValueType::Object};
|
||||
jv[sfTransactionType] = jss::PermissionedDomainDelete;
|
||||
jv[sfAccount] = to_string(account);
|
||||
jv[sfDomainID] = to_string(domain);
|
||||
@@ -69,7 +69,7 @@ getObjects(Account const& account, Env& env, bool withType)
|
||||
params[jss::type] = jss::permissioned_domain;
|
||||
|
||||
auto const& resp = env.rpc("json", "account_objects", to_string(params));
|
||||
json::Value objects(json::ArrayValue);
|
||||
json::Value objects(json::ValueType::Array);
|
||||
objects = resp[jss::result][jss::account_objects];
|
||||
for (auto const& object : objects)
|
||||
{
|
||||
@@ -120,11 +120,11 @@ credentialsFromJson(
|
||||
std::unordered_map<std::string, Account> const& human2Acc)
|
||||
{
|
||||
Credentials ret;
|
||||
json::Value credentials(json::ArrayValue);
|
||||
json::Value credentials(json::ValueType::Array);
|
||||
credentials = object["AcceptedCredentials"];
|
||||
for (auto const& credential : credentials)
|
||||
{
|
||||
json::Value obj(json::ObjectValue);
|
||||
json::Value obj(json::ValueType::Object);
|
||||
obj = credential[jss::Credential];
|
||||
auto const& issuer = obj[jss::Issuer];
|
||||
auto const& credentialType = obj["CredentialType"];
|
||||
@@ -150,8 +150,8 @@ uint256
|
||||
getNewDomain(std::shared_ptr<STObject const> const& meta)
|
||||
{
|
||||
uint256 ret;
|
||||
auto metaJson = meta->getJson(JsonOptions::KNone);
|
||||
json::Value a(json::ArrayValue);
|
||||
auto metaJson = meta->getJson(JsonOptions::Values::None);
|
||||
json::Value a(json::ValueType::Array);
|
||||
a = metaJson["AffectedNodes"];
|
||||
|
||||
for (auto const& node : a)
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace xrpl::test::jtx {
|
||||
void
|
||||
Sendmax::operator()(Env& env, JTx& jt) const
|
||||
{
|
||||
jt.jv[jss::SendMax] = amount_.getJson(JsonOptions::KNone);
|
||||
jt.jv[jss::SendMax] = amount_.getJson(JsonOptions::Values::None);
|
||||
}
|
||||
|
||||
} // namespace xrpl::test::jtx
|
||||
|
||||
@@ -50,7 +50,7 @@ Uri::operator()(Env& env, JTx& jt) const
|
||||
void
|
||||
Amount::operator()(Env& env, JTx& jt) const
|
||||
{
|
||||
jt.jv[sfAmount.jsonName] = amount_.getJson(JsonOptions::KNone);
|
||||
jt.jv[sfAmount.jsonName] = amount_.getJson(JsonOptions::Values::None);
|
||||
}
|
||||
|
||||
uint256
|
||||
@@ -98,7 +98,7 @@ createOffer(jtx::Account const& account, uint256 const& nftokenID, STAmount cons
|
||||
json::Value jv;
|
||||
jv[sfAccount.jsonName] = account.human();
|
||||
jv[sfNFTokenID.jsonName] = to_string(nftokenID);
|
||||
jv[sfAmount.jsonName] = amount.getJson(JsonOptions::KNone);
|
||||
jv[sfAmount.jsonName] = amount.getJson(JsonOptions::Values::None);
|
||||
jv[jss::TransactionType] = jss::NFTokenCreateOffer;
|
||||
return jv;
|
||||
}
|
||||
@@ -129,7 +129,7 @@ cancelOfferImpl(jtx::Account const& account, T const& nftokenOffers)
|
||||
jv[sfAccount.jsonName] = account.human();
|
||||
if (!empty(nftokenOffers))
|
||||
{
|
||||
jv[sfNFTokenOffers.jsonName] = json::ArrayValue;
|
||||
jv[sfNFTokenOffers.jsonName] = json::ValueType::Array;
|
||||
for (uint256 const& nftokenOffer : nftokenOffers)
|
||||
jv[sfNFTokenOffers.jsonName].append(to_string(nftokenOffer));
|
||||
}
|
||||
@@ -192,7 +192,7 @@ brokerOffers(
|
||||
void
|
||||
BrokerFee::operator()(Env& env, JTx& jt) const
|
||||
{
|
||||
jt.jv[sfNFTokenBrokerFee.jsonName] = brokerFee_.getJson(JsonOptions::KNone);
|
||||
jt.jv[sfNFTokenBrokerFee.jsonName] = brokerFee_.getJson(JsonOptions::Values::None);
|
||||
}
|
||||
|
||||
json::Value
|
||||
|
||||
@@ -21,7 +21,7 @@ trust(Account const& account, STAmount const& amount, std::uint32_t flags)
|
||||
Throw<std::runtime_error>("trust() requires IOU");
|
||||
json::Value jv;
|
||||
jv[jss::Account] = account.human();
|
||||
jv[jss::LimitAmount] = amount.getJson(JsonOptions::KNone);
|
||||
jv[jss::LimitAmount] = amount.getJson(JsonOptions::Values::None);
|
||||
jv[jss::TransactionType] = jss::TrustSet;
|
||||
jv[jss::Flags] = flags;
|
||||
return jv;
|
||||
@@ -39,7 +39,7 @@ trust(Account const& account, STAmount const& amount, Account const& peer, std::
|
||||
json::Value jv;
|
||||
jv[jss::Account] = account.human();
|
||||
{
|
||||
auto& ja = jv[jss::LimitAmount] = amount.getJson(JsonOptions::KNone);
|
||||
auto& ja = jv[jss::LimitAmount] = amount.getJson(JsonOptions::Values::None);
|
||||
ja[jss::issuer] = peer.human();
|
||||
}
|
||||
jv[jss::TransactionType] = jss::TrustSet;
|
||||
@@ -52,7 +52,7 @@ claw(Account const& account, STAmount const& amount, std::optional<Account> cons
|
||||
{
|
||||
json::Value jv;
|
||||
jv[jss::Account] = account.human();
|
||||
jv[jss::Amount] = amount.getJson(JsonOptions::KNone);
|
||||
jv[jss::Amount] = amount.getJson(JsonOptions::Values::None);
|
||||
jv[jss::TransactionType] = jss::Clawback;
|
||||
|
||||
if (mptHolder)
|
||||
|
||||
@@ -77,7 +77,7 @@ fillSeq(json::Value& jv, ReadView const& view)
|
||||
json::Value
|
||||
cmdToJSONRPC(std::vector<std::string> const& args, beast::Journal j, unsigned int apiVersion)
|
||||
{
|
||||
json::Value jv = json::Value(json::ObjectValue);
|
||||
json::Value jv = json::Value(json::ValueType::Object);
|
||||
auto const paramsObj = rpcCmdToJson(args, jv, apiVersion, j);
|
||||
|
||||
// Re-use jv to return our formatted result.
|
||||
@@ -89,7 +89,7 @@ cmdToJSONRPC(std::vector<std::string> const& args, beast::Journal j, unsigned in
|
||||
// If paramsObj is not empty, put it in a [params] array.
|
||||
if (paramsObj.begin() != paramsObj.end())
|
||||
{
|
||||
auto& paramsArray = jv[jss::params] = json::ArrayValue;
|
||||
auto& paramsArray = jv[jss::params] = json::ValueType::Array;
|
||||
paramsArray.append(paramsObj);
|
||||
}
|
||||
if (paramsObj.isMember(jss::jsonrpc))
|
||||
|
||||
@@ -70,9 +70,12 @@ bridgeCreate(
|
||||
|
||||
jv[jss::Account] = acc.human();
|
||||
jv[sfXChainBridge.getJsonName()] = bridge;
|
||||
jv[sfSignatureReward.getJsonName()] = reward.getJson(JsonOptions::KNone);
|
||||
jv[sfSignatureReward.getJsonName()] = reward.getJson(JsonOptions::Values::None);
|
||||
if (minAccountCreate)
|
||||
jv[sfMinAccountCreateAmount.getJsonName()] = minAccountCreate->getJson(JsonOptions::KNone);
|
||||
{
|
||||
jv[sfMinAccountCreateAmount.getJsonName()] =
|
||||
minAccountCreate->getJson(JsonOptions::Values::None);
|
||||
}
|
||||
|
||||
jv[jss::TransactionType] = jss::XChainCreateBridge;
|
||||
return jv;
|
||||
@@ -90,9 +93,12 @@ bridgeModify(
|
||||
jv[jss::Account] = acc.human();
|
||||
jv[sfXChainBridge.getJsonName()] = bridge;
|
||||
if (reward)
|
||||
jv[sfSignatureReward.getJsonName()] = reward->getJson(JsonOptions::KNone);
|
||||
jv[sfSignatureReward.getJsonName()] = reward->getJson(JsonOptions::Values::None);
|
||||
if (minAccountCreate)
|
||||
jv[sfMinAccountCreateAmount.getJsonName()] = minAccountCreate->getJson(JsonOptions::KNone);
|
||||
{
|
||||
jv[sfMinAccountCreateAmount.getJsonName()] =
|
||||
minAccountCreate->getJson(JsonOptions::Values::None);
|
||||
}
|
||||
|
||||
jv[jss::TransactionType] = jss::XChainModifyBridge;
|
||||
return jv;
|
||||
@@ -109,7 +115,7 @@ xchainCreateClaimId(
|
||||
|
||||
jv[jss::Account] = acc.human();
|
||||
jv[sfXChainBridge.getJsonName()] = bridge;
|
||||
jv[sfSignatureReward.getJsonName()] = reward.getJson(JsonOptions::KNone);
|
||||
jv[sfSignatureReward.getJsonName()] = reward.getJson(JsonOptions::Values::None);
|
||||
jv[sfOtherChainSource.getJsonName()] = otherChainSource.human();
|
||||
|
||||
jv[jss::TransactionType] = jss::XChainCreateClaimID;
|
||||
@@ -129,7 +135,7 @@ xchainCommit(
|
||||
jv[jss::Account] = acc.human();
|
||||
jv[sfXChainBridge.getJsonName()] = bridge;
|
||||
jv[sfXChainClaimID.getJsonName()] = claimID;
|
||||
jv[jss::Amount] = amt.value.getJson(JsonOptions::KNone);
|
||||
jv[jss::Amount] = amt.value.getJson(JsonOptions::Values::None);
|
||||
if (dst)
|
||||
jv[sfOtherChainDestination.getJsonName()] = dst->human();
|
||||
|
||||
@@ -151,7 +157,7 @@ xchainClaim(
|
||||
jv[sfXChainBridge.getJsonName()] = bridge;
|
||||
jv[sfXChainClaimID.getJsonName()] = claimID;
|
||||
jv[sfDestination.getJsonName()] = dst.human();
|
||||
jv[sfAmount.getJsonName()] = amt.value.getJson(JsonOptions::KNone);
|
||||
jv[sfAmount.getJsonName()] = amt.value.getJson(JsonOptions::Values::None);
|
||||
|
||||
jv[jss::TransactionType] = jss::XChainClaim;
|
||||
return jv;
|
||||
@@ -170,8 +176,8 @@ sidechainXchainAccountCreate(
|
||||
jv[sfAccount.getJsonName()] = acc.human();
|
||||
jv[sfXChainBridge.getJsonName()] = bridge;
|
||||
jv[sfDestination.getJsonName()] = dst.human();
|
||||
jv[sfAmount.getJsonName()] = amt.value.getJson(JsonOptions::KNone);
|
||||
jv[sfSignatureReward.getJsonName()] = reward.value.getJson(JsonOptions::KNone);
|
||||
jv[sfAmount.getJsonName()] = amt.value.getJson(JsonOptions::Values::None);
|
||||
jv[sfSignatureReward.getJsonName()] = reward.value.getJson(JsonOptions::Values::None);
|
||||
|
||||
jv[jss::TransactionType] = jss::XChainAccountCreateCommit;
|
||||
return jv;
|
||||
@@ -213,11 +219,11 @@ claimAttestation(
|
||||
result[sfPublicKey.getJsonName()] = strHex(pk.slice());
|
||||
result[sfSignature.getJsonName()] = strHex(sig);
|
||||
result[sfOtherChainSource.getJsonName()] = toBase58(sendingAccount);
|
||||
result[sfAmount.getJsonName()] = sendingAmount.value.getJson(JsonOptions::KNone);
|
||||
result[sfAmount.getJsonName()] = sendingAmount.value.getJson(JsonOptions::Values::None);
|
||||
result[sfAttestationRewardAccount.getJsonName()] = toBase58(rewardAccount);
|
||||
result[sfWasLockingChainSend.getJsonName()] = wasLockingChainSend ? 1 : 0;
|
||||
|
||||
result[sfXChainClaimID.getJsonName()] = STUInt64{claimID}.getJson(JsonOptions::KNone);
|
||||
result[sfXChainClaimID.getJsonName()] = STUInt64{claimID}.getJson(JsonOptions::Values::None);
|
||||
if (dst)
|
||||
result[sfDestination.getJsonName()] = toBase58(*dst);
|
||||
|
||||
@@ -264,14 +270,14 @@ createAccountAttestation(
|
||||
result[sfPublicKey.getJsonName()] = strHex(pk.slice());
|
||||
result[sfSignature.getJsonName()] = strHex(sig);
|
||||
result[sfOtherChainSource.getJsonName()] = toBase58(sendingAccount);
|
||||
result[sfAmount.getJsonName()] = sendingAmount.value.getJson(JsonOptions::KNone);
|
||||
result[sfAmount.getJsonName()] = sendingAmount.value.getJson(JsonOptions::Values::None);
|
||||
result[sfAttestationRewardAccount.getJsonName()] = toBase58(rewardAccount);
|
||||
result[sfWasLockingChainSend.getJsonName()] = wasLockingChainSend ? 1 : 0;
|
||||
|
||||
result[sfXChainAccountCreateCount.getJsonName()] =
|
||||
STUInt64{createCount}.getJson(JsonOptions::KNone);
|
||||
STUInt64{createCount}.getJson(JsonOptions::Values::None);
|
||||
result[sfDestination.getJsonName()] = toBase58(dst);
|
||||
result[sfSignatureReward.getJsonName()] = rewardAmount.value.getJson(JsonOptions::KNone);
|
||||
result[sfSignatureReward.getJsonName()] = rewardAmount.value.getJson(JsonOptions::Values::None);
|
||||
|
||||
result[jss::TransactionType] = jss::XChainAddAccountCreateAttestation;
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ private:
|
||||
};
|
||||
|
||||
template <class T, class... Args>
|
||||
Path::Path(T const& t, Args const&... args) : jv_(json::ArrayValue)
|
||||
Path::Path(T const& t, Args const&... args) : jv_(json::ValueType::Array)
|
||||
{
|
||||
append(t, args...);
|
||||
}
|
||||
|
||||
@@ -220,12 +220,12 @@ struct XChainBridgeObjects
|
||||
[[nodiscard]] json::Value
|
||||
createBridge(
|
||||
Account const& acc,
|
||||
json::Value const& bridge = json::NullValue,
|
||||
json::Value const& bridge = json::ValueType::Null,
|
||||
STAmount const& reward = XRP(1),
|
||||
std::optional<STAmount> const& minAccountCreate = std::nullopt) const
|
||||
{
|
||||
return bridgeCreate(
|
||||
acc, bridge == json::NullValue ? jvb : bridge, reward, minAccountCreate);
|
||||
acc, bridge == json::ValueType::Null ? jvb : bridge, reward, minAccountCreate);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user