mirror of
https://github.com/XRPLF/clio.git
synced 2025-12-06 17:27:58 +00:00
@@ -38,33 +38,33 @@
|
||||
struct AsyncAsioContextTest : virtual public NoLoggerFixture {
|
||||
AsyncAsioContextTest()
|
||||
{
|
||||
work.emplace(ctx); // make sure ctx does not stop on its own
|
||||
runner.emplace([&] { ctx.run(); });
|
||||
work_.emplace(ctx_); // make sure ctx does not stop on its own
|
||||
runner_.emplace([&] { ctx_.run(); });
|
||||
}
|
||||
|
||||
~AsyncAsioContextTest() override
|
||||
{
|
||||
work.reset();
|
||||
if (runner->joinable())
|
||||
runner->join();
|
||||
ctx.stop();
|
||||
work_.reset();
|
||||
if (runner_->joinable())
|
||||
runner_->join();
|
||||
ctx_.stop();
|
||||
}
|
||||
|
||||
void
|
||||
stop()
|
||||
{
|
||||
work.reset();
|
||||
if (runner->joinable())
|
||||
runner->join();
|
||||
ctx.stop();
|
||||
work_.reset();
|
||||
if (runner_->joinable())
|
||||
runner_->join();
|
||||
ctx_.stop();
|
||||
}
|
||||
|
||||
protected:
|
||||
boost::asio::io_context ctx;
|
||||
boost::asio::io_context ctx_;
|
||||
|
||||
private:
|
||||
std::optional<boost::asio::io_service::work> work;
|
||||
std::optional<std::thread> runner;
|
||||
std::optional<boost::asio::io_service::work> work_;
|
||||
std::optional<std::thread> runner_;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -85,7 +85,7 @@ struct SyncAsioContextTest : virtual public NoLoggerFixture {
|
||||
if (allowMockLeak)
|
||||
testing::Mock::AllowLeak(&call);
|
||||
|
||||
spawn(ctx, [&, _ = make_work_guard(ctx)](yield_context yield) {
|
||||
spawn(ctx_, [&, _ = make_work_guard(ctx_)](yield_context yield) {
|
||||
f(yield);
|
||||
call.Call();
|
||||
});
|
||||
@@ -97,17 +97,17 @@ struct SyncAsioContextTest : virtual public NoLoggerFixture {
|
||||
void
|
||||
runContext()
|
||||
{
|
||||
ctx.run();
|
||||
ctx.reset();
|
||||
ctx_.run();
|
||||
ctx_.reset();
|
||||
}
|
||||
|
||||
void
|
||||
runContextFor(std::chrono::milliseconds duration)
|
||||
{
|
||||
ctx.run_for(duration);
|
||||
ctx.reset();
|
||||
ctx_.run_for(duration);
|
||||
ctx_.reset();
|
||||
}
|
||||
|
||||
protected:
|
||||
boost::asio::io_context ctx;
|
||||
boost::asio::io_context ctx_;
|
||||
};
|
||||
|
||||
@@ -31,8 +31,8 @@ namespace tests::util {
|
||||
uint32_t
|
||||
generateFreePort()
|
||||
{
|
||||
boost::asio::io_context io_context;
|
||||
tcp::acceptor acceptor(io_context);
|
||||
boost::asio::io_context ioContext;
|
||||
tcp::acceptor acceptor(ioContext);
|
||||
tcp::endpoint const endpoint(tcp::v4(), 0);
|
||||
|
||||
acceptor.open(endpoint.protocol());
|
||||
|
||||
@@ -37,9 +37,9 @@
|
||||
|
||||
namespace {
|
||||
|
||||
constinit auto const Seq = 30;
|
||||
constinit auto const kSEQ = 30;
|
||||
|
||||
constinit auto const TxnHex =
|
||||
constinit auto const kTXN_HEX =
|
||||
"1200192200000008240011CC9B201B001F71D6202A0000000168400000"
|
||||
"000000000C7321ED475D1452031E8F9641AF1631519A58F7B8681E172E"
|
||||
"4838AA0E59408ADA1727DD74406960041F34F10E0CBB39444B4D4E577F"
|
||||
@@ -48,7 +48,7 @@ constinit auto const TxnHex =
|
||||
"677265677765697362726F642E636F6D81146203F49C21D5D6E022CB16"
|
||||
"DE3538F248662FC73C";
|
||||
|
||||
constinit auto const TxnMeta =
|
||||
constinit auto const kTXN_META =
|
||||
"201C00000001F8E511005025001F71B3556ED9C9459001E4F4A9121F4E"
|
||||
"07AB6D14898A5BBEF13D85C25D743540DB59F3CF566203F49C21D5D6E0"
|
||||
"22CB16DE3538F248662FC73CFFFFFFFFFFFFFFFFFFFFFFFFE6FAEC5A00"
|
||||
@@ -147,7 +147,7 @@ constinit auto const TxnMeta =
|
||||
"066240000002540BE3E081146203F49C21D5D6E022CB16DE3538F24866"
|
||||
"2FC73CE1E1F1031000";
|
||||
|
||||
constinit auto const RawHeader =
|
||||
constinit auto const kRAW_HEADER =
|
||||
"03C3141A01633CD656F91B4EBB5EB89B791BD34DBC8A04BB6F407C5335BC54351E"
|
||||
"DD733898497E809E04074D14D271E4832D7888754F9230800761563A292FA2315A"
|
||||
"6DB6FE30CC5909B285080FCD6773CC883F9FE0EE4D439340AC592AADB973ED3CF5"
|
||||
@@ -159,27 +159,27 @@ constinit auto const RawHeader =
|
||||
namespace util {
|
||||
|
||||
std::pair<std::string, std::string>
|
||||
CreateNftTxAndMetaBlobs()
|
||||
createNftTxAndMetaBlobs()
|
||||
{
|
||||
return {hexStringToBinaryString(TxnMeta), hexStringToBinaryString(TxnHex)};
|
||||
return {hexStringToBinaryString(kTXN_META), hexStringToBinaryString(kTXN_HEX)};
|
||||
}
|
||||
|
||||
std::pair<ripple::STTx, ripple::TxMeta>
|
||||
CreateNftTxAndMeta()
|
||||
createNftTxAndMeta()
|
||||
{
|
||||
ripple::uint256 hash;
|
||||
EXPECT_TRUE(hash.parseHex("6C7F69A6D25A13AC4A2E9145999F45D4674F939900017A96885FDC2757E9284E"));
|
||||
|
||||
auto const [metaBlob, txnBlob] = CreateNftTxAndMetaBlobs();
|
||||
auto const [metaBlob, txnBlob] = createNftTxAndMetaBlobs();
|
||||
|
||||
ripple::SerialIter it{txnBlob.data(), txnBlob.size()};
|
||||
return {ripple::STTx{it}, ripple::TxMeta{hash, Seq, metaBlob}};
|
||||
return {ripple::STTx{it}, ripple::TxMeta{hash, kSEQ, metaBlob}};
|
||||
}
|
||||
|
||||
etlng::model::Transaction
|
||||
CreateTransaction(ripple::TxType type)
|
||||
createTransaction(ripple::TxType type)
|
||||
{
|
||||
auto const [sttx, meta] = CreateNftTxAndMeta();
|
||||
auto const [sttx, meta] = createNftTxAndMeta();
|
||||
return {
|
||||
.raw = "",
|
||||
.metaRaw = "",
|
||||
@@ -192,13 +192,13 @@ CreateTransaction(ripple::TxType type)
|
||||
}
|
||||
|
||||
etlng::model::Object
|
||||
CreateObject()
|
||||
createObject()
|
||||
{
|
||||
// random object taken from initial ledger load
|
||||
static constinit auto const objKey = "B00AA769C00726371689ED66A7CF57C2502F1BF4BDFF2ACADF67A2A7B5E8960D";
|
||||
static constinit auto const objPred = "B00AA769C00726371689ED66A7CF57C2502F1BF4BDFF2ACADF67A2A7B5E8960A";
|
||||
static constinit auto const objSucc = "B00AA769C00726371689ED66A7CF57C2502F1BF4BDFF2ACADF67A2A7B5E8960F";
|
||||
static constinit auto const objBlob =
|
||||
static constinit auto const kOBJ_KEY = "B00AA769C00726371689ED66A7CF57C2502F1BF4BDFF2ACADF67A2A7B5E8960D";
|
||||
static constinit auto const kOBJ_PRED = "B00AA769C00726371689ED66A7CF57C2502F1BF4BDFF2ACADF67A2A7B5E8960A";
|
||||
static constinit auto const kOBJ_SUCC = "B00AA769C00726371689ED66A7CF57C2502F1BF4BDFF2ACADF67A2A7B5E8960F";
|
||||
static constinit auto const kOBJ_BLOB =
|
||||
"11007222002200002504270918370000000000000C4538000000000000000A554D94799200CC37EFAF45DA76704ED3CBEDBB4B4FCD"
|
||||
"56E9CBA5399EB40A7B3BEC629546DD24CDB4C0004C4A50590000000000000000000000000000000000000000000000000000000000"
|
||||
"000000000000016680000000000000004C4A505900000000000000000000000000000000368480B7780E3DCF5D062A7BB54129F42F"
|
||||
@@ -206,17 +206,17 @@ CreateObject()
|
||||
|
||||
return {
|
||||
.key = {},
|
||||
.keyRaw = hexStringToBinaryString(objKey),
|
||||
.keyRaw = hexStringToBinaryString(kOBJ_KEY),
|
||||
.data = {},
|
||||
.dataRaw = hexStringToBinaryString(objBlob),
|
||||
.successor = hexStringToBinaryString(objSucc),
|
||||
.predecessor = hexStringToBinaryString(objPred),
|
||||
.dataRaw = hexStringToBinaryString(kOBJ_BLOB),
|
||||
.successor = hexStringToBinaryString(kOBJ_SUCC),
|
||||
.predecessor = hexStringToBinaryString(kOBJ_PRED),
|
||||
.type = {},
|
||||
};
|
||||
}
|
||||
|
||||
etlng::model::BookSuccessor
|
||||
CreateSuccessor()
|
||||
createSuccessor()
|
||||
{
|
||||
return {
|
||||
.firstBook = "A000000000000000000000000000000000000000000000000000000000000000",
|
||||
@@ -225,9 +225,9 @@ CreateSuccessor()
|
||||
}
|
||||
|
||||
etlng::impl::PBLedgerResponseType
|
||||
CreateDataAndDiff()
|
||||
createDataAndDiff()
|
||||
{
|
||||
auto const rawHeaderBlob = hexStringToBinaryString(RawHeader);
|
||||
auto const rawHeaderBlob = hexStringToBinaryString(kRAW_HEADER);
|
||||
|
||||
auto res = etlng::impl::PBLedgerResponseType();
|
||||
res.set_ledger_header(rawHeaderBlob);
|
||||
@@ -236,7 +236,7 @@ CreateDataAndDiff()
|
||||
|
||||
{
|
||||
auto original = org::xrpl::rpc::v1::TransactionAndMetadata();
|
||||
auto const [metaRaw, txRaw] = CreateNftTxAndMetaBlobs();
|
||||
auto const [metaRaw, txRaw] = createNftTxAndMetaBlobs();
|
||||
original.set_transaction_blob(txRaw);
|
||||
original.set_metadata_blob(metaRaw);
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
@@ -245,7 +245,7 @@ CreateDataAndDiff()
|
||||
}
|
||||
}
|
||||
{
|
||||
auto expected = CreateObject();
|
||||
auto expected = createObject();
|
||||
auto original = org::xrpl::rpc::v1::RawLedgerObject();
|
||||
original.set_data(expected.dataRaw);
|
||||
original.set_key(expected.keyRaw);
|
||||
@@ -255,7 +255,7 @@ CreateDataAndDiff()
|
||||
}
|
||||
}
|
||||
{
|
||||
auto expected = CreateSuccessor();
|
||||
auto expected = createSuccessor();
|
||||
auto original = org::xrpl::rpc::v1::BookSuccessor();
|
||||
original.set_first_book(expected.firstBook);
|
||||
original.set_book_base(expected.bookBase);
|
||||
@@ -271,9 +271,9 @@ CreateDataAndDiff()
|
||||
}
|
||||
|
||||
etlng::impl::PBLedgerResponseType
|
||||
CreateData()
|
||||
createData()
|
||||
{
|
||||
auto const rawHeaderBlob = hexStringToBinaryString(RawHeader);
|
||||
auto const rawHeaderBlob = hexStringToBinaryString(kRAW_HEADER);
|
||||
|
||||
auto res = etlng::impl::PBLedgerResponseType();
|
||||
res.set_ledger_header(rawHeaderBlob);
|
||||
@@ -282,7 +282,7 @@ CreateData()
|
||||
|
||||
{
|
||||
auto original = org::xrpl::rpc::v1::TransactionAndMetadata();
|
||||
auto const [metaRaw, txRaw] = CreateNftTxAndMetaBlobs();
|
||||
auto const [metaRaw, txRaw] = createNftTxAndMetaBlobs();
|
||||
original.set_transaction_blob(txRaw);
|
||||
original.set_metadata_blob(metaRaw);
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
|
||||
@@ -33,24 +33,24 @@
|
||||
namespace util {
|
||||
|
||||
[[maybe_unused, nodiscard]] std::pair<std::string, std::string>
|
||||
CreateNftTxAndMetaBlobs();
|
||||
createNftTxAndMetaBlobs();
|
||||
|
||||
[[maybe_unused, nodiscard]] std::pair<ripple::STTx, ripple::TxMeta>
|
||||
CreateNftTxAndMeta();
|
||||
createNftTxAndMeta();
|
||||
|
||||
[[maybe_unused, nodiscard]] etlng::model::Transaction
|
||||
CreateTransaction(ripple::TxType type);
|
||||
createTransaction(ripple::TxType type);
|
||||
|
||||
[[maybe_unused, nodiscard]] etlng::model::Object
|
||||
CreateObject();
|
||||
createObject();
|
||||
|
||||
[[maybe_unused, nodiscard]] etlng::model::BookSuccessor
|
||||
CreateSuccessor();
|
||||
createSuccessor();
|
||||
|
||||
[[maybe_unused, nodiscard]] etlng::impl::PBLedgerResponseType
|
||||
CreateDataAndDiff();
|
||||
createDataAndDiff();
|
||||
|
||||
[[maybe_unused, nodiscard]] etlng::impl::PBLedgerResponseType
|
||||
CreateData();
|
||||
createData();
|
||||
|
||||
} // namespace util
|
||||
|
||||
@@ -25,6 +25,9 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
// Note: we don't control gRPC models so let's keep the fakes compatible
|
||||
// NOLINTBEGIN(readability-identifier-naming)
|
||||
|
||||
class FakeBook {
|
||||
std::string base_;
|
||||
std::string first_;
|
||||
@@ -122,13 +125,13 @@ public:
|
||||
};
|
||||
|
||||
class FakeLedgerObjects {
|
||||
std::vector<FakeLedgerObject> objects;
|
||||
std::vector<FakeLedgerObject> objects_;
|
||||
|
||||
public:
|
||||
std::vector<FakeLedgerObject>*
|
||||
mutable_objects()
|
||||
{
|
||||
return &objects;
|
||||
return &objects_;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -219,3 +222,5 @@ struct FakeFetchResponse {
|
||||
return &bookSuccessors;
|
||||
}
|
||||
};
|
||||
|
||||
// NOLINTEND(readability-identifier-naming)
|
||||
|
||||
@@ -61,8 +61,8 @@ public:
|
||||
// Simulates the `util::Logger::init(config)` call
|
||||
LoggerFixture()
|
||||
{
|
||||
static std::once_flag once_;
|
||||
std::call_once(once_, [] {
|
||||
static std::once_flag kONCE;
|
||||
std::call_once(kONCE, [] {
|
||||
boost::log::add_common_attributes();
|
||||
boost::log::register_simple_formatter_factory<util::Severity, char>("Severity");
|
||||
});
|
||||
@@ -73,16 +73,16 @@ public:
|
||||
|
||||
core->remove_all_sinks();
|
||||
boost::log::add_console_log(stream_, keywords::format = "%Channel%:%Severity% %Message%");
|
||||
auto min_severity = expr::channel_severity_filter(util::log_channel, util::log_severity);
|
||||
auto minSeverity = expr::channel_severity_filter(util::LogChannel, util::LogSeverity);
|
||||
|
||||
std::ranges::for_each(util::Logger::CHANNELS, [&min_severity](char const* channel) {
|
||||
min_severity[channel] = util::Severity::TRC;
|
||||
std::ranges::for_each(util::Logger::kCHANNELS, [&minSeverity](char const* channel) {
|
||||
minSeverity[channel] = util::Severity::TRC;
|
||||
});
|
||||
|
||||
min_severity["General"] = util::Severity::DBG;
|
||||
min_severity["Trace"] = util::Severity::TRC;
|
||||
minSeverity["General"] = util::Severity::DBG;
|
||||
minSeverity["Trace"] = util::Severity::TRC;
|
||||
|
||||
core->set_filter(min_severity);
|
||||
core->set_filter(minSeverity);
|
||||
core->set_logging_enabled(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -55,12 +55,12 @@ struct MockAmendmentCenter : public data::AmendmentCenterInterface {
|
||||
|
||||
MOCK_METHOD(data::Amendment const&, getAmendment, (data::AmendmentKey const&), (const, override));
|
||||
|
||||
MOCK_METHOD(data::Amendment const&, IndexOperator, (data::AmendmentKey const&), (const));
|
||||
MOCK_METHOD(data::Amendment const&, indexOperator, (data::AmendmentKey const&), (const));
|
||||
|
||||
data::Amendment const&
|
||||
operator[](data::AmendmentKey const& key) const override
|
||||
{
|
||||
return IndexOperator(key);
|
||||
return indexOperator(key);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -31,35 +31,35 @@
|
||||
template <template <typename> typename MockType = ::testing::NiceMock>
|
||||
struct MockBackendTestBase : virtual public NoLoggerFixture {
|
||||
class BackendProxy {
|
||||
std::shared_ptr<MockType<MockBackend>> backend =
|
||||
std::shared_ptr<MockType<MockBackend>> backend_ =
|
||||
std::make_shared<MockType<MockBackend>>(util::config::ClioConfigDefinition{{}});
|
||||
|
||||
public:
|
||||
auto
|
||||
operator->()
|
||||
{
|
||||
return backend.get();
|
||||
return backend_.get();
|
||||
}
|
||||
|
||||
operator std::shared_ptr<BackendInterface>()
|
||||
{
|
||||
return backend;
|
||||
return backend_;
|
||||
}
|
||||
|
||||
operator std::shared_ptr<BackendInterface const>() const
|
||||
{
|
||||
return backend;
|
||||
return backend_;
|
||||
}
|
||||
|
||||
MockType<MockBackend>&
|
||||
operator*()
|
||||
{
|
||||
return *backend;
|
||||
return *backend_;
|
||||
}
|
||||
};
|
||||
|
||||
protected:
|
||||
BackendProxy backend;
|
||||
BackendProxy backend_;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,5 +27,5 @@
|
||||
*/
|
||||
struct MockCountersTest : virtual public NoLoggerFixture {
|
||||
protected:
|
||||
std::shared_ptr<MockCounters> mockCountersPtr = std::make_shared<MockCounters>();
|
||||
std::shared_ptr<MockCounters> mockCountersPtr_ = std::make_shared<MockCounters>();
|
||||
};
|
||||
|
||||
@@ -33,7 +33,7 @@ struct MockETLServiceTestBase : virtual public NoLoggerFixture {
|
||||
using Mock = MockType<MockETLService>;
|
||||
|
||||
protected:
|
||||
std::shared_ptr<Mock> mockETLServicePtr = std::make_shared<Mock>();
|
||||
std::shared_ptr<Mock> mockETLServicePtr_ = std::make_shared<Mock>();
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -61,5 +61,5 @@ using MockETLServiceTestStrict = MockETLServiceTestBase<::testing::StrictMock>;
|
||||
*/
|
||||
struct MockLoadBalancerTest : virtual public NoLoggerFixture {
|
||||
protected:
|
||||
std::shared_ptr<MockLoadBalancer> mockLoadBalancerPtr = std::make_shared<MockLoadBalancer>();
|
||||
std::shared_ptr<MockLoadBalancer> mockLoadBalancerPtr_ = std::make_shared<MockLoadBalancer>();
|
||||
};
|
||||
|
||||
@@ -30,30 +30,30 @@
|
||||
template <template <typename> typename MockType = ::testing::NiceMock>
|
||||
struct MockMigrationBackendTestBase : virtual public NoLoggerFixture {
|
||||
class BackendProxy {
|
||||
std::shared_ptr<MockType<MockMigrationBackend>> backend =
|
||||
std::shared_ptr<MockType<MockMigrationBackend>> backend_ =
|
||||
std::make_shared<MockType<MockMigrationBackend>>(util::config::ClioConfigDefinition{});
|
||||
|
||||
public:
|
||||
auto
|
||||
operator->()
|
||||
{
|
||||
return backend.get();
|
||||
return backend_.get();
|
||||
}
|
||||
|
||||
operator std::shared_ptr<MockMigrationBackend>()
|
||||
{
|
||||
return backend;
|
||||
return backend_;
|
||||
}
|
||||
|
||||
operator std::shared_ptr<MockMigrationBackend const>() const
|
||||
{
|
||||
return backend;
|
||||
return backend_;
|
||||
}
|
||||
|
||||
MockType<MockMigrationBackend>&
|
||||
operator*()
|
||||
{
|
||||
return *backend;
|
||||
return *backend_;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -23,6 +23,6 @@
|
||||
|
||||
namespace tests::util {
|
||||
|
||||
static auto const NameGenerator = [](auto const& info) { return info.param.testName; };
|
||||
static auto const kNAME_GENERATOR = [](auto const& info) { return info.param.testName; };
|
||||
|
||||
} // namespace tests::util
|
||||
|
||||
@@ -32,6 +32,6 @@
|
||||
*/
|
||||
struct SyncExecutionCtxFixture : virtual public NoLoggerFixture {
|
||||
protected:
|
||||
util::async::SyncExecutionContext syncCtx;
|
||||
util::async::AnyExecutionContext ctx{syncCtx};
|
||||
util::async::SyncExecutionContext syncCtx_;
|
||||
util::async::AnyExecutionContext ctx_{syncCtx_};
|
||||
};
|
||||
|
||||
@@ -130,7 +130,7 @@ HttpSyncClient::get(
|
||||
}
|
||||
|
||||
bool
|
||||
HttpsSyncClient::verify_certificate(bool /* preverified */, boost::asio::ssl::verify_context& /* ctx */)
|
||||
HttpsSyncClient::verifyCertificate(bool /* preverified */, boost::asio::ssl::verify_context& /* ctx */)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ struct HttpSyncClient {
|
||||
|
||||
struct HttpsSyncClient {
|
||||
static bool
|
||||
verify_certificate(bool /* preverified */, boost::asio::ssl::verify_context& /* ctx */);
|
||||
verifyCertificate(bool /* preverified */, boost::asio::ssl::verify_context& /* ctx */);
|
||||
|
||||
static std::string
|
||||
syncPost(std::string const& host, std::string const& port, std::string const& body);
|
||||
|
||||
@@ -81,7 +81,7 @@ doSession(
|
||||
if (not response)
|
||||
return;
|
||||
|
||||
bool const keep_alive = response->keep_alive();
|
||||
bool const keepAlive = response->keep_alive();
|
||||
|
||||
http::message_generator messageGenerator{std::move(response).value()};
|
||||
|
||||
@@ -93,7 +93,7 @@ doSession(
|
||||
|
||||
ASSERT_FALSE(errorCode) << errorCode.message();
|
||||
|
||||
if (!keep_alive) {
|
||||
if (!keepAlive) {
|
||||
// This means we should close the connection, usually because
|
||||
// the response indicated the "Connection: close" semantic.
|
||||
return;
|
||||
|
||||
@@ -57,28 +57,30 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
constexpr static auto INDEX1 = "1B8590C01B0006EDFA9ED60296DD052DC5E90F99659B25014D08E1BC983515BC";
|
||||
namespace {
|
||||
constexpr auto kINDEX1 = "1B8590C01B0006EDFA9ED60296DD052DC5E90F99659B25014D08E1BC983515BC";
|
||||
} // namespace
|
||||
|
||||
ripple::AccountID
|
||||
GetAccountIDWithString(std::string_view id)
|
||||
getAccountIdWithString(std::string_view id)
|
||||
{
|
||||
return util::parseBase58Wrapper<ripple::AccountID>(std::string(id)).value();
|
||||
}
|
||||
|
||||
ripple::uint256
|
||||
GetAccountKey(std::string_view id)
|
||||
getAccountKey(std::string_view id)
|
||||
{
|
||||
return ripple::keylet::account(GetAccountIDWithString(id)).key;
|
||||
return ripple::keylet::account(getAccountIdWithString(id)).key;
|
||||
}
|
||||
|
||||
ripple::uint256
|
||||
GetAccountKey(ripple::AccountID const& acc)
|
||||
getAccountKey(ripple::AccountID const& acc)
|
||||
{
|
||||
return ripple::keylet::account(acc).key;
|
||||
}
|
||||
|
||||
ripple::LedgerHeader
|
||||
CreateLedgerHeader(std::string_view ledgerHash, ripple::LedgerIndex seq, std::optional<uint32_t> age)
|
||||
createLedgerHeader(std::string_view ledgerHash, ripple::LedgerIndex seq, std::optional<uint32_t> age)
|
||||
{
|
||||
using namespace std::chrono;
|
||||
|
||||
@@ -88,7 +90,7 @@ CreateLedgerHeader(std::string_view ledgerHash, ripple::LedgerIndex seq, std::op
|
||||
|
||||
if (age) {
|
||||
auto const now = duration_cast<seconds>(system_clock::now().time_since_epoch());
|
||||
auto const closeTime = (now - seconds{age.value()}).count() - rippleEpochStart;
|
||||
auto const closeTime = (now - seconds{age.value()}).count() - kRIPPLE_EPOCH_START;
|
||||
ledgerHeader.closeTime = ripple::NetClock::time_point{seconds{closeTime}};
|
||||
}
|
||||
|
||||
@@ -96,7 +98,7 @@ CreateLedgerHeader(std::string_view ledgerHash, ripple::LedgerIndex seq, std::op
|
||||
}
|
||||
|
||||
ripple::LedgerHeader
|
||||
CreateLedgerHeaderWithUnixTime(std::string_view ledgerHash, ripple::LedgerIndex seq, uint64_t closeTimeUnixStamp)
|
||||
createLedgerHeaderWithUnixTime(std::string_view ledgerHash, ripple::LedgerIndex seq, uint64_t closeTimeUnixStamp)
|
||||
{
|
||||
using namespace std::chrono;
|
||||
|
||||
@@ -104,14 +106,14 @@ CreateLedgerHeaderWithUnixTime(std::string_view ledgerHash, ripple::LedgerIndex
|
||||
ledgerHeader.hash = ripple::uint256{ledgerHash};
|
||||
ledgerHeader.seq = seq;
|
||||
|
||||
auto const closeTime = closeTimeUnixStamp - seconds{rippleEpochStart}.count();
|
||||
auto const closeTime = closeTimeUnixStamp - seconds{kRIPPLE_EPOCH_START}.count();
|
||||
ledgerHeader.closeTime = ripple::NetClock::time_point{seconds{closeTime}};
|
||||
|
||||
return ledgerHeader;
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreateLegacyFeeSettingLedgerObject(
|
||||
createLegacyFeeSettingLedgerObject(
|
||||
uint64_t base,
|
||||
uint32_t reserveInc,
|
||||
uint32_t reserveBase,
|
||||
@@ -130,7 +132,7 @@ CreateLegacyFeeSettingLedgerObject(
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreateFeeSettingLedgerObject(
|
||||
createFeeSettingLedgerObject(
|
||||
ripple::STAmount base,
|
||||
ripple::STAmount reserveInc,
|
||||
ripple::STAmount reserveBase,
|
||||
@@ -147,21 +149,21 @@ CreateFeeSettingLedgerObject(
|
||||
}
|
||||
|
||||
ripple::Blob
|
||||
CreateLegacyFeeSettingBlob(uint64_t base, uint32_t reserveInc, uint32_t reserveBase, uint32_t refFeeUnit, uint32_t flag)
|
||||
createLegacyFeeSettingBlob(uint64_t base, uint32_t reserveInc, uint32_t reserveBase, uint32_t refFeeUnit, uint32_t flag)
|
||||
{
|
||||
auto lo = CreateLegacyFeeSettingLedgerObject(base, reserveInc, reserveBase, refFeeUnit, flag);
|
||||
auto lo = createLegacyFeeSettingLedgerObject(base, reserveInc, reserveBase, refFeeUnit, flag);
|
||||
return lo.getSerializer().peekData();
|
||||
}
|
||||
|
||||
ripple::Blob
|
||||
CreateFeeSettingBlob(ripple::STAmount base, ripple::STAmount reserveInc, ripple::STAmount reserveBase, uint32_t flag)
|
||||
createFeeSettingBlob(ripple::STAmount base, ripple::STAmount reserveInc, ripple::STAmount reserveBase, uint32_t flag)
|
||||
{
|
||||
auto lo = CreateFeeSettingLedgerObject(base, reserveInc, reserveBase, flag);
|
||||
auto lo = createFeeSettingLedgerObject(base, reserveInc, reserveBase, flag);
|
||||
return lo.getSerializer().peekData();
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreatePaymentTransactionObject(
|
||||
createPaymentTransactionObject(
|
||||
std::string_view accountId1,
|
||||
std::string_view accountId2,
|
||||
int amount,
|
||||
@@ -185,7 +187,7 @@ CreatePaymentTransactionObject(
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreatePaymentTransactionMetaObject(
|
||||
createPaymentTransactionMetaObject(
|
||||
std::string_view accountId1,
|
||||
std::string_view accountId2,
|
||||
int finalBalance1,
|
||||
@@ -194,11 +196,11 @@ CreatePaymentTransactionMetaObject(
|
||||
)
|
||||
{
|
||||
ripple::STObject finalFields(ripple::sfFinalFields);
|
||||
finalFields.setAccountID(ripple::sfAccount, GetAccountIDWithString(accountId1));
|
||||
finalFields.setAccountID(ripple::sfAccount, getAccountIdWithString(accountId1));
|
||||
finalFields.setFieldAmount(ripple::sfBalance, ripple::STAmount(finalBalance1));
|
||||
|
||||
ripple::STObject finalFields2(ripple::sfFinalFields);
|
||||
finalFields2.setAccountID(ripple::sfAccount, GetAccountIDWithString(accountId2));
|
||||
finalFields2.setAccountID(ripple::sfAccount, getAccountIdWithString(accountId2));
|
||||
finalFields2.setFieldAmount(ripple::sfBalance, ripple::STAmount(finalBalance2));
|
||||
|
||||
ripple::STObject metaObj(ripple::sfTransactionMetaData);
|
||||
@@ -218,10 +220,10 @@ CreatePaymentTransactionMetaObject(
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreateDidObject(std::string_view accountId, std::string_view didDoc, std::string_view uri, std::string_view data)
|
||||
createDidObject(std::string_view accountId, std::string_view didDoc, std::string_view uri, std::string_view data)
|
||||
{
|
||||
ripple::STObject did(ripple::sfLedgerEntry);
|
||||
did.setAccountID(ripple::sfAccount, GetAccountIDWithString(accountId));
|
||||
did.setAccountID(ripple::sfAccount, getAccountIdWithString(accountId));
|
||||
did.setFieldU16(ripple::sfLedgerEntryType, ripple::ltDID);
|
||||
did.setFieldU32(ripple::sfFlags, 0);
|
||||
did.setFieldU64(ripple::sfOwnerNode, 0);
|
||||
@@ -237,7 +239,7 @@ CreateDidObject(std::string_view accountId, std::string_view didDoc, std::string
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreateAccountRootObject(
|
||||
createAccountRootObject(
|
||||
std::string_view accountId,
|
||||
uint32_t flag,
|
||||
uint32_t seq,
|
||||
@@ -251,7 +253,7 @@ CreateAccountRootObject(
|
||||
ripple::STObject accountRoot(ripple::sfAccount);
|
||||
accountRoot.setFieldU16(ripple::sfLedgerEntryType, ripple::ltACCOUNT_ROOT);
|
||||
accountRoot.setFieldU32(ripple::sfFlags, flag);
|
||||
accountRoot.setAccountID(ripple::sfAccount, GetAccountIDWithString(accountId));
|
||||
accountRoot.setAccountID(ripple::sfAccount, getAccountIdWithString(accountId));
|
||||
accountRoot.setFieldU32(ripple::sfSequence, seq);
|
||||
accountRoot.setFieldAmount(ripple::sfBalance, ripple::STAmount(balance, false));
|
||||
accountRoot.setFieldU32(ripple::sfOwnerCount, ownerCount);
|
||||
@@ -262,7 +264,7 @@ CreateAccountRootObject(
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreateCreateOfferTransactionObject(
|
||||
createCreateOfferTransactionObject(
|
||||
std::string_view accountId,
|
||||
int fee,
|
||||
uint32_t seq,
|
||||
@@ -299,7 +301,7 @@ CreateCreateOfferTransactionObject(
|
||||
}
|
||||
|
||||
ripple::Issue
|
||||
GetIssue(std::string_view currency, std::string_view issuerId)
|
||||
getIssue(std::string_view currency, std::string_view issuerId)
|
||||
{
|
||||
// standard currency
|
||||
if (currency.size() == 3) {
|
||||
@@ -314,7 +316,7 @@ GetIssue(std::string_view currency, std::string_view issuerId)
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreateMetaDataForBookChange(
|
||||
createMetaDataForBookChange(
|
||||
std::string_view currency,
|
||||
std::string_view issueId,
|
||||
uint32_t transactionIndex,
|
||||
@@ -325,7 +327,7 @@ CreateMetaDataForBookChange(
|
||||
)
|
||||
{
|
||||
ripple::STObject finalFields(ripple::sfFinalFields);
|
||||
ripple::Issue const issue1 = GetIssue(currency, issueId);
|
||||
ripple::Issue const issue1 = getIssue(currency, issueId);
|
||||
finalFields.setFieldAmount(ripple::sfTakerPays, ripple::STAmount(issue1, finalTakerPays));
|
||||
finalFields.setFieldAmount(ripple::sfTakerGets, ripple::STAmount(finalTakerGets, false));
|
||||
ripple::STObject previousFields(ripple::sfPreviousFields);
|
||||
@@ -345,7 +347,7 @@ CreateMetaDataForBookChange(
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreateMetaDataForCreateOffer(
|
||||
createMetaDataForCreateOffer(
|
||||
std::string_view currency,
|
||||
std::string_view issueId,
|
||||
uint32_t transactionIndex,
|
||||
@@ -355,7 +357,7 @@ CreateMetaDataForCreateOffer(
|
||||
)
|
||||
{
|
||||
ripple::STObject finalFields(ripple::sfNewFields);
|
||||
ripple::Issue const issue1 = GetIssue(currency, issueId);
|
||||
ripple::Issue const issue1 = getIssue(currency, issueId);
|
||||
if (reverse) {
|
||||
finalFields.setFieldAmount(ripple::sfTakerGets, ripple::STAmount(issue1, finalTakerPays));
|
||||
finalFields.setFieldAmount(ripple::sfTakerPays, ripple::STAmount(finalTakerGets, false));
|
||||
@@ -376,7 +378,7 @@ CreateMetaDataForCreateOffer(
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreateMetaDataForCancelOffer(
|
||||
createMetaDataForCancelOffer(
|
||||
std::string_view currency,
|
||||
std::string_view issueId,
|
||||
uint32_t transactionIndex,
|
||||
@@ -385,7 +387,7 @@ CreateMetaDataForCancelOffer(
|
||||
)
|
||||
{
|
||||
ripple::STObject finalFields(ripple::sfFinalFields);
|
||||
ripple::Issue const issue1 = GetIssue(currency, issueId);
|
||||
ripple::Issue const issue1 = getIssue(currency, issueId);
|
||||
finalFields.setFieldAmount(ripple::sfTakerPays, ripple::STAmount(issue1, finalTakerPays));
|
||||
finalFields.setFieldAmount(ripple::sfTakerGets, ripple::STAmount(finalTakerGets, false));
|
||||
ripple::STObject metaObj(ripple::sfTransactionMetaData);
|
||||
@@ -401,7 +403,7 @@ CreateMetaDataForCancelOffer(
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreateOwnerDirLedgerObject(std::vector<ripple::uint256> indexes, std::string_view rootIndex)
|
||||
createOwnerDirLedgerObject(std::vector<ripple::uint256> indexes, std::string_view rootIndex)
|
||||
{
|
||||
ripple::STObject ownerDir(ripple::sfLedgerEntry);
|
||||
ownerDir.setFieldU16(ripple::sfLedgerEntryType, ripple::ltDIR_NODE);
|
||||
@@ -412,7 +414,7 @@ CreateOwnerDirLedgerObject(std::vector<ripple::uint256> indexes, std::string_vie
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreatePaymentChannelLedgerObject(
|
||||
createPaymentChannelLedgerObject(
|
||||
std::string_view accountId,
|
||||
std::string_view destId,
|
||||
int amount,
|
||||
@@ -424,8 +426,8 @@ CreatePaymentChannelLedgerObject(
|
||||
{
|
||||
ripple::STObject channel(ripple::sfLedgerEntry);
|
||||
channel.setFieldU16(ripple::sfLedgerEntryType, ripple::ltPAYCHAN);
|
||||
channel.setAccountID(ripple::sfAccount, GetAccountIDWithString(accountId));
|
||||
channel.setAccountID(ripple::sfDestination, GetAccountIDWithString(destId));
|
||||
channel.setAccountID(ripple::sfAccount, getAccountIdWithString(accountId));
|
||||
channel.setAccountID(ripple::sfDestination, getAccountIdWithString(destId));
|
||||
channel.setFieldAmount(ripple::sfAmount, ripple::STAmount(amount, false));
|
||||
channel.setFieldAmount(ripple::sfBalance, ripple::STAmount(balance, false));
|
||||
channel.setFieldU32(ripple::sfSettleDelay, settleDelay);
|
||||
@@ -441,7 +443,7 @@ CreatePaymentChannelLedgerObject(
|
||||
}
|
||||
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateRippleStateLedgerObject(
|
||||
createRippleStateLedgerObject(
|
||||
std::string_view currency,
|
||||
std::string_view issuerId,
|
||||
int balance,
|
||||
@@ -457,16 +459,16 @@ CreateRippleStateLedgerObject(
|
||||
auto line = ripple::STObject(ripple::sfLedgerEntry);
|
||||
line.setFieldU16(ripple::sfLedgerEntryType, ripple::ltRIPPLE_STATE);
|
||||
line.setFieldU32(ripple::sfFlags, flag);
|
||||
line.setFieldAmount(ripple::sfBalance, ripple::STAmount(GetIssue(currency, issuerId), balance));
|
||||
line.setFieldAmount(ripple::sfHighLimit, ripple::STAmount(GetIssue(currency, highNodeAccountId), highLimit));
|
||||
line.setFieldAmount(ripple::sfLowLimit, ripple::STAmount(GetIssue(currency, lowNodeAccountId), lowLimit));
|
||||
line.setFieldAmount(ripple::sfBalance, ripple::STAmount(getIssue(currency, issuerId), balance));
|
||||
line.setFieldAmount(ripple::sfHighLimit, ripple::STAmount(getIssue(currency, highNodeAccountId), highLimit));
|
||||
line.setFieldAmount(ripple::sfLowLimit, ripple::STAmount(getIssue(currency, lowNodeAccountId), lowLimit));
|
||||
line.setFieldH256(ripple::sfPreviousTxnID, ripple::uint256{previousTxnId});
|
||||
line.setFieldU32(ripple::sfPreviousTxnLgrSeq, previousTxnSeq);
|
||||
return line;
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreateOfferLedgerObject(
|
||||
createOfferLedgerObject(
|
||||
std::string_view account,
|
||||
int takerGets,
|
||||
int takerPays,
|
||||
@@ -479,12 +481,12 @@ CreateOfferLedgerObject(
|
||||
{
|
||||
ripple::STObject offer(ripple::sfLedgerEntry);
|
||||
offer.setFieldU16(ripple::sfLedgerEntryType, ripple::ltOFFER);
|
||||
offer.setAccountID(ripple::sfAccount, GetAccountIDWithString(account));
|
||||
offer.setAccountID(ripple::sfAccount, getAccountIdWithString(account));
|
||||
offer.setFieldU32(ripple::sfSequence, 0);
|
||||
offer.setFieldU32(ripple::sfFlags, 0);
|
||||
ripple::Issue const issue1 = GetIssue(getsCurrency, getsIssueId);
|
||||
ripple::Issue const issue1 = getIssue(getsCurrency, getsIssueId);
|
||||
offer.setFieldAmount(ripple::sfTakerGets, ripple::STAmount(issue1, takerGets));
|
||||
ripple::Issue const issue2 = GetIssue(paysCurrency, paysIssueId);
|
||||
ripple::Issue const issue2 = getIssue(paysCurrency, paysIssueId);
|
||||
offer.setFieldAmount(ripple::sfTakerPays, ripple::STAmount(issue2, takerPays));
|
||||
offer.setFieldH256(ripple::sfBookDirectory, ripple::uint256{});
|
||||
offer.setFieldU64(ripple::sfBookNode, 0);
|
||||
@@ -496,11 +498,11 @@ CreateOfferLedgerObject(
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreateTicketLedgerObject(std::string_view account, uint32_t sequence)
|
||||
createTicketLedgerObject(std::string_view account, uint32_t sequence)
|
||||
{
|
||||
ripple::STObject ticket(ripple::sfLedgerEntry);
|
||||
ticket.setFieldU16(ripple::sfLedgerEntryType, ripple::ltTICKET);
|
||||
ticket.setAccountID(ripple::sfAccount, GetAccountIDWithString(account));
|
||||
ticket.setAccountID(ripple::sfAccount, getAccountIdWithString(account));
|
||||
ticket.setFieldU32(ripple::sfFlags, 0);
|
||||
ticket.setFieldU64(ripple::sfOwnerNode, 0);
|
||||
ticket.setFieldU32(ripple::sfTicketSequence, sequence);
|
||||
@@ -510,12 +512,12 @@ CreateTicketLedgerObject(std::string_view account, uint32_t sequence)
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreateEscrowLedgerObject(std::string_view account, std::string_view dest)
|
||||
createEscrowLedgerObject(std::string_view account, std::string_view dest)
|
||||
{
|
||||
ripple::STObject escrow(ripple::sfLedgerEntry);
|
||||
escrow.setFieldU16(ripple::sfLedgerEntryType, ripple::ltESCROW);
|
||||
escrow.setAccountID(ripple::sfAccount, GetAccountIDWithString(account));
|
||||
escrow.setAccountID(ripple::sfDestination, GetAccountIDWithString(dest));
|
||||
escrow.setAccountID(ripple::sfAccount, getAccountIdWithString(account));
|
||||
escrow.setAccountID(ripple::sfDestination, getAccountIdWithString(dest));
|
||||
escrow.setFieldAmount(ripple::sfAmount, ripple::STAmount(0, false));
|
||||
escrow.setFieldU64(ripple::sfOwnerNode, 0);
|
||||
escrow.setFieldH256(ripple::sfPreviousTxnID, ripple::uint256{});
|
||||
@@ -525,12 +527,12 @@ CreateEscrowLedgerObject(std::string_view account, std::string_view dest)
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreateCheckLedgerObject(std::string_view account, std::string_view dest)
|
||||
createCheckLedgerObject(std::string_view account, std::string_view dest)
|
||||
{
|
||||
ripple::STObject check(ripple::sfLedgerEntry);
|
||||
check.setFieldU16(ripple::sfLedgerEntryType, ripple::ltCHECK);
|
||||
check.setAccountID(ripple::sfAccount, GetAccountIDWithString(account));
|
||||
check.setAccountID(ripple::sfDestination, GetAccountIDWithString(dest));
|
||||
check.setAccountID(ripple::sfAccount, getAccountIdWithString(account));
|
||||
check.setAccountID(ripple::sfDestination, getAccountIdWithString(dest));
|
||||
check.setFieldU32(ripple::sfFlags, 0);
|
||||
check.setFieldU64(ripple::sfOwnerNode, 0);
|
||||
check.setFieldU64(ripple::sfDestinationNode, 0);
|
||||
@@ -542,12 +544,12 @@ CreateCheckLedgerObject(std::string_view account, std::string_view dest)
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreateDepositPreauthLedgerObjectByAuth(std::string_view account, std::string_view auth)
|
||||
createDepositPreauthLedgerObjectByAuth(std::string_view account, std::string_view auth)
|
||||
{
|
||||
ripple::STObject depositPreauth(ripple::sfLedgerEntry);
|
||||
depositPreauth.setFieldU16(ripple::sfLedgerEntryType, ripple::ltDEPOSIT_PREAUTH);
|
||||
depositPreauth.setAccountID(ripple::sfAccount, GetAccountIDWithString(account));
|
||||
depositPreauth.setAccountID(ripple::sfAuthorize, GetAccountIDWithString(auth));
|
||||
depositPreauth.setAccountID(ripple::sfAccount, getAccountIdWithString(account));
|
||||
depositPreauth.setAccountID(ripple::sfAuthorize, getAccountIdWithString(auth));
|
||||
depositPreauth.setFieldU32(ripple::sfFlags, 0);
|
||||
depositPreauth.setFieldU64(ripple::sfOwnerNode, 0);
|
||||
depositPreauth.setFieldH256(ripple::sfPreviousTxnID, ripple::uint256{});
|
||||
@@ -556,7 +558,7 @@ CreateDepositPreauthLedgerObjectByAuth(std::string_view account, std::string_vie
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreateDepositPreauthLedgerObjectByAuthCredentials(
|
||||
createDepositPreauthLedgerObjectByAuthCredentials(
|
||||
std::string_view account,
|
||||
std::string_view issuer,
|
||||
std::string_view credType
|
||||
@@ -564,10 +566,10 @@ CreateDepositPreauthLedgerObjectByAuthCredentials(
|
||||
{
|
||||
ripple::STObject depositPreauth(ripple::sfLedgerEntry);
|
||||
depositPreauth.setFieldU16(ripple::sfLedgerEntryType, ripple::ltDEPOSIT_PREAUTH);
|
||||
depositPreauth.setAccountID(ripple::sfAccount, GetAccountIDWithString(account));
|
||||
depositPreauth.setAccountID(ripple::sfAccount, getAccountIdWithString(account));
|
||||
depositPreauth.setFieldArray(
|
||||
ripple::sfAuthorizeCredentials,
|
||||
CreateAuthCredentialArray(std::vector<std::string_view>{issuer}, std::vector<std::string_view>{credType})
|
||||
createAuthCredentialArray(std::vector<std::string_view>{issuer}, std::vector<std::string_view>{credType})
|
||||
);
|
||||
depositPreauth.setFieldU32(ripple::sfFlags, 0);
|
||||
depositPreauth.setFieldU64(ripple::sfOwnerNode, 0);
|
||||
@@ -577,13 +579,13 @@ CreateDepositPreauthLedgerObjectByAuthCredentials(
|
||||
}
|
||||
|
||||
data::NFT
|
||||
CreateNFT(std::string_view tokenID, std::string_view account, ripple::LedgerIndex seq, ripple::Blob uri, bool isBurned)
|
||||
createNft(std::string_view tokenID, std::string_view account, ripple::LedgerIndex seq, ripple::Blob uri, bool isBurned)
|
||||
{
|
||||
return data::NFT{ripple::uint256(tokenID), seq, GetAccountIDWithString(account), uri, isBurned};
|
||||
return data::NFT{ripple::uint256(tokenID), seq, getAccountIdWithString(account), uri, isBurned};
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreateNFTBuyOffer(std::string_view tokenID, std::string_view account)
|
||||
createNftBuyOffer(std::string_view tokenID, std::string_view account)
|
||||
{
|
||||
ripple::STObject offer(ripple::sfLedgerEntry);
|
||||
offer.setFieldH256(ripple::sfNFTokenID, ripple::uint256{tokenID});
|
||||
@@ -591,7 +593,7 @@ CreateNFTBuyOffer(std::string_view tokenID, std::string_view account)
|
||||
offer.setFieldU32(ripple::sfFlags, 0u);
|
||||
offer.setFieldAmount(ripple::sfAmount, ripple::STAmount{123});
|
||||
offer.setFieldU64(ripple::sfOwnerNode, 0ul);
|
||||
offer.setAccountID(ripple::sfOwner, GetAccountIDWithString(account));
|
||||
offer.setAccountID(ripple::sfOwner, getAccountIdWithString(account));
|
||||
offer.setFieldH256(ripple::sfPreviousTxnID, ripple::uint256{});
|
||||
offer.setFieldU32(ripple::sfPreviousTxnLgrSeq, 0u);
|
||||
offer.setFieldU64(ripple::sfNFTokenOfferNode, 0ul);
|
||||
@@ -599,7 +601,7 @@ CreateNFTBuyOffer(std::string_view tokenID, std::string_view account)
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreateNFTSellOffer(std::string_view tokenID, std::string_view account)
|
||||
createNftSellOffer(std::string_view tokenID, std::string_view account)
|
||||
{
|
||||
ripple::STObject offer(ripple::sfLedgerEntry);
|
||||
offer.setFieldH256(ripple::sfNFTokenID, ripple::uint256{tokenID});
|
||||
@@ -607,7 +609,7 @@ CreateNFTSellOffer(std::string_view tokenID, std::string_view account)
|
||||
offer.setFieldU32(ripple::sfFlags, 0u);
|
||||
offer.setFieldAmount(ripple::sfAmount, ripple::STAmount{123});
|
||||
offer.setFieldU64(ripple::sfOwnerNode, 0ul);
|
||||
offer.setAccountID(ripple::sfOwner, GetAccountIDWithString(account));
|
||||
offer.setAccountID(ripple::sfOwner, getAccountIdWithString(account));
|
||||
offer.setFieldH256(ripple::sfPreviousTxnID, ripple::uint256{});
|
||||
offer.setFieldU32(ripple::sfPreviousTxnLgrSeq, 0u);
|
||||
offer.setFieldU64(ripple::sfNFTokenOfferNode, 0ul);
|
||||
@@ -615,7 +617,7 @@ CreateNFTSellOffer(std::string_view tokenID, std::string_view account)
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreateSignerLists(std::vector<std::pair<std::string, uint32_t>> const& signers)
|
||||
createSignerLists(std::vector<std::pair<std::string, uint32_t>> const& signers)
|
||||
{
|
||||
auto signerlists = ripple::STObject(ripple::sfLedgerEntry);
|
||||
signerlists.setFieldU16(ripple::sfLedgerEntryType, ripple::ltSIGNER_LIST);
|
||||
@@ -628,7 +630,7 @@ CreateSignerLists(std::vector<std::pair<std::string, uint32_t>> const& signers)
|
||||
ripple::STArray list;
|
||||
for (auto const& signer : signers) {
|
||||
auto entry = ripple::STObject(ripple::sfSignerEntry);
|
||||
entry.setAccountID(ripple::sfAccount, GetAccountIDWithString(signer.first));
|
||||
entry.setAccountID(ripple::sfAccount, getAccountIdWithString(signer.first));
|
||||
entry.setFieldU16(ripple::sfSignerWeight, signer.second);
|
||||
quorum += signer.second;
|
||||
list.push_back(std::move(entry));
|
||||
@@ -639,7 +641,7 @@ CreateSignerLists(std::vector<std::pair<std::string, uint32_t>> const& signers)
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreateNFTTokenPage(
|
||||
createNftTokenPage(
|
||||
std::vector<std::pair<std::string, std::string>> const& tokens,
|
||||
std::optional<ripple::uint256> previousPage
|
||||
)
|
||||
@@ -663,7 +665,7 @@ CreateNFTTokenPage(
|
||||
}
|
||||
|
||||
data::TransactionAndMetadata
|
||||
CreateMintNFTTxWithMetadata(
|
||||
createMintNftTxWithMetadata(
|
||||
std::string_view accountId,
|
||||
uint32_t seq,
|
||||
uint32_t fee,
|
||||
@@ -692,25 +694,25 @@ CreateMintNFTTxWithMetadata(
|
||||
node.setFieldU16(ripple::sfLedgerEntryType, ripple::ltNFTOKEN_PAGE);
|
||||
|
||||
ripple::STObject finalFields(ripple::sfFinalFields);
|
||||
ripple::STArray NFTArray1{2};
|
||||
ripple::STArray nftArray1{2};
|
||||
|
||||
// finalFields contain new NFT while previousFields does not
|
||||
auto entry = ripple::STObject(ripple::sfNFToken);
|
||||
entry.setFieldH256(ripple::sfNFTokenID, ripple::uint256{nftID});
|
||||
char const* url = "testurl";
|
||||
entry.setFieldVL(ripple::sfURI, ripple::Slice(url, 7));
|
||||
NFTArray1.push_back(entry);
|
||||
nftArray1.push_back(entry);
|
||||
|
||||
auto entry2 = ripple::STObject(ripple::sfNFToken);
|
||||
entry2.setFieldH256(ripple::sfNFTokenID, ripple::uint256{INDEX1});
|
||||
entry2.setFieldH256(ripple::sfNFTokenID, ripple::uint256{kINDEX1});
|
||||
entry2.setFieldVL(ripple::sfURI, ripple::Slice(url, 7));
|
||||
NFTArray1.push_back(entry2);
|
||||
nftArray1.push_back(entry2);
|
||||
|
||||
finalFields.setFieldArray(ripple::sfNFTokens, NFTArray1);
|
||||
finalFields.setFieldArray(ripple::sfNFTokens, nftArray1);
|
||||
|
||||
NFTArray1.erase(NFTArray1.begin());
|
||||
nftArray1.erase(nftArray1.begin());
|
||||
ripple::STObject previousFields(ripple::sfPreviousFields);
|
||||
previousFields.setFieldArray(ripple::sfNFTokens, NFTArray1);
|
||||
previousFields.setFieldArray(ripple::sfNFTokens, nftArray1);
|
||||
|
||||
node.emplace_back(std::move(finalFields));
|
||||
node.emplace_back(std::move(previousFields));
|
||||
@@ -726,7 +728,7 @@ CreateMintNFTTxWithMetadata(
|
||||
}
|
||||
|
||||
data::TransactionAndMetadata
|
||||
CreateAcceptNFTOfferTxWithMetadata(std::string_view accountId, uint32_t seq, uint32_t fee, std::string_view nftId)
|
||||
createAcceptNftOfferTxWithMetadata(std::string_view accountId, uint32_t seq, uint32_t fee, std::string_view nftId)
|
||||
{
|
||||
// tx
|
||||
ripple::STObject tx(ripple::sfTransaction);
|
||||
@@ -736,7 +738,7 @@ CreateAcceptNFTOfferTxWithMetadata(std::string_view accountId, uint32_t seq, uin
|
||||
auto amount = ripple::STAmount(fee, false);
|
||||
tx.setFieldAmount(ripple::sfFee, amount);
|
||||
tx.setFieldU32(ripple::sfSequence, seq);
|
||||
tx.setFieldH256(ripple::sfNFTokenBuyOffer, ripple::uint256{INDEX1});
|
||||
tx.setFieldH256(ripple::sfNFTokenBuyOffer, ripple::uint256{kINDEX1});
|
||||
char const* key = "test";
|
||||
ripple::Slice const slice(key, 4);
|
||||
tx.setFieldVL(ripple::sfSigningPubKey, slice);
|
||||
@@ -765,7 +767,7 @@ CreateAcceptNFTOfferTxWithMetadata(std::string_view accountId, uint32_t seq, uin
|
||||
|
||||
// NFTokenCancelOffer can be used to cancel multiple offers
|
||||
data::TransactionAndMetadata
|
||||
CreateCancelNFTOffersTxWithMetadata(
|
||||
createCancelNftOffersTxWithMetadata(
|
||||
std::string_view accountId,
|
||||
uint32_t seq,
|
||||
uint32_t fee,
|
||||
@@ -817,7 +819,7 @@ CreateCancelNFTOffersTxWithMetadata(
|
||||
}
|
||||
|
||||
data::TransactionAndMetadata
|
||||
CreateCreateNFTOfferTxWithMetadata(
|
||||
createCreateNftOfferTxWithMetadata(
|
||||
std::string_view accountId,
|
||||
uint32_t seq,
|
||||
uint32_t fee,
|
||||
@@ -862,7 +864,7 @@ CreateCreateNFTOfferTxWithMetadata(
|
||||
}
|
||||
|
||||
data::TransactionAndMetadata
|
||||
CreateOracleSetTxWithMetadata(
|
||||
createOracleSetTxWithMetadata(
|
||||
std::string_view accountId,
|
||||
uint32_t seq,
|
||||
uint32_t fee,
|
||||
@@ -915,7 +917,7 @@ CreateOracleSetTxWithMetadata(
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreateAmendmentsObject(std::vector<ripple::uint256> const& enabledAmendments)
|
||||
createAmendmentsObject(std::vector<ripple::uint256> const& enabledAmendments)
|
||||
{
|
||||
auto amendments = ripple::STObject(ripple::sfLedgerEntry);
|
||||
amendments.setFieldU16(ripple::sfLedgerEntryType, ripple::ltAMENDMENTS);
|
||||
@@ -926,7 +928,7 @@ CreateAmendmentsObject(std::vector<ripple::uint256> const& enabledAmendments)
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreateBrokenAmendmentsObject()
|
||||
createBrokenAmendmentsObject()
|
||||
{
|
||||
auto amendments = ripple::STObject(ripple::sfLedgerEntry);
|
||||
amendments.setFieldU16(ripple::sfLedgerEntryType, ripple::ltAMENDMENTS);
|
||||
@@ -936,7 +938,7 @@ CreateBrokenAmendmentsObject()
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreateAMMObject(
|
||||
createAmmObject(
|
||||
std::string_view accountId,
|
||||
std::string_view assetCurrency,
|
||||
std::string_view assetIssuer,
|
||||
@@ -950,11 +952,11 @@ CreateAMMObject(
|
||||
{
|
||||
auto amm = ripple::STObject(ripple::sfLedgerEntry);
|
||||
amm.setFieldU16(ripple::sfLedgerEntryType, ripple::ltAMM);
|
||||
amm.setAccountID(ripple::sfAccount, GetAccountIDWithString(accountId));
|
||||
amm.setAccountID(ripple::sfAccount, getAccountIdWithString(accountId));
|
||||
amm.setFieldU16(ripple::sfTradingFee, tradingFee);
|
||||
amm.setFieldU64(ripple::sfOwnerNode, ownerNode);
|
||||
amm.setFieldIssue(ripple::sfAsset, ripple::STIssue{ripple::sfAsset, GetIssue(assetCurrency, assetIssuer)});
|
||||
amm.setFieldIssue(ripple::sfAsset2, ripple::STIssue{ripple::sfAsset2, GetIssue(asset2Currency, asset2Issuer)});
|
||||
amm.setFieldIssue(ripple::sfAsset, ripple::STIssue{ripple::sfAsset, getIssue(assetCurrency, assetIssuer)});
|
||||
amm.setFieldIssue(ripple::sfAsset2, ripple::STIssue{ripple::sfAsset2, getIssue(asset2Currency, asset2Issuer)});
|
||||
ripple::Issue const issue1(
|
||||
ripple::Currency{lpTokenBalanceIssueCurrency},
|
||||
util::parseBase58Wrapper<ripple::AccountID>(std::string(accountId)).value()
|
||||
@@ -965,7 +967,7 @@ CreateAMMObject(
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreateBridgeObject(
|
||||
createBridgeObject(
|
||||
std::string_view accountId,
|
||||
std::string_view lockingDoor,
|
||||
std::string_view issuingDoor,
|
||||
@@ -975,7 +977,7 @@ CreateBridgeObject(
|
||||
{
|
||||
auto bridge = ripple::STObject(ripple::sfLedgerEntry);
|
||||
bridge.setFieldU16(ripple::sfLedgerEntryType, ripple::ltBRIDGE);
|
||||
bridge.setAccountID(ripple::sfAccount, GetAccountIDWithString(accountId));
|
||||
bridge.setAccountID(ripple::sfAccount, getAccountIdWithString(accountId));
|
||||
bridge.setFieldAmount(ripple::sfSignatureReward, ripple::STAmount(10, false));
|
||||
bridge.setFieldU64(ripple::sfXChainClaimID, 100);
|
||||
bridge.setFieldU64(ripple::sfXChainAccountCreateCount, 100);
|
||||
@@ -991,9 +993,9 @@ CreateBridgeObject(
|
||||
issuingIssue["issuer"] = std::string(issuingIssuer);
|
||||
|
||||
bridge[ripple::sfXChainBridge] = ripple::STXChainBridge(
|
||||
GetAccountIDWithString(lockingDoor),
|
||||
getAccountIdWithString(lockingDoor),
|
||||
ripple::issueFromJson(lockingIssue),
|
||||
GetAccountIDWithString(issuingDoor),
|
||||
getAccountIdWithString(issuingDoor),
|
||||
ripple::issueFromJson(issuingIssue)
|
||||
);
|
||||
bridge.setFieldU32(ripple::sfFlags, 0);
|
||||
@@ -1001,7 +1003,7 @@ CreateBridgeObject(
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreateChainOwnedClaimIDObject(
|
||||
createChainOwnedClaimIdObject(
|
||||
std::string_view accountId,
|
||||
std::string_view lockingDoor,
|
||||
std::string_view issuingDoor,
|
||||
@@ -1012,7 +1014,7 @@ CreateChainOwnedClaimIDObject(
|
||||
{
|
||||
auto chainOwnedClaimID = ripple::STObject(ripple::sfLedgerEntry);
|
||||
chainOwnedClaimID.setFieldU16(ripple::sfLedgerEntryType, ripple::ltXCHAIN_OWNED_CLAIM_ID);
|
||||
chainOwnedClaimID.setAccountID(ripple::sfAccount, GetAccountIDWithString(accountId));
|
||||
chainOwnedClaimID.setAccountID(ripple::sfAccount, getAccountIdWithString(accountId));
|
||||
chainOwnedClaimID.setFieldAmount(ripple::sfSignatureReward, ripple::STAmount(10, false));
|
||||
chainOwnedClaimID.setFieldU64(ripple::sfXChainClaimID, 100);
|
||||
chainOwnedClaimID.setFieldU64(ripple::sfOwnerNode, 100);
|
||||
@@ -1026,19 +1028,19 @@ CreateChainOwnedClaimIDObject(
|
||||
issuingIssue["issuer"] = std::string(issuingIssuer);
|
||||
|
||||
chainOwnedClaimID[ripple::sfXChainBridge] = ripple::STXChainBridge(
|
||||
GetAccountIDWithString(lockingDoor),
|
||||
getAccountIdWithString(lockingDoor),
|
||||
ripple::issueFromJson(lockingIssue),
|
||||
GetAccountIDWithString(issuingDoor),
|
||||
getAccountIdWithString(issuingDoor),
|
||||
ripple::issueFromJson(issuingIssue)
|
||||
);
|
||||
chainOwnedClaimID.setFieldU32(ripple::sfFlags, 0);
|
||||
chainOwnedClaimID.setAccountID(ripple::sfOtherChainSource, GetAccountIDWithString(otherChainSource));
|
||||
chainOwnedClaimID.setAccountID(ripple::sfOtherChainSource, getAccountIdWithString(otherChainSource));
|
||||
chainOwnedClaimID.setFieldArray(ripple::sfXChainClaimAttestations, ripple::STArray{});
|
||||
return chainOwnedClaimID;
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreateChainOwnedCreateAccountClaimID(
|
||||
createChainOwnedCreateAccountClaimId(
|
||||
std::string_view accountId,
|
||||
std::string_view lockingDoor,
|
||||
std::string_view issuingDoor,
|
||||
@@ -1048,7 +1050,7 @@ CreateChainOwnedCreateAccountClaimID(
|
||||
{
|
||||
auto chainOwnedCreateAccountClaimID = ripple::STObject(ripple::sfLedgerEntry);
|
||||
chainOwnedCreateAccountClaimID.setFieldU16(ripple::sfLedgerEntryType, ripple::ltXCHAIN_OWNED_CLAIM_ID);
|
||||
chainOwnedCreateAccountClaimID.setAccountID(ripple::sfAccount, GetAccountIDWithString(accountId));
|
||||
chainOwnedCreateAccountClaimID.setAccountID(ripple::sfAccount, getAccountIdWithString(accountId));
|
||||
chainOwnedCreateAccountClaimID.setFieldU64(ripple::sfXChainAccountCreateCount, 100);
|
||||
chainOwnedCreateAccountClaimID.setFieldU64(ripple::sfOwnerNode, 100);
|
||||
chainOwnedCreateAccountClaimID.setFieldH256(ripple::sfPreviousTxnID, ripple::uint256{});
|
||||
@@ -1061,9 +1063,9 @@ CreateChainOwnedCreateAccountClaimID(
|
||||
issuingIssue["issuer"] = std::string(issuingIssuer);
|
||||
|
||||
chainOwnedCreateAccountClaimID[ripple::sfXChainBridge] = ripple::STXChainBridge(
|
||||
GetAccountIDWithString(lockingDoor),
|
||||
getAccountIdWithString(lockingDoor),
|
||||
ripple::issueFromJson(lockingIssue),
|
||||
GetAccountIDWithString(issuingDoor),
|
||||
getAccountIdWithString(issuingDoor),
|
||||
ripple::issueFromJson(issuingIssue)
|
||||
);
|
||||
chainOwnedCreateAccountClaimID.setFieldU32(ripple::sfFlags, 0);
|
||||
@@ -1072,7 +1074,7 @@ CreateChainOwnedCreateAccountClaimID(
|
||||
}
|
||||
|
||||
void
|
||||
AMMAddVoteSlot(ripple::STObject& amm, ripple::AccountID const& accountId, uint16_t tradingFee, uint32_t voteWeight)
|
||||
ammAddVoteSlot(ripple::STObject& amm, ripple::AccountID const& accountId, uint16_t tradingFee, uint32_t voteWeight)
|
||||
{
|
||||
if (!amm.isFieldPresent(ripple::sfVoteSlots))
|
||||
amm.setFieldArray(ripple::sfVoteSlots, ripple::STArray{});
|
||||
@@ -1086,7 +1088,7 @@ AMMAddVoteSlot(ripple::STObject& amm, ripple::AccountID const& accountId, uint16
|
||||
}
|
||||
|
||||
void
|
||||
AMMSetAuctionSlot(
|
||||
ammSetAuctionSlot(
|
||||
ripple::STObject& amm,
|
||||
ripple::AccountID const& accountId,
|
||||
ripple::STAmount price,
|
||||
@@ -1120,7 +1122,7 @@ AMMSetAuctionSlot(
|
||||
}
|
||||
|
||||
ripple::Currency
|
||||
CreateLPTCurrency(std::string_view assetCurrency, std::string_view asset2Currency)
|
||||
createLptCurrency(std::string_view assetCurrency, std::string_view asset2Currency)
|
||||
{
|
||||
return ripple::ammLPTCurrency(
|
||||
ripple::to_currency(std::string(assetCurrency)), ripple::to_currency(std::string(asset2Currency))
|
||||
@@ -1128,10 +1130,10 @@ CreateLPTCurrency(std::string_view assetCurrency, std::string_view asset2Currenc
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreateMPTIssuanceObject(std::string_view accountId, std::uint32_t seq, std::string_view metadata)
|
||||
createMptIssuanceObject(std::string_view accountId, std::uint32_t seq, std::string_view metadata)
|
||||
{
|
||||
ripple::STObject mptIssuance(ripple::sfLedgerEntry);
|
||||
mptIssuance.setAccountID(ripple::sfIssuer, GetAccountIDWithString(accountId));
|
||||
mptIssuance.setAccountID(ripple::sfIssuer, getAccountIdWithString(accountId));
|
||||
mptIssuance.setFieldU16(ripple::sfLedgerEntryType, ripple::ltMPTOKEN_ISSUANCE);
|
||||
mptIssuance.setFieldU32(ripple::sfFlags, 0);
|
||||
mptIssuance.setFieldU32(ripple::sfSequence, seq);
|
||||
@@ -1147,10 +1149,10 @@ CreateMPTIssuanceObject(std::string_view accountId, std::uint32_t seq, std::stri
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreateMPTokenObject(std::string_view accountId, ripple::uint192 issuanceID, std::uint64_t mptAmount)
|
||||
createMpTokenObject(std::string_view accountId, ripple::uint192 issuanceID, std::uint64_t mptAmount)
|
||||
{
|
||||
ripple::STObject mptoken(ripple::sfLedgerEntry);
|
||||
mptoken.setAccountID(ripple::sfAccount, GetAccountIDWithString(accountId));
|
||||
mptoken.setAccountID(ripple::sfAccount, getAccountIdWithString(accountId));
|
||||
mptoken[ripple::sfMPTokenIssuanceID] = issuanceID;
|
||||
mptoken.setFieldU16(ripple::sfLedgerEntryType, ripple::ltMPTOKEN);
|
||||
mptoken.setFieldU32(ripple::sfFlags, 0);
|
||||
@@ -1165,7 +1167,7 @@ CreateMPTokenObject(std::string_view accountId, ripple::uint192 issuanceID, std:
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreateOraclePriceData(
|
||||
createOraclePriceData(
|
||||
uint64_t assetPrice,
|
||||
ripple::Currency baseAssetCurrency,
|
||||
ripple::Currency quoteAssetCurrency,
|
||||
@@ -1182,13 +1184,13 @@ CreateOraclePriceData(
|
||||
}
|
||||
|
||||
ripple::STArray
|
||||
CreatePriceDataSeries(std::vector<ripple::STObject> const& series)
|
||||
createPriceDataSeries(std::vector<ripple::STObject> const& series)
|
||||
{
|
||||
return ripple::STArray{series.begin(), series.end()};
|
||||
}
|
||||
|
||||
ripple::STObject
|
||||
CreateOracleObject(
|
||||
createOracleObject(
|
||||
std::string_view accountId,
|
||||
std::string_view provider,
|
||||
uint64_t ownerNode,
|
||||
@@ -1203,7 +1205,7 @@ CreateOracleObject(
|
||||
auto ledgerObject = ripple::STObject(ripple::sfLedgerEntry);
|
||||
ledgerObject.setFieldU16(ripple::sfLedgerEntryType, ripple::ltORACLE);
|
||||
ledgerObject.setFieldU32(ripple::sfFlags, 0);
|
||||
ledgerObject.setAccountID(ripple::sfOwner, GetAccountIDWithString(accountId));
|
||||
ledgerObject.setAccountID(ripple::sfOwner, getAccountIdWithString(accountId));
|
||||
ledgerObject.setFieldVL(ripple::sfProvider, ripple::Blob{provider.begin(), provider.end()});
|
||||
ledgerObject.setFieldU64(ripple::sfOwnerNode, ownerNode);
|
||||
ledgerObject.setFieldU32(ripple::sfLastUpdateTime, lastUpdateTime);
|
||||
@@ -1218,7 +1220,7 @@ CreateOracleObject(
|
||||
|
||||
// acc2 issue credential for acc1 so acc2 is issuer
|
||||
ripple::STObject
|
||||
CreateCredentialObject(
|
||||
createCredentialObject(
|
||||
std::string_view acc1,
|
||||
std::string_view acc2,
|
||||
std::string_view credType,
|
||||
@@ -1229,8 +1231,8 @@ CreateCredentialObject(
|
||||
ripple::STObject credObj(ripple::sfCredential);
|
||||
credObj.setFieldU16(ripple::sfLedgerEntryType, ripple::ltCREDENTIAL);
|
||||
credObj.setFieldVL(ripple::sfCredentialType, ripple::Blob{credType.begin(), credType.end()});
|
||||
credObj.setAccountID(ripple::sfSubject, GetAccountIDWithString(acc1));
|
||||
credObj.setAccountID(ripple::sfIssuer, GetAccountIDWithString(acc2));
|
||||
credObj.setAccountID(ripple::sfSubject, getAccountIdWithString(acc1));
|
||||
credObj.setAccountID(ripple::sfIssuer, getAccountIdWithString(acc2));
|
||||
if (expiration.has_value())
|
||||
credObj.setFieldU32(ripple::sfExpiration, expiration.value());
|
||||
|
||||
@@ -1247,13 +1249,13 @@ CreateCredentialObject(
|
||||
}
|
||||
|
||||
ripple::STArray
|
||||
CreateAuthCredentialArray(std::vector<std::string_view> issuer, std::vector<std::string_view> credType)
|
||||
createAuthCredentialArray(std::vector<std::string_view> issuer, std::vector<std::string_view> credType)
|
||||
{
|
||||
ripple::STArray arr;
|
||||
ASSERT(issuer.size() == credType.size(), "issuer and credtype vector must be same length");
|
||||
for (std::size_t i = 0; i < issuer.size(); ++i) {
|
||||
auto credential = ripple::STObject::makeInnerObject(ripple::sfCredential);
|
||||
credential.setAccountID(ripple::sfIssuer, GetAccountIDWithString(issuer[i]));
|
||||
credential.setAccountID(ripple::sfIssuer, getAccountIdWithString(issuer[i]));
|
||||
credential.setFieldVL(ripple::sfCredentialType, ripple::strUnHex(std::string(credType[i])).value());
|
||||
arr.push_back(credential);
|
||||
}
|
||||
|
||||
@@ -46,37 +46,37 @@
|
||||
* Create AccountID object with string
|
||||
*/
|
||||
[[nodiscard]] ripple::AccountID
|
||||
GetAccountIDWithString(std::string_view id);
|
||||
getAccountIdWithString(std::string_view id);
|
||||
|
||||
/**
|
||||
* Create AccountID object with string and return its key
|
||||
*/
|
||||
[[nodiscard]] ripple::uint256
|
||||
GetAccountKey(std::string_view id);
|
||||
getAccountKey(std::string_view id);
|
||||
|
||||
/*
|
||||
* Gets the account key from an account id
|
||||
*/
|
||||
[[nodiscard]] ripple::uint256
|
||||
GetAccountKey(ripple::AccountID const& acc);
|
||||
getAccountKey(ripple::AccountID const& acc);
|
||||
|
||||
/*
|
||||
* Create a simple ledgerHeader object with only hash and seq
|
||||
*/
|
||||
[[nodiscard]] ripple::LedgerHeader
|
||||
CreateLedgerHeader(std::string_view ledgerHash, ripple::LedgerIndex seq, std::optional<uint32_t> age = std::nullopt);
|
||||
createLedgerHeader(std::string_view ledgerHash, ripple::LedgerIndex seq, std::optional<uint32_t> age = std::nullopt);
|
||||
|
||||
/*
|
||||
* Create a simple ledgerHeader object with hash, seq and unix timestamp
|
||||
*/
|
||||
[[nodiscard]] ripple::LedgerHeader
|
||||
CreateLedgerHeaderWithUnixTime(std::string_view ledgerHash, ripple::LedgerIndex seq, uint64_t closeTimeUnixStamp);
|
||||
createLedgerHeaderWithUnixTime(std::string_view ledgerHash, ripple::LedgerIndex seq, uint64_t closeTimeUnixStamp);
|
||||
|
||||
/*
|
||||
* Create a Legacy (pre XRPFees amendment) FeeSetting ledger object
|
||||
*/
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateLegacyFeeSettingLedgerObject(
|
||||
createLegacyFeeSettingLedgerObject(
|
||||
uint64_t base,
|
||||
uint32_t reserveInc,
|
||||
uint32_t reserveBase,
|
||||
@@ -88,7 +88,7 @@ CreateLegacyFeeSettingLedgerObject(
|
||||
* Create a FeeSetting ledger object
|
||||
*/
|
||||
ripple::STObject
|
||||
CreateFeeSettingLedgerObject(
|
||||
createFeeSettingLedgerObject(
|
||||
ripple::STAmount base,
|
||||
ripple::STAmount reserveInc,
|
||||
ripple::STAmount reserveBase,
|
||||
@@ -99,7 +99,7 @@ CreateFeeSettingLedgerObject(
|
||||
* Create a Legacy (pre XRPFees amendment) FeeSetting ledger object and return its blob
|
||||
*/
|
||||
[[nodiscard]] ripple::Blob
|
||||
CreateLegacyFeeSettingBlob(
|
||||
createLegacyFeeSettingBlob(
|
||||
uint64_t base,
|
||||
uint32_t reserveInc,
|
||||
uint32_t reserveBase,
|
||||
@@ -111,13 +111,13 @@ CreateLegacyFeeSettingBlob(
|
||||
* Create a FeeSetting ledger object and return its blob
|
||||
*/
|
||||
ripple::Blob
|
||||
CreateFeeSettingBlob(ripple::STAmount base, ripple::STAmount reserveInc, ripple::STAmount reserveBase, uint32_t flag);
|
||||
createFeeSettingBlob(ripple::STAmount base, ripple::STAmount reserveInc, ripple::STAmount reserveBase, uint32_t flag);
|
||||
|
||||
/*
|
||||
* Create a payment transaction object
|
||||
*/
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreatePaymentTransactionObject(
|
||||
createPaymentTransactionObject(
|
||||
std::string_view accountId1,
|
||||
std::string_view accountId2,
|
||||
int amount,
|
||||
@@ -126,7 +126,7 @@ CreatePaymentTransactionObject(
|
||||
);
|
||||
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreatePaymentTransactionMetaObject(
|
||||
createPaymentTransactionMetaObject(
|
||||
std::string_view accountId1,
|
||||
std::string_view accountId2,
|
||||
int finalBalance1,
|
||||
@@ -138,7 +138,7 @@ CreatePaymentTransactionMetaObject(
|
||||
* Create an account root ledger object
|
||||
*/
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateAccountRootObject(
|
||||
createAccountRootObject(
|
||||
std::string_view accountId,
|
||||
uint32_t flag,
|
||||
uint32_t seq,
|
||||
@@ -155,7 +155,7 @@ CreateAccountRootObject(
|
||||
* If reverse is true, taker gets is XRP
|
||||
*/
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateCreateOfferTransactionObject(
|
||||
createCreateOfferTransactionObject(
|
||||
std::string_view accountId,
|
||||
int fee,
|
||||
uint32_t seq,
|
||||
@@ -170,13 +170,13 @@ CreateCreateOfferTransactionObject(
|
||||
* Return an issue object with given currency and issue account
|
||||
*/
|
||||
[[nodiscard]] ripple::Issue
|
||||
GetIssue(std::string_view currency, std::string_view issuerId);
|
||||
getIssue(std::string_view currency, std::string_view issuerId);
|
||||
|
||||
/*
|
||||
* Create a offer change meta data
|
||||
*/
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateMetaDataForBookChange(
|
||||
createMetaDataForBookChange(
|
||||
std::string_view currency,
|
||||
std::string_view issueId,
|
||||
uint32_t transactionIndex,
|
||||
@@ -192,7 +192,7 @@ CreateMetaDataForBookChange(
|
||||
* If reverse is true, finalTakerPays is XRP
|
||||
*/
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateMetaDataForCreateOffer(
|
||||
createMetaDataForCreateOffer(
|
||||
std::string_view currency,
|
||||
std::string_view issueId,
|
||||
uint32_t transactionIndex,
|
||||
@@ -205,7 +205,7 @@ CreateMetaDataForCreateOffer(
|
||||
* Meta data for removing a offer object
|
||||
*/
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateMetaDataForCancelOffer(
|
||||
createMetaDataForCancelOffer(
|
||||
std::string_view currency,
|
||||
std::string_view issueId,
|
||||
uint32_t transactionIndex,
|
||||
@@ -217,13 +217,13 @@ CreateMetaDataForCancelOffer(
|
||||
* Create a owner dir ledger object
|
||||
*/
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateOwnerDirLedgerObject(std::vector<ripple::uint256> indexes, std::string_view rootIndex);
|
||||
createOwnerDirLedgerObject(std::vector<ripple::uint256> indexes, std::string_view rootIndex);
|
||||
|
||||
/*
|
||||
* Create a payment channel ledger object
|
||||
*/
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreatePaymentChannelLedgerObject(
|
||||
createPaymentChannelLedgerObject(
|
||||
std::string_view accountId,
|
||||
std::string_view destId,
|
||||
int amount,
|
||||
@@ -234,7 +234,7 @@ CreatePaymentChannelLedgerObject(
|
||||
);
|
||||
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateRippleStateLedgerObject(
|
||||
createRippleStateLedgerObject(
|
||||
std::string_view currency,
|
||||
std::string_view issuerId,
|
||||
int balance,
|
||||
@@ -248,7 +248,7 @@ CreateRippleStateLedgerObject(
|
||||
);
|
||||
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateOfferLedgerObject(
|
||||
createOfferLedgerObject(
|
||||
std::string_view account,
|
||||
int takerGets,
|
||||
int takerPays,
|
||||
@@ -260,26 +260,26 @@ CreateOfferLedgerObject(
|
||||
);
|
||||
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateTicketLedgerObject(std::string_view account, uint32_t sequence);
|
||||
createTicketLedgerObject(std::string_view account, uint32_t sequence);
|
||||
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateEscrowLedgerObject(std::string_view account, std::string_view dest);
|
||||
createEscrowLedgerObject(std::string_view account, std::string_view dest);
|
||||
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateCheckLedgerObject(std::string_view account, std::string_view dest);
|
||||
createCheckLedgerObject(std::string_view account, std::string_view dest);
|
||||
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateDepositPreauthLedgerObjectByAuth(std::string_view account, std::string_view auth);
|
||||
createDepositPreauthLedgerObjectByAuth(std::string_view account, std::string_view auth);
|
||||
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateDepositPreauthLedgerObjectByAuthCredentials(
|
||||
createDepositPreauthLedgerObjectByAuthCredentials(
|
||||
std::string_view account,
|
||||
std::string_view issuer,
|
||||
std::string_view credType
|
||||
);
|
||||
|
||||
[[nodiscard]] data::NFT
|
||||
CreateNFT(
|
||||
createNft(
|
||||
std::string_view tokenID,
|
||||
std::string_view account,
|
||||
ripple::LedgerIndex seq = 1234u,
|
||||
@@ -288,22 +288,22 @@ CreateNFT(
|
||||
);
|
||||
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateNFTBuyOffer(std::string_view tokenID, std::string_view account);
|
||||
createNftBuyOffer(std::string_view tokenID, std::string_view account);
|
||||
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateNFTSellOffer(std::string_view tokenID, std::string_view account);
|
||||
createNftSellOffer(std::string_view tokenID, std::string_view account);
|
||||
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateSignerLists(std::vector<std::pair<std::string, uint32_t>> const& signers);
|
||||
createSignerLists(std::vector<std::pair<std::string, uint32_t>> const& signers);
|
||||
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateNFTTokenPage(
|
||||
createNftTokenPage(
|
||||
std::vector<std::pair<std::string, std::string>> const& tokens,
|
||||
std::optional<ripple::uint256> previousPage
|
||||
);
|
||||
|
||||
[[nodiscard]] data::TransactionAndMetadata
|
||||
CreateMintNFTTxWithMetadata(
|
||||
createMintNftTxWithMetadata(
|
||||
std::string_view accountId,
|
||||
uint32_t seq,
|
||||
uint32_t fee,
|
||||
@@ -312,10 +312,10 @@ CreateMintNFTTxWithMetadata(
|
||||
);
|
||||
|
||||
[[nodiscard]] data::TransactionAndMetadata
|
||||
CreateAcceptNFTOfferTxWithMetadata(std::string_view accountId, uint32_t seq, uint32_t fee, std::string_view nftId);
|
||||
createAcceptNftOfferTxWithMetadata(std::string_view accountId, uint32_t seq, uint32_t fee, std::string_view nftId);
|
||||
|
||||
[[nodiscard]] data::TransactionAndMetadata
|
||||
CreateCancelNFTOffersTxWithMetadata(
|
||||
createCancelNftOffersTxWithMetadata(
|
||||
std::string_view accountId,
|
||||
uint32_t seq,
|
||||
uint32_t fee,
|
||||
@@ -323,10 +323,10 @@ CreateCancelNFTOffersTxWithMetadata(
|
||||
);
|
||||
|
||||
[[nodiscard]] data::TransactionAndMetadata
|
||||
CreateCreateNFTOfferTxWithMetadata(std::string_view accountId, uint32_t seq, uint32_t fee, std::string_view offerId);
|
||||
createCreateNftOfferTxWithMetadata(std::string_view accountId, uint32_t seq, uint32_t fee, std::string_view offerId);
|
||||
|
||||
[[nodiscard]] data::TransactionAndMetadata
|
||||
CreateCreateNFTOfferTxWithMetadata(
|
||||
createCreateNftOfferTxWithMetadata(
|
||||
std::string_view accountId,
|
||||
uint32_t seq,
|
||||
uint32_t fee,
|
||||
@@ -336,13 +336,13 @@ CreateCreateNFTOfferTxWithMetadata(
|
||||
);
|
||||
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateAmendmentsObject(std::vector<ripple::uint256> const& enabledAmendments);
|
||||
createAmendmentsObject(std::vector<ripple::uint256> const& enabledAmendments);
|
||||
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateBrokenAmendmentsObject();
|
||||
createBrokenAmendmentsObject();
|
||||
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateAMMObject(
|
||||
createAmmObject(
|
||||
std::string_view accountId,
|
||||
std::string_view assetCurrency,
|
||||
std::string_view assetIssuer,
|
||||
@@ -355,7 +355,7 @@ CreateAMMObject(
|
||||
);
|
||||
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateBridgeObject(
|
||||
createBridgeObject(
|
||||
std::string_view accountId,
|
||||
std::string_view lockingDoor,
|
||||
std::string_view issuingDoor,
|
||||
@@ -364,7 +364,7 @@ CreateBridgeObject(
|
||||
);
|
||||
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateChainOwnedClaimIDObject(
|
||||
createChainOwnedClaimIdObject(
|
||||
std::string_view accountId,
|
||||
std::string_view lockingDoor,
|
||||
std::string_view issuingDoor,
|
||||
@@ -374,7 +374,7 @@ CreateChainOwnedClaimIDObject(
|
||||
);
|
||||
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateChainOwnedCreateAccountClaimID(
|
||||
createChainOwnedCreateAccountClaimId(
|
||||
std::string_view accountId,
|
||||
std::string_view lockingDoor,
|
||||
std::string_view issuingDoor,
|
||||
@@ -383,10 +383,10 @@ CreateChainOwnedCreateAccountClaimID(
|
||||
);
|
||||
|
||||
void
|
||||
AMMAddVoteSlot(ripple::STObject& amm, ripple::AccountID const& accountId, uint16_t tradingFee, uint32_t voteWeight);
|
||||
ammAddVoteSlot(ripple::STObject& amm, ripple::AccountID const& accountId, uint16_t tradingFee, uint32_t voteWeight);
|
||||
|
||||
void
|
||||
AMMSetAuctionSlot(
|
||||
ammSetAuctionSlot(
|
||||
ripple::STObject& amm,
|
||||
ripple::AccountID const& accountId,
|
||||
ripple::STAmount price,
|
||||
@@ -396,19 +396,19 @@ AMMSetAuctionSlot(
|
||||
);
|
||||
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateDidObject(std::string_view accountId, std::string_view didDoc, std::string_view uri, std::string_view data);
|
||||
createDidObject(std::string_view accountId, std::string_view didDoc, std::string_view uri, std::string_view data);
|
||||
|
||||
[[nodiscard]] ripple::Currency
|
||||
CreateLPTCurrency(std::string_view assetCurrency, std::string_view asset2Currency);
|
||||
createLptCurrency(std::string_view assetCurrency, std::string_view asset2Currency);
|
||||
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateMPTIssuanceObject(std::string_view accountId, std::uint32_t seq, std::string_view metadata);
|
||||
createMptIssuanceObject(std::string_view accountId, std::uint32_t seq, std::string_view metadata);
|
||||
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateMPTokenObject(std::string_view accountId, ripple::uint192 issuanceID, std::uint64_t mptAmount = 1);
|
||||
createMpTokenObject(std::string_view accountId, ripple::uint192 issuanceID, std::uint64_t mptAmount = 1);
|
||||
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateOraclePriceData(
|
||||
createOraclePriceData(
|
||||
uint64_t assetPrice,
|
||||
ripple::Currency baseAssetCurrency,
|
||||
ripple::Currency quoteAssetCurrency,
|
||||
@@ -416,10 +416,10 @@ CreateOraclePriceData(
|
||||
);
|
||||
|
||||
[[nodiscard]] ripple::STArray
|
||||
CreatePriceDataSeries(std::vector<ripple::STObject> const& series);
|
||||
createPriceDataSeries(std::vector<ripple::STObject> const& series);
|
||||
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateOracleObject(
|
||||
createOracleObject(
|
||||
std::string_view accountId,
|
||||
std::string_view provider,
|
||||
uint64_t ownerNode,
|
||||
@@ -432,7 +432,7 @@ CreateOracleObject(
|
||||
);
|
||||
|
||||
[[nodiscard]] data::TransactionAndMetadata
|
||||
CreateOracleSetTxWithMetadata(
|
||||
createOracleSetTxWithMetadata(
|
||||
std::string_view accountId,
|
||||
uint32_t seq,
|
||||
uint32_t fee,
|
||||
@@ -445,7 +445,7 @@ CreateOracleSetTxWithMetadata(
|
||||
);
|
||||
|
||||
[[nodiscard]] ripple::STObject
|
||||
CreateCredentialObject(
|
||||
createCredentialObject(
|
||||
std::string_view acc1,
|
||||
std::string_view acc2,
|
||||
std::string_view credType,
|
||||
@@ -454,4 +454,4 @@ CreateCredentialObject(
|
||||
);
|
||||
|
||||
[[nodiscard]] ripple::STArray
|
||||
CreateAuthCredentialArray(std::vector<std::string_view> issuer, std::vector<std::string_view> credType);
|
||||
createAuthCredentialArray(std::vector<std::string_view> issuer, std::vector<std::string_view> credType);
|
||||
|
||||
@@ -50,10 +50,10 @@ generateConfig()
|
||||
{"ip", ConfigValue{ConfigType::Double}.defaultValue(444.22)},
|
||||
{"array.[].sub", Array{ConfigValue{ConfigType::Double}}},
|
||||
{"array.[].sub2", Array{ConfigValue{ConfigType::String}.optional()}},
|
||||
{"higher.[].low.section", Array{ConfigValue{ConfigType::String}.withConstraint(validateChannelName)}},
|
||||
{"higher.[].low.section", Array{ConfigValue{ConfigType::String}.withConstraint(gValidateChannelName)}},
|
||||
{"higher.[].low.admin", Array{ConfigValue{ConfigType::Boolean}}},
|
||||
{"dosguard.whitelist.[]", Array{ConfigValue{ConfigType::String}.optional()}},
|
||||
{"dosguard.port", ConfigValue{ConfigType::Integer}.defaultValue(55555).withConstraint(validatePort)},
|
||||
{"dosguard.port", ConfigValue{ConfigType::Integer}.defaultValue(55555).withConstraint(gValidatePort)},
|
||||
{"optional.withDefault", ConfigValue{ConfigType::Double}.defaultValue(0.0).optional()},
|
||||
{"optional.withNoDefault", ConfigValue{ConfigType::Double}.optional()},
|
||||
{"requireValue", ConfigValue{ConfigType::String}}
|
||||
@@ -101,50 +101,48 @@ generateConfig()
|
||||
*/
|
||||
|
||||
/* Used to test overwriting default values in ClioConfigDefinition Above */
|
||||
constexpr static auto JSONData = R"JSON(
|
||||
{
|
||||
static constexpr auto kJSON_DATA = R"JSON({
|
||||
"header": {
|
||||
"text1": "value",
|
||||
"port": 321,
|
||||
"admin": false,
|
||||
"sub": {
|
||||
"sub2Value": "TSM"
|
||||
}
|
||||
},
|
||||
"array": [
|
||||
{
|
||||
"sub": 111.11,
|
||||
"sub2": "subCategory"
|
||||
},
|
||||
{
|
||||
"sub": 4321.55,
|
||||
"text1": "value",
|
||||
"port": 321,
|
||||
"admin": false,
|
||||
"sub": {
|
||||
"sub2Value": "TSM"
|
||||
}
|
||||
},
|
||||
"array": [
|
||||
{
|
||||
"sub": 111.11,
|
||||
"sub2": "subCategory"
|
||||
},
|
||||
{
|
||||
"sub": 4321.55,
|
||||
"sub2": "temporary"
|
||||
},
|
||||
{
|
||||
"sub": 5555.44,
|
||||
"sub2": "london"
|
||||
}
|
||||
],
|
||||
"higher": [
|
||||
{
|
||||
"low": {
|
||||
"section": "WebServer",
|
||||
"admin": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"dosguard": {
|
||||
},
|
||||
{
|
||||
"sub": 5555.44,
|
||||
"sub2": "london"
|
||||
}
|
||||
],
|
||||
"higher": [
|
||||
{
|
||||
"low": {
|
||||
"section": "WebServer",
|
||||
"admin": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"dosguard": {
|
||||
"whitelist": [
|
||||
"125.5.5.1", "204.2.2.1"
|
||||
],
|
||||
"port" : 44444
|
||||
},
|
||||
},
|
||||
"optional" : {
|
||||
"withDefault" : 0.0
|
||||
},
|
||||
},
|
||||
"requireValue" : "required"
|
||||
}
|
||||
)JSON";
|
||||
})JSON";
|
||||
|
||||
/* After parsing jsonValue and populating it into ClioConfig, It will look like this below in json format;
|
||||
{
|
||||
@@ -194,8 +192,7 @@ constexpr static auto JSONData = R"JSON(
|
||||
*/
|
||||
|
||||
// Invalid Json key/values
|
||||
constexpr static auto invalidJSONData = R"JSON(
|
||||
{
|
||||
static constexpr auto kINVALID_JSON_DATA = R"JSON({
|
||||
"header": {
|
||||
"port": "999",
|
||||
"admin": "true"
|
||||
@@ -209,6 +206,5 @@ constexpr static auto invalidJSONData = R"JSON(
|
||||
"requireValue" : "required",
|
||||
"optional" : {
|
||||
"withDefault" : "0.0"
|
||||
}
|
||||
}
|
||||
)JSON";
|
||||
}
|
||||
})JSON";
|
||||
|
||||
Reference in New Issue
Block a user