mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-04 20:05:51 +00:00
Fix formatting
This commit is contained in:
@@ -39,39 +39,17 @@ namespace data {
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
concept SomeBackendCounters = requires(T a) {
|
concept SomeBackendCounters = requires(T a) {
|
||||||
typename T::PtrType;
|
typename T::PtrType;
|
||||||
{
|
{ a.registerTooBusy() } -> std::same_as<void>;
|
||||||
a.registerTooBusy()
|
{ a.registerWriteSync(std::chrono::steady_clock::time_point{}) } -> std::same_as<void>;
|
||||||
} -> std::same_as<void>;
|
{ a.registerWriteSyncRetry() } -> std::same_as<void>;
|
||||||
{
|
{ a.registerWriteStarted() } -> std::same_as<void>;
|
||||||
a.registerWriteSync(std::chrono::steady_clock::time_point{})
|
{ a.registerWriteFinished(std::chrono::steady_clock::time_point{}) } -> std::same_as<void>;
|
||||||
} -> std::same_as<void>;
|
{ a.registerWriteRetry() } -> std::same_as<void>;
|
||||||
{
|
{ a.registerReadStarted(std::uint64_t{}) } -> std::same_as<void>;
|
||||||
a.registerWriteSyncRetry()
|
{ a.registerReadFinished(std::chrono::steady_clock::time_point{}, std::uint64_t{}) } -> std::same_as<void>;
|
||||||
} -> std::same_as<void>;
|
{ a.registerReadRetry(std::uint64_t{}) } -> std::same_as<void>;
|
||||||
{
|
{ a.registerReadError(std::uint64_t{}) } -> std::same_as<void>;
|
||||||
a.registerWriteStarted()
|
{ a.report() } -> std::same_as<boost::json::object>;
|
||||||
} -> std::same_as<void>;
|
|
||||||
{
|
|
||||||
a.registerWriteFinished(std::chrono::steady_clock::time_point{})
|
|
||||||
} -> std::same_as<void>;
|
|
||||||
{
|
|
||||||
a.registerWriteRetry()
|
|
||||||
} -> std::same_as<void>;
|
|
||||||
{
|
|
||||||
a.registerReadStarted(std::uint64_t{})
|
|
||||||
} -> std::same_as<void>;
|
|
||||||
{
|
|
||||||
a.registerReadFinished(std::chrono::steady_clock::time_point{}, std::uint64_t{})
|
|
||||||
} -> std::same_as<void>;
|
|
||||||
{
|
|
||||||
a.registerReadRetry(std::uint64_t{})
|
|
||||||
} -> std::same_as<void>;
|
|
||||||
{
|
|
||||||
a.registerReadError(std::uint64_t{})
|
|
||||||
} -> std::same_as<void>;
|
|
||||||
{
|
|
||||||
a.report()
|
|
||||||
} -> std::same_as<boost::json::object>;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -732,9 +732,7 @@ public:
|
|||||||
std::cend(keys),
|
std::cend(keys),
|
||||||
std::cbegin(objs),
|
std::cbegin(objs),
|
||||||
std::back_inserter(results),
|
std::back_inserter(results),
|
||||||
[](auto const& key, auto const& obj) {
|
[](auto const& key, auto const& obj) { return LedgerObject{key, obj}; }
|
||||||
return LedgerObject{key, obj};
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
|
|||||||
@@ -41,21 +41,11 @@ namespace data::cassandra {
|
|||||||
*/
|
*/
|
||||||
template <typename T>
|
template <typename T>
|
||||||
concept SomeSettingsProvider = requires(T a) {
|
concept SomeSettingsProvider = requires(T a) {
|
||||||
{
|
{ a.getSettings() } -> std::same_as<Settings>;
|
||||||
a.getSettings()
|
{ a.getKeyspace() } -> std::same_as<std::string>;
|
||||||
} -> std::same_as<Settings>;
|
{ a.getTablePrefix() } -> std::same_as<std::optional<std::string>>;
|
||||||
{
|
{ a.getReplicationFactor() } -> std::same_as<uint16_t>;
|
||||||
a.getKeyspace()
|
{ a.getTtl() } -> std::same_as<uint16_t>;
|
||||||
} -> std::same_as<std::string>;
|
|
||||||
{
|
|
||||||
a.getTablePrefix()
|
|
||||||
} -> std::same_as<std::optional<std::string>>;
|
|
||||||
{
|
|
||||||
a.getReplicationFactor()
|
|
||||||
} -> std::same_as<uint16_t>;
|
|
||||||
{
|
|
||||||
a.getTtl()
|
|
||||||
} -> std::same_as<uint16_t>;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -71,42 +61,18 @@ concept SomeExecutionStrategy = requires(
|
|||||||
PreparedStatement prepared,
|
PreparedStatement prepared,
|
||||||
boost::asio::yield_context token
|
boost::asio::yield_context token
|
||||||
) {
|
) {
|
||||||
{
|
{ T(settings, handle) };
|
||||||
T(settings, handle)
|
{ a.sync() } -> std::same_as<void>;
|
||||||
};
|
{ a.isTooBusy() } -> std::same_as<bool>;
|
||||||
{
|
{ a.writeSync(statement) } -> std::same_as<ResultOrError>;
|
||||||
a.sync()
|
{ a.writeSync(prepared) } -> std::same_as<ResultOrError>;
|
||||||
} -> std::same_as<void>;
|
{ a.write(prepared) } -> std::same_as<void>;
|
||||||
{
|
{ a.write(std::move(statements)) } -> std::same_as<void>;
|
||||||
a.isTooBusy()
|
{ a.read(token, prepared) } -> std::same_as<ResultOrError>;
|
||||||
} -> std::same_as<bool>;
|
{ a.read(token, statement) } -> std::same_as<ResultOrError>;
|
||||||
{
|
{ a.read(token, statements) } -> std::same_as<ResultOrError>;
|
||||||
a.writeSync(statement)
|
{ a.readEach(token, statements) } -> std::same_as<std::vector<Result>>;
|
||||||
} -> std::same_as<ResultOrError>;
|
{ a.stats() } -> std::same_as<boost::json::object>;
|
||||||
{
|
|
||||||
a.writeSync(prepared)
|
|
||||||
} -> std::same_as<ResultOrError>;
|
|
||||||
{
|
|
||||||
a.write(prepared)
|
|
||||||
} -> std::same_as<void>;
|
|
||||||
{
|
|
||||||
a.write(std::move(statements))
|
|
||||||
} -> std::same_as<void>;
|
|
||||||
{
|
|
||||||
a.read(token, prepared)
|
|
||||||
} -> std::same_as<ResultOrError>;
|
|
||||||
{
|
|
||||||
a.read(token, statement)
|
|
||||||
} -> std::same_as<ResultOrError>;
|
|
||||||
{
|
|
||||||
a.read(token, statements)
|
|
||||||
} -> std::same_as<ResultOrError>;
|
|
||||||
{
|
|
||||||
a.readEach(token, statements)
|
|
||||||
} -> std::same_as<std::vector<Result>>;
|
|
||||||
{
|
|
||||||
a.stats()
|
|
||||||
} -> std::same_as<boost::json::object>;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -114,18 +80,12 @@ concept SomeExecutionStrategy = requires(
|
|||||||
*/
|
*/
|
||||||
template <typename T>
|
template <typename T>
|
||||||
concept SomeRetryPolicy = requires(T a, boost::asio::io_context ioc, CassandraError err, uint32_t attempt) {
|
concept SomeRetryPolicy = requires(T a, boost::asio::io_context ioc, CassandraError err, uint32_t attempt) {
|
||||||
{
|
{ T(ioc) };
|
||||||
T(ioc)
|
{ a.shouldRetry(err) } -> std::same_as<bool>;
|
||||||
};
|
|
||||||
{
|
|
||||||
a.shouldRetry(err)
|
|
||||||
} -> std::same_as<bool>;
|
|
||||||
{
|
{
|
||||||
a.retry([]() {})
|
a.retry([]() {})
|
||||||
} -> std::same_as<void>;
|
} -> std::same_as<void>;
|
||||||
{
|
{ a.calculateDelay(attempt) } -> std::same_as<std::chrono::milliseconds>;
|
||||||
a.calculateDelay(attempt)
|
|
||||||
} -> std::same_as<std::chrono::milliseconds>;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace data::cassandra
|
} // namespace data::cassandra
|
||||||
|
|||||||
@@ -121,7 +121,8 @@ public:
|
|||||||
// reinterpret_cast is needed here :'(
|
// reinterpret_cast is needed here :'(
|
||||||
auto const rc = bindBytes(reinterpret_cast<unsigned char const*>(value.data()), value.size());
|
auto const rc = bindBytes(reinterpret_cast<unsigned char const*>(value.data()), value.size());
|
||||||
throwErrorIfNeeded(rc, "Bind string (as bytes)");
|
throwErrorIfNeeded(rc, "Bind string (as bytes)");
|
||||||
} else if constexpr (std::is_same_v<DecayedType, UintTupleType> || std::is_same_v<DecayedType, UintByteTupleType>) {
|
} else if constexpr (std::is_same_v<DecayedType, UintTupleType> ||
|
||||||
|
std::is_same_v<DecayedType, UintByteTupleType>) {
|
||||||
auto const rc = cass_statement_bind_tuple(*this, idx, Tuple{std::forward<Type>(value)});
|
auto const rc = cass_statement_bind_tuple(*this, idx, Tuple{std::forward<Type>(value)});
|
||||||
throwErrorIfNeeded(rc, "Bind tuple<uint32, uint32> or <uint32_t, ripple::uint256>");
|
throwErrorIfNeeded(rc, "Bind tuple<uint32, uint32> or <uint32_t, ripple::uint256>");
|
||||||
} else if constexpr (std::is_same_v<DecayedType, ByteVectorType>) {
|
} else if constexpr (std::is_same_v<DecayedType, ByteVectorType>) {
|
||||||
|
|||||||
@@ -117,7 +117,8 @@ LoadBalancer::LoadBalancer(
|
|||||||
"Failed to fetch ETL state from source = {} Please check the configuration and network",
|
"Failed to fetch ETL state from source = {} Please check the configuration and network",
|
||||||
source->toString()
|
source->toString()
|
||||||
));
|
));
|
||||||
} else if (etlState_ && etlState_->networkID && stateOpt->networkID && etlState_->networkID != stateOpt->networkID) {
|
} else if (etlState_ && etlState_->networkID && stateOpt->networkID &&
|
||||||
|
etlState_->networkID != stateOpt->networkID) {
|
||||||
checkOnETLFailure(fmt::format(
|
checkOnETLFailure(fmt::format(
|
||||||
"ETL sources must be on the same network. Source network id = {} does not match others network id = {}",
|
"ETL sources must be on the same network. Source network id = {} does not match others network id = {}",
|
||||||
*(stateOpt->networkID),
|
*(stateOpt->networkID),
|
||||||
|
|||||||
@@ -33,9 +33,7 @@ namespace feed::impl {
|
|||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
concept Hashable = requires(T a) {
|
concept Hashable = requires(T a) {
|
||||||
{
|
{ std::hash<T>{}(a) } -> std::convertible_to<std::size_t>;
|
||||||
std::hash<T>{}(a)
|
|
||||||
} -> std::convertible_to<std::size_t>;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -77,8 +77,8 @@ struct Status {
|
|||||||
std::optional<boost::json::object> extraInfo;
|
std::optional<boost::json::object> extraInfo;
|
||||||
|
|
||||||
Status() = default;
|
Status() = default;
|
||||||
/* implicit */ Status(CombinedError code) : code(code){};
|
/* implicit */ Status(CombinedError code) : code(code) {};
|
||||||
Status(CombinedError code, boost::json::object&& extraInfo) : code(code), extraInfo(std::move(extraInfo)){};
|
Status(CombinedError code, boost::json::object&& extraInfo) : code(code), extraInfo(std::move(extraInfo)) {};
|
||||||
|
|
||||||
// HACK. Some rippled handlers explicitly specify errors.
|
// HACK. Some rippled handlers explicitly specify errors.
|
||||||
// This means that we have to be able to duplicate this functionality.
|
// This means that we have to be able to duplicate this functionality.
|
||||||
|
|||||||
@@ -35,9 +35,7 @@ namespace rpc {
|
|||||||
*/
|
*/
|
||||||
template <typename T>
|
template <typename T>
|
||||||
concept SomeRequirement = requires(T a, boost::json::value lval) {
|
concept SomeRequirement = requires(T a, boost::json::value lval) {
|
||||||
{
|
{ a.verify(lval, std::string{}) } -> std::same_as<MaybeError>;
|
||||||
a.verify(lval, std::string{})
|
|
||||||
} -> std::same_as<MaybeError>;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -45,9 +43,7 @@ concept SomeRequirement = requires(T a, boost::json::value lval) {
|
|||||||
*/
|
*/
|
||||||
template <typename T>
|
template <typename T>
|
||||||
concept SomeModifier = requires(T a, boost::json::value lval) {
|
concept SomeModifier = requires(T a, boost::json::value lval) {
|
||||||
{
|
{ a.modify(lval, std::string{}) } -> std::same_as<MaybeError>;
|
||||||
a.modify(lval, std::string{})
|
|
||||||
} -> std::same_as<MaybeError>;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -61,9 +57,7 @@ concept SomeProcessor = (SomeRequirement<T> or SomeModifier<T>);
|
|||||||
*/
|
*/
|
||||||
template <typename T>
|
template <typename T>
|
||||||
concept SomeContextProcessWithInput = requires(T a, typename T::Input in, typename T::Output out, Context const& ctx) {
|
concept SomeContextProcessWithInput = requires(T a, typename T::Input in, typename T::Output out, Context const& ctx) {
|
||||||
{
|
{ a.process(in, ctx) } -> std::same_as<HandlerReturnType<decltype(out)>>;
|
||||||
a.process(in, ctx)
|
|
||||||
} -> std::same_as<HandlerReturnType<decltype(out)>>;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -71,9 +65,7 @@ concept SomeContextProcessWithInput = requires(T a, typename T::Input in, typena
|
|||||||
*/
|
*/
|
||||||
template <typename T>
|
template <typename T>
|
||||||
concept SomeContextProcessWithoutInput = requires(T a, typename T::Output out, Context const& ctx) {
|
concept SomeContextProcessWithoutInput = requires(T a, typename T::Output out, Context const& ctx) {
|
||||||
{
|
{ a.process(ctx) } -> std::same_as<HandlerReturnType<decltype(out)>>;
|
||||||
a.process(ctx)
|
|
||||||
} -> std::same_as<HandlerReturnType<decltype(out)>>;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -81,9 +73,7 @@ concept SomeContextProcessWithoutInput = requires(T a, typename T::Output out, C
|
|||||||
*/
|
*/
|
||||||
template <typename T>
|
template <typename T>
|
||||||
concept SomeHandlerWithInput = requires(T a, uint32_t version) {
|
concept SomeHandlerWithInput = requires(T a, uint32_t version) {
|
||||||
{
|
{ a.spec(version) } -> std::same_as<RpcSpecConstRef>;
|
||||||
a.spec(version)
|
|
||||||
} -> std::same_as<RpcSpecConstRef>;
|
|
||||||
} and SomeContextProcessWithInput<T> and boost::json::has_value_to<typename T::Input>::value;
|
} and SomeContextProcessWithInput<T> and boost::json::has_value_to<typename T::Input>::value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -97,6 +87,6 @@ concept SomeHandlerWithoutInput = SomeContextProcessWithoutInput<T>;
|
|||||||
*/
|
*/
|
||||||
template <typename T>
|
template <typename T>
|
||||||
concept SomeHandler =
|
concept SomeHandler =
|
||||||
(SomeHandlerWithInput<T> or SomeHandlerWithoutInput<T>)and boost::json::has_value_from<typename T::Output>::value;
|
(SomeHandlerWithInput<T> or SomeHandlerWithoutInput<T>) and boost::json::has_value_from<typename T::Output>::value;
|
||||||
|
|
||||||
} // namespace rpc
|
} // namespace rpc
|
||||||
|
|||||||
@@ -29,15 +29,9 @@ template <typename T>
|
|||||||
concept SomeCounterImpl = requires(T a) {
|
concept SomeCounterImpl = requires(T a) {
|
||||||
typename std::remove_cvref_t<T>::ValueType;
|
typename std::remove_cvref_t<T>::ValueType;
|
||||||
requires SomeNumberType<typename std::remove_cvref_t<T>::ValueType>;
|
requires SomeNumberType<typename std::remove_cvref_t<T>::ValueType>;
|
||||||
{
|
{ a.add(typename std::remove_cvref_t<T>::ValueType{1}) } -> std::same_as<void>;
|
||||||
a.add(typename std::remove_cvref_t<T>::ValueType{1})
|
{ a.set(typename std::remove_cvref_t<T>::ValueType{1}) } -> std::same_as<void>;
|
||||||
} -> std::same_as<void>;
|
{ a.value() } -> SomeNumberType;
|
||||||
{
|
|
||||||
a.set(typename std::remove_cvref_t<T>::ValueType{1})
|
|
||||||
} -> std::same_as<void>;
|
|
||||||
{
|
|
||||||
a.value()
|
|
||||||
} -> SomeNumberType;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <SomeNumberType NumberType>
|
template <SomeNumberType NumberType>
|
||||||
|
|||||||
@@ -38,15 +38,9 @@ template <typename T>
|
|||||||
concept SomeHistogramImpl = requires(T t) {
|
concept SomeHistogramImpl = requires(T t) {
|
||||||
typename std::remove_cvref_t<T>::ValueType;
|
typename std::remove_cvref_t<T>::ValueType;
|
||||||
requires SomeNumberType<typename std::remove_cvref_t<T>::ValueType>;
|
requires SomeNumberType<typename std::remove_cvref_t<T>::ValueType>;
|
||||||
{
|
{ t.observe(typename std::remove_cvref_t<T>::ValueType{1}) } -> std::same_as<void>;
|
||||||
t.observe(typename std::remove_cvref_t<T>::ValueType{1})
|
{ t.setBuckets(std::vector<typename std::remove_cvref_t<T>::ValueType>{}) } -> std::same_as<void>;
|
||||||
} -> std::same_as<void>;
|
{ t.serializeValue(std::string{}, std::string{}, std::declval<OStream&>()) } -> std::same_as<void>;
|
||||||
{
|
|
||||||
t.setBuckets(std::vector<typename std::remove_cvref_t<T>::ValueType>{})
|
|
||||||
} -> std::same_as<void>;
|
|
||||||
{
|
|
||||||
t.serializeValue(std::string{}, std::string{}, std::declval<OStream&>())
|
|
||||||
} -> std::same_as<void>;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <SomeNumberType NumberType>
|
template <SomeNumberType NumberType>
|
||||||
|
|||||||
@@ -33,9 +33,7 @@ namespace web {
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
concept SomeResolver = requires(T t) {
|
concept SomeResolver = requires(T t) {
|
||||||
std::is_default_constructible_v<T>;
|
std::is_default_constructible_v<T>;
|
||||||
{
|
{ t.resolve(std::string_view{}, std::string_view{}) } -> std::same_as<std::vector<std::string>>;
|
||||||
t.resolve(std::string_view{}, std::string_view{})
|
|
||||||
} -> std::same_as<std::vector<std::string>>;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -36,9 +36,7 @@ template <typename T>
|
|||||||
concept SomeServerHandler =
|
concept SomeServerHandler =
|
||||||
requires(T handler, std::string req, std::shared_ptr<ConnectionBase> ws, boost::beast::error_code ec) {
|
requires(T handler, std::string req, std::shared_ptr<ConnectionBase> ws, boost::beast::error_code ec) {
|
||||||
// the callback when server receives a request
|
// the callback when server receives a request
|
||||||
{
|
{ handler(req, ws) };
|
||||||
handler(req, ws)
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace web
|
} // namespace web
|
||||||
|
|||||||
@@ -434,12 +434,12 @@ TEST_F(BackendCassandraTest, Basic)
|
|||||||
auto allTransactions = backend->fetchAllTransactionsInLedger(lgrInfoNext.seq, yield);
|
auto allTransactions = backend->fetchAllTransactionsInLedger(lgrInfoNext.seq, yield);
|
||||||
ASSERT_EQ(allTransactions.size(), 1);
|
ASSERT_EQ(allTransactions.size(), 1);
|
||||||
EXPECT_STREQ(
|
EXPECT_STREQ(
|
||||||
reinterpret_cast<const char*>(allTransactions[0].transaction.data()),
|
reinterpret_cast<char const*>(allTransactions[0].transaction.data()),
|
||||||
static_cast<const char*>(txnBlob.data())
|
static_cast<char const*>(txnBlob.data())
|
||||||
);
|
);
|
||||||
EXPECT_STREQ(
|
EXPECT_STREQ(
|
||||||
reinterpret_cast<const char*>(allTransactions[0].metadata.data()),
|
reinterpret_cast<char const*>(allTransactions[0].metadata.data()),
|
||||||
static_cast<const char*>(metaBlob.data())
|
static_cast<char const*>(metaBlob.data())
|
||||||
);
|
);
|
||||||
auto hashes = backend->fetchAllTransactionHashesInLedger(lgrInfoNext.seq, yield);
|
auto hashes = backend->fetchAllTransactionHashesInLedger(lgrInfoNext.seq, yield);
|
||||||
EXPECT_EQ(hashes.size(), 1);
|
EXPECT_EQ(hashes.size(), 1);
|
||||||
@@ -461,10 +461,10 @@ TEST_F(BackendCassandraTest, Basic)
|
|||||||
EXPECT_TRUE(key256.parseHex(accountIndexHex));
|
EXPECT_TRUE(key256.parseHex(accountIndexHex));
|
||||||
auto obj = backend->fetchLedgerObject(key256, lgrInfoNext.seq, yield);
|
auto obj = backend->fetchLedgerObject(key256, lgrInfoNext.seq, yield);
|
||||||
EXPECT_TRUE(obj);
|
EXPECT_TRUE(obj);
|
||||||
EXPECT_STREQ(reinterpret_cast<const char*>(obj->data()), static_cast<const char*>(accountBlob.data()));
|
EXPECT_STREQ(reinterpret_cast<char const*>(obj->data()), static_cast<char const*>(accountBlob.data()));
|
||||||
obj = backend->fetchLedgerObject(key256, lgrInfoNext.seq + 1, yield);
|
obj = backend->fetchLedgerObject(key256, lgrInfoNext.seq + 1, yield);
|
||||||
EXPECT_TRUE(obj);
|
EXPECT_TRUE(obj);
|
||||||
EXPECT_STREQ(reinterpret_cast<const char*>(obj->data()), static_cast<const char*>(accountBlob.data()));
|
EXPECT_STREQ(reinterpret_cast<char const*>(obj->data()), static_cast<char const*>(accountBlob.data()));
|
||||||
obj = backend->fetchLedgerObject(key256, lgrInfoOld.seq - 1, yield);
|
obj = backend->fetchLedgerObject(key256, lgrInfoOld.seq - 1, yield);
|
||||||
EXPECT_FALSE(obj);
|
EXPECT_FALSE(obj);
|
||||||
}
|
}
|
||||||
@@ -498,13 +498,13 @@ TEST_F(BackendCassandraTest, Basic)
|
|||||||
EXPECT_TRUE(key256.parseHex(accountIndexHex));
|
EXPECT_TRUE(key256.parseHex(accountIndexHex));
|
||||||
auto obj = backend->fetchLedgerObject(key256, lgrInfoNext.seq, yield);
|
auto obj = backend->fetchLedgerObject(key256, lgrInfoNext.seq, yield);
|
||||||
EXPECT_TRUE(obj);
|
EXPECT_TRUE(obj);
|
||||||
EXPECT_STREQ(reinterpret_cast<const char*>(obj->data()), static_cast<const char*>(accountBlob.data()));
|
EXPECT_STREQ(reinterpret_cast<char const*>(obj->data()), static_cast<char const*>(accountBlob.data()));
|
||||||
obj = backend->fetchLedgerObject(key256, lgrInfoNext.seq + 1, yield);
|
obj = backend->fetchLedgerObject(key256, lgrInfoNext.seq + 1, yield);
|
||||||
EXPECT_TRUE(obj);
|
EXPECT_TRUE(obj);
|
||||||
EXPECT_STREQ(reinterpret_cast<const char*>(obj->data()), static_cast<const char*>(accountBlob.data()));
|
EXPECT_STREQ(reinterpret_cast<char const*>(obj->data()), static_cast<char const*>(accountBlob.data()));
|
||||||
obj = backend->fetchLedgerObject(key256, lgrInfoNext.seq - 1, yield);
|
obj = backend->fetchLedgerObject(key256, lgrInfoNext.seq - 1, yield);
|
||||||
EXPECT_TRUE(obj);
|
EXPECT_TRUE(obj);
|
||||||
EXPECT_STREQ(reinterpret_cast<const char*>(obj->data()), static_cast<const char*>(accountBlobOld.data()));
|
EXPECT_STREQ(reinterpret_cast<char const*>(obj->data()), static_cast<char const*>(accountBlobOld.data()));
|
||||||
obj = backend->fetchLedgerObject(key256, lgrInfoOld.seq - 1, yield);
|
obj = backend->fetchLedgerObject(key256, lgrInfoOld.seq - 1, yield);
|
||||||
EXPECT_FALSE(obj);
|
EXPECT_FALSE(obj);
|
||||||
}
|
}
|
||||||
@@ -540,7 +540,7 @@ TEST_F(BackendCassandraTest, Basic)
|
|||||||
EXPECT_FALSE(obj);
|
EXPECT_FALSE(obj);
|
||||||
obj = backend->fetchLedgerObject(key256, lgrInfoNext.seq - 2, yield);
|
obj = backend->fetchLedgerObject(key256, lgrInfoNext.seq - 2, yield);
|
||||||
EXPECT_TRUE(obj);
|
EXPECT_TRUE(obj);
|
||||||
EXPECT_STREQ(reinterpret_cast<const char*>(obj->data()), static_cast<const char*>(accountBlobOld.data()));
|
EXPECT_STREQ(reinterpret_cast<char const*>(obj->data()), static_cast<char const*>(accountBlobOld.data()));
|
||||||
obj = backend->fetchLedgerObject(key256, lgrInfoOld.seq - 1, yield);
|
obj = backend->fetchLedgerObject(key256, lgrInfoOld.seq - 1, yield);
|
||||||
EXPECT_FALSE(obj);
|
EXPECT_FALSE(obj);
|
||||||
}
|
}
|
||||||
@@ -552,7 +552,7 @@ TEST_F(BackendCassandraTest, Basic)
|
|||||||
|
|
||||||
for (auto& blob : res) {
|
for (auto& blob : res) {
|
||||||
++key;
|
++key;
|
||||||
std::string const keyStr{reinterpret_cast<const char*>(key.data()), ripple::uint256::size()};
|
std::string const keyStr{reinterpret_cast<char const*>(key.data()), ripple::uint256::size()};
|
||||||
blob.first = keyStr;
|
blob.first = keyStr;
|
||||||
blob.second = std::to_string(ledgerSequence) + keyStr;
|
blob.second = std::to_string(ledgerSequence) + keyStr;
|
||||||
}
|
}
|
||||||
@@ -570,7 +570,7 @@ TEST_F(BackendCassandraTest, Basic)
|
|||||||
base = ledgerSequence * 100000ul;
|
base = ledgerSequence * 100000ul;
|
||||||
for (auto& blob : res) {
|
for (auto& blob : res) {
|
||||||
++base;
|
++base;
|
||||||
std::string const hashStr{reinterpret_cast<const char*>(base.data()), ripple::uint256::size()};
|
std::string const hashStr{reinterpret_cast<char const*>(base.data()), ripple::uint256::size()};
|
||||||
std::string const txnStr = "tx" + std::to_string(ledgerSequence) + hashStr;
|
std::string const txnStr = "tx" + std::to_string(ledgerSequence) + hashStr;
|
||||||
std::string const metaStr = "meta" + std::to_string(ledgerSequence) + hashStr;
|
std::string const metaStr = "meta" + std::to_string(ledgerSequence) + hashStr;
|
||||||
blob = std::make_tuple(hashStr, txnStr, metaStr);
|
blob = std::make_tuple(hashStr, txnStr, metaStr);
|
||||||
@@ -670,13 +670,13 @@ TEST_F(BackendCassandraTest, Basic)
|
|||||||
bool found = false;
|
bool found = false;
|
||||||
for (auto [retTxn, retMeta, retSeq, retDate] : retTxns) {
|
for (auto [retTxn, retMeta, retSeq, retDate] : retTxns) {
|
||||||
if (std::strncmp(
|
if (std::strncmp(
|
||||||
reinterpret_cast<const char*>(retTxn.data()),
|
reinterpret_cast<char const*>(retTxn.data()),
|
||||||
static_cast<const char*>(txn.data()),
|
static_cast<char const*>(txn.data()),
|
||||||
txn.size()
|
txn.size()
|
||||||
) == 0 &&
|
) == 0 &&
|
||||||
std::strncmp(
|
std::strncmp(
|
||||||
reinterpret_cast<const char*>(retMeta.data()),
|
reinterpret_cast<char const*>(retMeta.data()),
|
||||||
static_cast<const char*>(meta.data()),
|
static_cast<char const*>(meta.data()),
|
||||||
meta.size()
|
meta.size()
|
||||||
) == 0)
|
) == 0)
|
||||||
found = true;
|
found = true;
|
||||||
@@ -699,8 +699,8 @@ TEST_F(BackendCassandraTest, Basic)
|
|||||||
for (size_t i = 0; i < retData.size(); ++i) {
|
for (size_t i = 0; i < retData.size(); ++i) {
|
||||||
auto [txn, meta, _, _2] = retData[i];
|
auto [txn, meta, _, _2] = retData[i];
|
||||||
auto [_3, expTxn, expMeta] = data[i];
|
auto [_3, expTxn, expMeta] = data[i];
|
||||||
EXPECT_STREQ(reinterpret_cast<const char*>(txn.data()), static_cast<const char*>(expTxn.data()));
|
EXPECT_STREQ(reinterpret_cast<char const*>(txn.data()), static_cast<char const*>(expTxn.data()));
|
||||||
EXPECT_STREQ(reinterpret_cast<const char*>(meta.data()), static_cast<const char*>(expMeta.data()));
|
EXPECT_STREQ(reinterpret_cast<char const*>(meta.data()), static_cast<char const*>(expMeta.data()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
std::vector<ripple::uint256> keys;
|
std::vector<ripple::uint256> keys;
|
||||||
@@ -708,7 +708,7 @@ TEST_F(BackendCassandraTest, Basic)
|
|||||||
auto retObj = backend->fetchLedgerObject(binaryStringToUint256(key), seq, yield);
|
auto retObj = backend->fetchLedgerObject(binaryStringToUint256(key), seq, yield);
|
||||||
if (obj.size()) {
|
if (obj.size()) {
|
||||||
ASSERT_TRUE(retObj.has_value());
|
ASSERT_TRUE(retObj.has_value());
|
||||||
EXPECT_STREQ(static_cast<const char*>(obj.data()), reinterpret_cast<const char*>(retObj->data()));
|
EXPECT_STREQ(static_cast<char const*>(obj.data()), reinterpret_cast<char const*>(retObj->data()));
|
||||||
} else {
|
} else {
|
||||||
ASSERT_FALSE(retObj.has_value());
|
ASSERT_FALSE(retObj.has_value());
|
||||||
}
|
}
|
||||||
@@ -725,7 +725,7 @@ TEST_F(BackendCassandraTest, Basic)
|
|||||||
if (obj.size()) {
|
if (obj.size()) {
|
||||||
ASSERT_TRUE(retObj.size());
|
ASSERT_TRUE(retObj.size());
|
||||||
EXPECT_STREQ(
|
EXPECT_STREQ(
|
||||||
static_cast<const char*>(obj.data()), reinterpret_cast<const char*>(retObj.data())
|
static_cast<char const*>(obj.data()), reinterpret_cast<char const*>(retObj.data())
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
ASSERT_FALSE(retObj.size());
|
ASSERT_FALSE(retObj.size());
|
||||||
@@ -741,9 +741,9 @@ TEST_F(BackendCassandraTest, Basic)
|
|||||||
retObjs.insert(retObjs.end(), page.objects.begin(), page.objects.end());
|
retObjs.insert(retObjs.end(), page.objects.begin(), page.objects.end());
|
||||||
} while (page.cursor);
|
} while (page.cursor);
|
||||||
|
|
||||||
for (const auto& obj : objs) {
|
for (auto const& obj : objs) {
|
||||||
bool found = false;
|
bool found = false;
|
||||||
for (const auto& retObj : retObjs) {
|
for (auto const& retObj : retObjs) {
|
||||||
if (ripple::strHex(obj.first) == ripple::strHex(retObj.key)) {
|
if (ripple::strHex(obj.first) == ripple::strHex(retObj.key)) {
|
||||||
found = true;
|
found = true;
|
||||||
ASSERT_EQ(ripple::strHex(obj.second), ripple::strHex(retObj.blob));
|
ASSERT_EQ(ripple::strHex(obj.second), ripple::strHex(retObj.blob));
|
||||||
@@ -767,7 +767,7 @@ TEST_F(BackendCassandraTest, Basic)
|
|||||||
for (auto rec : accountTx) {
|
for (auto rec : accountTx) {
|
||||||
for (auto account : rec.accounts) {
|
for (auto account : rec.accounts) {
|
||||||
allAccountTx[lgrInfoNext.seq][account].emplace_back(
|
allAccountTx[lgrInfoNext.seq][account].emplace_back(
|
||||||
reinterpret_cast<const char*>(rec.txHash.data()), ripple::uint256::size()
|
reinterpret_cast<char const*>(rec.txHash.data()), ripple::uint256::size()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -798,7 +798,7 @@ TEST_F(BackendCassandraTest, Basic)
|
|||||||
for (auto rec : accountTx) {
|
for (auto rec : accountTx) {
|
||||||
for (auto account : rec.accounts) {
|
for (auto account : rec.accounts) {
|
||||||
allAccountTx[lgrInfoNext.seq][account].emplace_back(
|
allAccountTx[lgrInfoNext.seq][account].emplace_back(
|
||||||
reinterpret_cast<const char*>(rec.txHash.data()), ripple::uint256::size()
|
reinterpret_cast<char const*>(rec.txHash.data()), ripple::uint256::size()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -988,10 +988,10 @@ TEST_F(BackendCassandraTest, CacheIntegration)
|
|||||||
EXPECT_TRUE(key256.parseHex(accountIndexHex));
|
EXPECT_TRUE(key256.parseHex(accountIndexHex));
|
||||||
auto obj = backend->fetchLedgerObject(key256, lgrInfoNext.seq, yield);
|
auto obj = backend->fetchLedgerObject(key256, lgrInfoNext.seq, yield);
|
||||||
EXPECT_TRUE(obj);
|
EXPECT_TRUE(obj);
|
||||||
EXPECT_STREQ(reinterpret_cast<const char*>(obj->data()), static_cast<const char*>(accountBlob.data()));
|
EXPECT_STREQ(reinterpret_cast<char const*>(obj->data()), static_cast<char const*>(accountBlob.data()));
|
||||||
obj = backend->fetchLedgerObject(key256, lgrInfoNext.seq + 1, yield);
|
obj = backend->fetchLedgerObject(key256, lgrInfoNext.seq + 1, yield);
|
||||||
EXPECT_TRUE(obj);
|
EXPECT_TRUE(obj);
|
||||||
EXPECT_STREQ(reinterpret_cast<const char*>(obj->data()), static_cast<const char*>(accountBlob.data()));
|
EXPECT_STREQ(reinterpret_cast<char const*>(obj->data()), static_cast<char const*>(accountBlob.data()));
|
||||||
obj = backend->fetchLedgerObject(key256, lgrInfoOld.seq - 1, yield);
|
obj = backend->fetchLedgerObject(key256, lgrInfoOld.seq - 1, yield);
|
||||||
EXPECT_FALSE(obj);
|
EXPECT_FALSE(obj);
|
||||||
}
|
}
|
||||||
@@ -1024,13 +1024,13 @@ TEST_F(BackendCassandraTest, CacheIntegration)
|
|||||||
EXPECT_TRUE(key256.parseHex(accountIndexHex));
|
EXPECT_TRUE(key256.parseHex(accountIndexHex));
|
||||||
auto obj = backend->fetchLedgerObject(key256, lgrInfoNext.seq, yield);
|
auto obj = backend->fetchLedgerObject(key256, lgrInfoNext.seq, yield);
|
||||||
EXPECT_TRUE(obj);
|
EXPECT_TRUE(obj);
|
||||||
EXPECT_STREQ(reinterpret_cast<const char*>(obj->data()), static_cast<const char*>(accountBlob.data()));
|
EXPECT_STREQ(reinterpret_cast<char const*>(obj->data()), static_cast<char const*>(accountBlob.data()));
|
||||||
obj = backend->fetchLedgerObject(key256, lgrInfoNext.seq + 1, yield);
|
obj = backend->fetchLedgerObject(key256, lgrInfoNext.seq + 1, yield);
|
||||||
EXPECT_TRUE(obj);
|
EXPECT_TRUE(obj);
|
||||||
EXPECT_STREQ(reinterpret_cast<const char*>(obj->data()), static_cast<const char*>(accountBlob.data()));
|
EXPECT_STREQ(reinterpret_cast<char const*>(obj->data()), static_cast<char const*>(accountBlob.data()));
|
||||||
obj = backend->fetchLedgerObject(key256, lgrInfoNext.seq - 1, yield);
|
obj = backend->fetchLedgerObject(key256, lgrInfoNext.seq - 1, yield);
|
||||||
EXPECT_TRUE(obj);
|
EXPECT_TRUE(obj);
|
||||||
EXPECT_STREQ(reinterpret_cast<const char*>(obj->data()), static_cast<const char*>(accountBlobOld.data()));
|
EXPECT_STREQ(reinterpret_cast<char const*>(obj->data()), static_cast<char const*>(accountBlobOld.data()));
|
||||||
obj = backend->fetchLedgerObject(key256, lgrInfoOld.seq - 1, yield);
|
obj = backend->fetchLedgerObject(key256, lgrInfoOld.seq - 1, yield);
|
||||||
EXPECT_FALSE(obj);
|
EXPECT_FALSE(obj);
|
||||||
}
|
}
|
||||||
@@ -1066,7 +1066,7 @@ TEST_F(BackendCassandraTest, CacheIntegration)
|
|||||||
EXPECT_FALSE(obj);
|
EXPECT_FALSE(obj);
|
||||||
obj = backend->fetchLedgerObject(key256, lgrInfoNext.seq - 2, yield);
|
obj = backend->fetchLedgerObject(key256, lgrInfoNext.seq - 2, yield);
|
||||||
EXPECT_TRUE(obj);
|
EXPECT_TRUE(obj);
|
||||||
EXPECT_STREQ(reinterpret_cast<const char*>(obj->data()), static_cast<const char*>(accountBlobOld.data()));
|
EXPECT_STREQ(reinterpret_cast<char const*>(obj->data()), static_cast<char const*>(accountBlobOld.data()));
|
||||||
obj = backend->fetchLedgerObject(key256, lgrInfoOld.seq - 1, yield);
|
obj = backend->fetchLedgerObject(key256, lgrInfoOld.seq - 1, yield);
|
||||||
EXPECT_FALSE(obj);
|
EXPECT_FALSE(obj);
|
||||||
}
|
}
|
||||||
@@ -1078,7 +1078,7 @@ TEST_F(BackendCassandraTest, CacheIntegration)
|
|||||||
|
|
||||||
for (auto& blob : res) {
|
for (auto& blob : res) {
|
||||||
++key;
|
++key;
|
||||||
std::string const keyStr{reinterpret_cast<const char*>(key.data()), ripple::uint256::size()};
|
std::string const keyStr{reinterpret_cast<char const*>(key.data()), ripple::uint256::size()};
|
||||||
blob.first = keyStr;
|
blob.first = keyStr;
|
||||||
blob.second = std::to_string(ledgerSequence) + keyStr;
|
blob.second = std::to_string(ledgerSequence) + keyStr;
|
||||||
}
|
}
|
||||||
@@ -1158,7 +1158,7 @@ TEST_F(BackendCassandraTest, CacheIntegration)
|
|||||||
auto retObj = backend->fetchLedgerObject(binaryStringToUint256(key), seq, yield);
|
auto retObj = backend->fetchLedgerObject(binaryStringToUint256(key), seq, yield);
|
||||||
if (obj.size()) {
|
if (obj.size()) {
|
||||||
ASSERT_TRUE(retObj.has_value());
|
ASSERT_TRUE(retObj.has_value());
|
||||||
EXPECT_STREQ(static_cast<const char*>(obj.data()), reinterpret_cast<const char*>(retObj->data()));
|
EXPECT_STREQ(static_cast<char const*>(obj.data()), reinterpret_cast<char const*>(retObj->data()));
|
||||||
} else {
|
} else {
|
||||||
ASSERT_FALSE(retObj.has_value());
|
ASSERT_FALSE(retObj.has_value());
|
||||||
}
|
}
|
||||||
@@ -1175,7 +1175,7 @@ TEST_F(BackendCassandraTest, CacheIntegration)
|
|||||||
if (obj.size()) {
|
if (obj.size()) {
|
||||||
ASSERT_TRUE(retObj.size());
|
ASSERT_TRUE(retObj.size());
|
||||||
EXPECT_STREQ(
|
EXPECT_STREQ(
|
||||||
static_cast<const char*>(obj.data()), reinterpret_cast<const char*>(retObj.data())
|
static_cast<char const*>(obj.data()), reinterpret_cast<char const*>(retObj.data())
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
ASSERT_FALSE(retObj.size());
|
ASSERT_FALSE(retObj.size());
|
||||||
@@ -1189,9 +1189,9 @@ TEST_F(BackendCassandraTest, CacheIntegration)
|
|||||||
page = backend->fetchLedgerPage(page.cursor, seq, limit, false, yield);
|
page = backend->fetchLedgerPage(page.cursor, seq, limit, false, yield);
|
||||||
retObjs.insert(retObjs.end(), page.objects.begin(), page.objects.end());
|
retObjs.insert(retObjs.end(), page.objects.begin(), page.objects.end());
|
||||||
} while (page.cursor);
|
} while (page.cursor);
|
||||||
for (const auto& obj : objs) {
|
for (auto const& obj : objs) {
|
||||||
bool found = false;
|
bool found = false;
|
||||||
for (const auto& retObj : retObjs) {
|
for (auto const& retObj : retObjs) {
|
||||||
if (ripple::strHex(obj.first) == ripple::strHex(retObj.key)) {
|
if (ripple::strHex(obj.first) == ripple::strHex(retObj.key)) {
|
||||||
found = true;
|
found = true;
|
||||||
ASSERT_EQ(ripple::strHex(obj.second), ripple::strHex(retObj.blob));
|
ASSERT_EQ(ripple::strHex(obj.second), ripple::strHex(retObj.blob));
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ struct MockHandle {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct FakeRetryPolicy {
|
struct FakeRetryPolicy {
|
||||||
FakeRetryPolicy(boost::asio::io_context&){}; // required by concept
|
FakeRetryPolicy(boost::asio::io_context&) {}; // required by concept
|
||||||
|
|
||||||
static std::chrono::milliseconds
|
static std::chrono::milliseconds
|
||||||
calculateDelay(uint32_t /* attempt */)
|
calculateDelay(uint32_t /* attempt */)
|
||||||
|
|||||||
@@ -507,7 +507,7 @@ TEST_F(RPCAccountTxHandlerTest, IndexSpecificForwardTrue)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"account": "{}",
|
"account": "{}",
|
||||||
"ledger_index_min": {},
|
"ledger_index_min": {},
|
||||||
@@ -550,7 +550,7 @@ TEST_F(RPCAccountTxHandlerTest, IndexSpecificForwardFalse)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"account": "{}",
|
"account": "{}",
|
||||||
"ledger_index_min": {},
|
"ledger_index_min": {},
|
||||||
@@ -593,7 +593,7 @@ TEST_F(RPCAccountTxHandlerTest, IndexNotSpecificForwardTrue)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"account": "{}",
|
"account": "{}",
|
||||||
"ledger_index_min": {},
|
"ledger_index_min": {},
|
||||||
@@ -636,7 +636,7 @@ TEST_F(RPCAccountTxHandlerTest, IndexNotSpecificForwardFalse)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"account": "{}",
|
"account": "{}",
|
||||||
"ledger_index_min": {},
|
"ledger_index_min": {},
|
||||||
@@ -679,7 +679,7 @@ TEST_F(RPCAccountTxHandlerTest, BinaryTrue)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"account": "{}",
|
"account": "{}",
|
||||||
"ledger_index_min": {},
|
"ledger_index_min": {},
|
||||||
@@ -735,7 +735,7 @@ TEST_F(RPCAccountTxHandlerTest, BinaryTrueV2)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"account": "{}",
|
"account": "{}",
|
||||||
"ledger_index_min": {},
|
"ledger_index_min": {},
|
||||||
@@ -788,7 +788,7 @@ TEST_F(RPCAccountTxHandlerTest, LimitAndMarker)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"account": "{}",
|
"account": "{}",
|
||||||
"ledger_index_min": {},
|
"ledger_index_min": {},
|
||||||
@@ -838,7 +838,7 @@ TEST_F(RPCAccountTxHandlerTest, SpecificLedgerIndex)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"account": "{}",
|
"account": "{}",
|
||||||
"ledger_index": {}
|
"ledger_index": {}
|
||||||
@@ -866,7 +866,7 @@ TEST_F(RPCAccountTxHandlerTest, SpecificNonexistLedgerIntIndex)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"account": "{}",
|
"account": "{}",
|
||||||
"ledger_index": {}
|
"ledger_index": {}
|
||||||
@@ -891,7 +891,7 @@ TEST_F(RPCAccountTxHandlerTest, SpecificNonexistLedgerStringIndex)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"account": "{}",
|
"account": "{}",
|
||||||
"ledger_index": "{}"
|
"ledger_index": "{}"
|
||||||
@@ -933,7 +933,7 @@ TEST_F(RPCAccountTxHandlerTest, SpecificLedgerHash)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"account": "{}",
|
"account": "{}",
|
||||||
"ledger_hash": "{}"
|
"ledger_hash": "{}"
|
||||||
@@ -978,7 +978,7 @@ TEST_F(RPCAccountTxHandlerTest, SpecificLedgerIndexValidated)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"account": "{}",
|
"account": "{}",
|
||||||
"ledger_index": "validated"
|
"ledger_index": "validated"
|
||||||
@@ -1017,7 +1017,7 @@ TEST_F(RPCAccountTxHandlerTest, TxLessThanMinSeq)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"account": "{}",
|
"account": "{}",
|
||||||
"ledger_index_min": {},
|
"ledger_index_min": {},
|
||||||
@@ -1060,7 +1060,7 @@ TEST_F(RPCAccountTxHandlerTest, TxLargerThanMaxSeq)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"account": "{}",
|
"account": "{}",
|
||||||
"ledger_index_min": {},
|
"ledger_index_min": {},
|
||||||
@@ -1295,7 +1295,7 @@ TEST_F(RPCAccountTxHandlerTest, NFTTxs_API_v1)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"account": "{}",
|
"account": "{}",
|
||||||
"ledger_index_min": {},
|
"ledger_index_min": {},
|
||||||
@@ -1537,7 +1537,7 @@ TEST_F(RPCAccountTxHandlerTest, NFTTxs_API_v2)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
auto const handler = AnyHandler{AccountTxHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"account": "{}",
|
"account": "{}",
|
||||||
"ledger_index_min": {},
|
"ledger_index_min": {},
|
||||||
|
|||||||
@@ -292,7 +292,7 @@ TEST_F(RPCNFTHistoryHandlerTest, IndexSpecificForwardTrue)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"nft_id":"{}",
|
"nft_id":"{}",
|
||||||
"ledger_index_min": {},
|
"ledger_index_min": {},
|
||||||
@@ -437,7 +437,7 @@ TEST_F(RPCNFTHistoryHandlerTest, IndexSpecificForwardFalseV1)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"nft_id":"{}",
|
"nft_id":"{}",
|
||||||
"ledger_index_min": {},
|
"ledger_index_min": {},
|
||||||
@@ -592,7 +592,7 @@ TEST_F(RPCNFTHistoryHandlerTest, IndexSpecificForwardFalseV2)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"nft_id":"{}",
|
"nft_id":"{}",
|
||||||
"ledger_index_min": {},
|
"ledger_index_min": {},
|
||||||
@@ -626,7 +626,7 @@ TEST_F(RPCNFTHistoryHandlerTest, IndexNotSpecificForwardTrue)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"nft_id":"{}",
|
"nft_id":"{}",
|
||||||
"ledger_index_min": {},
|
"ledger_index_min": {},
|
||||||
@@ -669,7 +669,7 @@ TEST_F(RPCNFTHistoryHandlerTest, IndexNotSpecificForwardFalse)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"nft_id":"{}",
|
"nft_id":"{}",
|
||||||
"ledger_index_min": {},
|
"ledger_index_min": {},
|
||||||
@@ -712,7 +712,7 @@ TEST_F(RPCNFTHistoryHandlerTest, BinaryTrueV1)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"nft_id":"{}",
|
"nft_id":"{}",
|
||||||
"ledger_index_min": {},
|
"ledger_index_min": {},
|
||||||
@@ -768,7 +768,7 @@ TEST_F(RPCNFTHistoryHandlerTest, BinaryTrueV2)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"nft_id":"{}",
|
"nft_id":"{}",
|
||||||
"ledger_index_min": {},
|
"ledger_index_min": {},
|
||||||
@@ -821,7 +821,7 @@ TEST_F(RPCNFTHistoryHandlerTest, LimitAndMarker)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"nft_id":"{}",
|
"nft_id":"{}",
|
||||||
"ledger_index_min": {},
|
"ledger_index_min": {},
|
||||||
@@ -871,7 +871,7 @@ TEST_F(RPCNFTHistoryHandlerTest, SpecificLedgerIndex)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"nft_id":"{}",
|
"nft_id":"{}",
|
||||||
"ledger_index":{}
|
"ledger_index":{}
|
||||||
@@ -899,7 +899,7 @@ TEST_F(RPCNFTHistoryHandlerTest, SpecificNonexistLedgerIntIndex)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"nft_id":"{}",
|
"nft_id":"{}",
|
||||||
"ledger_index":{}
|
"ledger_index":{}
|
||||||
@@ -924,7 +924,7 @@ TEST_F(RPCNFTHistoryHandlerTest, SpecificNonexistLedgerStringIndex)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"nft_id":"{}",
|
"nft_id":"{}",
|
||||||
"ledger_index":"{}"
|
"ledger_index":"{}"
|
||||||
@@ -966,7 +966,7 @@ TEST_F(RPCNFTHistoryHandlerTest, SpecificLedgerHash)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"nft_id":"{}",
|
"nft_id":"{}",
|
||||||
"ledger_hash":"{}"
|
"ledger_hash":"{}"
|
||||||
@@ -1006,7 +1006,7 @@ TEST_F(RPCNFTHistoryHandlerTest, TxLessThanMinSeq)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"nft_id":"{}",
|
"nft_id":"{}",
|
||||||
"ledger_index_min": {},
|
"ledger_index_min": {},
|
||||||
@@ -1049,7 +1049,7 @@ TEST_F(RPCNFTHistoryHandlerTest, TxLargerThanMaxSeq)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"nft_id":"{}",
|
"nft_id":"{}",
|
||||||
"ledger_index_min": {},
|
"ledger_index_min": {},
|
||||||
@@ -1092,7 +1092,7 @@ TEST_F(RPCNFTHistoryHandlerTest, LimitMoreThanMax)
|
|||||||
|
|
||||||
runSpawn([&, this](auto yield) {
|
runSpawn([&, this](auto yield) {
|
||||||
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
auto const handler = AnyHandler{NFTHistoryHandler{backend}};
|
||||||
auto const static input = json::parse(fmt::format(
|
auto static const input = json::parse(fmt::format(
|
||||||
R"({{
|
R"({{
|
||||||
"nft_id":"{}",
|
"nft_id":"{}",
|
||||||
"ledger_index_min": {},
|
"ledger_index_min": {},
|
||||||
|
|||||||
@@ -699,7 +699,7 @@ TEST_F(RPCTxTest, NFTCancelOffer)
|
|||||||
|
|
||||||
for (auto const& id : output->at("meta").at("nftoken_ids").as_array()) {
|
for (auto const& id : output->at("meta").at("nftoken_ids").as_array()) {
|
||||||
auto const idStr = id.as_string();
|
auto const idStr = id.as_string();
|
||||||
const auto it = std::find(ids.begin(), ids.end(), idStr);
|
auto const it = std::find(ids.begin(), ids.end(), idStr);
|
||||||
ASSERT_NE(it, ids.end()) << "Unexpected NFT ID: " << idStr;
|
ASSERT_NE(it, ids.end()) << "Unexpected NFT ID: " << idStr;
|
||||||
ids.erase(it);
|
ids.erase(it);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user