style: Use pre-commit tool and add simple config (#2029)

I started with really simple pre-commit hooks and will add more on top.

Important files:
- `.pre-commit-config.yaml` - the config for pre-commit
- `.github/workflows/pre-commit.yml` - runs pre-commit hooks in branches
and `develop`
- `.github/workflows/pre-commit-autoupdate.yml` - autoupdates pre-commit
hooks once in a month
This commit is contained in:
Ayaz Salikhov
2025-04-24 17:59:43 +01:00
committed by GitHub
parent 99580a2602
commit 9c92a2b51b
66 changed files with 805 additions and 733 deletions

View File

@@ -40,9 +40,9 @@ TestGlobals::parse(int argc, char* argv[])
// clang-format off
po::options_description description("Clio UT options");
description.add_options()
("backend_host", po::value<std::string>()->default_value(TestGlobals::backendHost),
("backend_host", po::value<std::string>()->default_value(TestGlobals::backendHost),
"sets the cassandra/scylladb host for backend tests")
("backend_keyspace", po::value<std::string>()->default_value(TestGlobals::backendKeyspace),
("backend_keyspace", po::value<std::string>()->default_value(TestGlobals::backendKeyspace),
"sets the cassandra/scylladb keyspace for backend tests")
;
// clang-format on

View File

@@ -50,8 +50,8 @@ protected:
EXPECT_TRUE(handle.connect());
auto const query = fmt::format(
R"(
CREATE KEYSPACE IF NOT EXISTS {}
WITH replication = {{'class': 'SimpleStrategy', 'replication_factor': '1'}}
CREATE KEYSPACE IF NOT EXISTS {}
WITH replication = {{'class': 'SimpleStrategy', 'replication_factor': '1'}}
AND durable_writes = True
)",
keyspace
@@ -209,8 +209,8 @@ TEST_F(BackendCassandraBaseTest, KeyspaceManipulation)
{
auto const query = fmt::format(
R"(
CREATE KEYSPACE {}
WITH replication = {{'class': 'SimpleStrategy', 'replication_factor': '1'}}
CREATE KEYSPACE {}
WITH replication = {{'class': 'SimpleStrategy', 'replication_factor': '1'}}
AND durable_writes = True
)",
keyspace
@@ -248,7 +248,7 @@ TEST_F(BackendCassandraBaseTest, CreateTableWithStrings)
auto handle = createHandle(TestGlobals::instance().backendHost, "test");
auto q1 = fmt::format(
R"(
CREATE TABLE IF NOT EXISTS strings (hash blob PRIMARY KEY, sequence bigint)
CREATE TABLE IF NOT EXISTS strings (hash blob PRIMARY KEY, sequence bigint)
WITH default_time_to_live = {}
)",
5000
@@ -313,7 +313,7 @@ TEST_F(BackendCassandraBaseTest, BatchInsert)
auto handle = createHandle(TestGlobals::instance().backendHost, "test");
auto const q1 = fmt::format(
R"(
CREATE TABLE IF NOT EXISTS strings (hash blob PRIMARY KEY, sequence bigint)
CREATE TABLE IF NOT EXISTS strings (hash blob PRIMARY KEY, sequence bigint)
WITH default_time_to_live = {}
)",
5000
@@ -372,7 +372,7 @@ TEST_F(BackendCassandraBaseTest, BatchInsertAsync)
auto handle = createHandle(TestGlobals::instance().backendHost, "test");
auto const q1 = fmt::format(
R"(
CREATE TABLE IF NOT EXISTS strings (hash blob PRIMARY KEY, sequence bigint)
CREATE TABLE IF NOT EXISTS strings (hash blob PRIMARY KEY, sequence bigint)
WITH default_time_to_live = {}
)",
5000
@@ -418,7 +418,7 @@ TEST_F(BackendCassandraBaseTest, AlterTableAddColumn)
auto handle = createHandle(TestGlobals::instance().backendHost, "test");
auto const q1 = fmt::format(
R"(
CREATE TABLE IF NOT EXISTS strings (hash blob PRIMARY KEY, sequence bigint)
CREATE TABLE IF NOT EXISTS strings (hash blob PRIMARY KEY, sequence bigint)
WITH default_time_to_live = {}
)",
5000
@@ -438,7 +438,7 @@ TEST_F(BackendCassandraBaseTest, AlterTableMoveToNewTable)
auto const newTable = fmt::format(
R"(
CREATE TABLE IF NOT EXISTS strings_v2 (hash blob PRIMARY KEY, sequence bigint, tmp bigint)
CREATE TABLE IF NOT EXISTS strings_v2 (hash blob PRIMARY KEY, sequence bigint, tmp bigint)
WITH default_time_to_live = {}
)",
5000

View File

@@ -75,7 +75,7 @@ public:
auto static kINSERT_TX_INDEX_EXAMPLE = [this]() {
return handle_.prepare(fmt::format(
R"(
INSERT INTO {}
INSERT INTO {}
(hash, tx_type)
VALUES (?, ?)
)",
@@ -171,7 +171,7 @@ public:
auto static kINSERT_LEDGER_EXAMPLE = [this]() {
return handle_.prepare(fmt::format(
R"(
INSERT INTO {}
INSERT INTO {}
(sequence, account_hash)
VALUES (?, ?)
)",
@@ -319,11 +319,11 @@ private:
statements.emplace_back(fmt::format(
R"(
CREATE TABLE IF NOT EXISTS {}
(
(
hash blob,
tx_type text,
PRIMARY KEY (hash)
)
PRIMARY KEY (hash)
)
)",
data::cassandra::qualifiedTableName(settingsProvider_, "tx_index_example")
));
@@ -331,11 +331,11 @@ private:
statements.emplace_back(fmt::format(
R"(
CREATE TABLE IF NOT EXISTS {}
(
(
sequence bigint,
account_hash blob,
PRIMARY KEY (sequence)
)
PRIMARY KEY (sequence)
)
)",
data::cassandra::qualifiedTableName(settingsProvider_, "ledger_example")
));

View File

@@ -43,7 +43,7 @@ namespace {
constexpr auto kJSON_DATA = R"JSON(
{
"arr": [
"arr": [
{ "first": 1234 },
{ "second": true },
{ "inner_section": [{ "inner": "works" }] },

View File

@@ -60,7 +60,7 @@ TEST(VerifyConfigTest, InvalidJsonFile)
static constexpr auto kINVALID_JSON = R"({
"server": {
"ip": "0.0.0.0",
"port": 51233,
"port": 51233,
}
})";
auto const tmpConfigFile = TmpFile(kINVALID_JSON);

View File

@@ -97,7 +97,7 @@ TEST_F(RPCBaseTest, TypeValidator)
{"arr", Type<json::array>{}},
};
auto passingInput = json::parse(R"({
auto passingInput = json::parse(R"({
"uint": 123,
"int": 321,
"str": "a string",
@@ -615,10 +615,10 @@ TEST_F(RPCBaseTest, SubscribeStreamValidator)
{
auto const spec = RpcSpec{{"streams", CustomValidators::subscribeStreamValidator}};
auto passingInput = json::parse(
R"({
"streams":
R"({
"streams":
[
"ledger",
"ledger",
"transactions_proposed",
"validations",
"transactions",

View File

@@ -1119,7 +1119,7 @@ TEST_F(RPCAMMInfoHandlerTest, HappyPathWithAssetsMatchingInputOrder)
auto static const kINPUT = json::parse(fmt::format(
R"({{
"asset": {{
"currency": "JPY",
"currency": "JPY",
"issuer": "{}"
}},
"asset2": {{
@@ -1233,7 +1233,7 @@ TEST_F(RPCAMMInfoHandlerTest, HappyPathWithAssetsPreservesInputOrder)
"issuer": "{}"
}},
"asset2": {{
"currency": "JPY",
"currency": "JPY",
"issuer": "{}"
}}
}})",

View File

@@ -69,8 +69,8 @@ TEST_F(RPCAccountChannelsHandlerTest, LimitNotInt)
runSpawn([this](auto yield) {
auto const handler = AnyHandler{AccountChannelsHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"account": "{}",
R"({{
"account": "{}",
"limit": "t"
}})",
kACCOUNT
@@ -88,8 +88,8 @@ TEST_F(RPCAccountChannelsHandlerTest, LimitNagetive)
runSpawn([this](auto yield) {
auto const handler = AnyHandler{AccountChannelsHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"account": "{}",
R"({{
"account": "{}",
"limit": -1
}})",
kACCOUNT
@@ -107,8 +107,8 @@ TEST_F(RPCAccountChannelsHandlerTest, LimitZero)
runSpawn([this](auto yield) {
auto const handler = AnyHandler{AccountChannelsHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"account": "{}",
R"({{
"account": "{}",
"limit": 0
}})",
kACCOUNT
@@ -126,8 +126,8 @@ TEST_F(RPCAccountChannelsHandlerTest, NonHexLedgerHash)
runSpawn([this](auto yield) {
auto const handler = AnyHandler{AccountChannelsHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"account": "{}",
R"({{
"account": "{}",
"limit": 10,
"ledger_hash": "xxx"
}})",
@@ -148,7 +148,7 @@ TEST_F(RPCAccountChannelsHandlerTest, NonStringLedgerHash)
auto const handler = AnyHandler{AccountChannelsHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"account": "{}",
"account": "{}",
"limit": 10,
"ledger_hash": 123
}})",
@@ -168,8 +168,8 @@ TEST_F(RPCAccountChannelsHandlerTest, InvalidLedgerIndexString)
runSpawn([this](auto yield) {
auto const handler = AnyHandler{AccountChannelsHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"account": "{}",
R"({{
"account": "{}",
"limit": 10,
"ledger_index": "notvalidated"
}})",
@@ -189,8 +189,8 @@ TEST_F(RPCAccountChannelsHandlerTest, MarkerNotString)
runSpawn([this](auto yield) {
auto const handler = AnyHandler{AccountChannelsHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"account": "{}",
R"({{
"account": "{}",
"marker": 9
}})",
kACCOUNT
@@ -212,7 +212,7 @@ TEST_F(RPCAccountChannelsHandlerTest, InvalidMarker)
runSpawn([this](auto yield) {
auto const handler = AnyHandler{AccountChannelsHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
R"({{
"account": "{}",
"marker": "123invalid"
}})",
@@ -228,8 +228,8 @@ TEST_F(RPCAccountChannelsHandlerTest, InvalidMarker)
runSpawn([&, this](auto yield) {
auto const handler = AnyHandler{AccountChannelsHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"account": "{}",
R"({{
"account": "{}",
"marker": 401
}})",
kACCOUNT
@@ -247,7 +247,7 @@ TEST_F(RPCAccountChannelsHandlerTest, AccountInvalidFormat)
{
runSpawn([this](auto yield) {
auto const handler = AnyHandler{AccountChannelsHandler{backend_}};
auto const input = json::parse(R"({
auto const input = json::parse(R"({
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jp"
})");
auto const output = handler.process(input, Context{yield});
@@ -263,7 +263,7 @@ TEST_F(RPCAccountChannelsHandlerTest, AccountNotString)
{
runSpawn([this](auto yield) {
auto const handler = AnyHandler{AccountChannelsHandler{backend_}};
auto const input = json::parse(R"({
auto const input = json::parse(R"({
"account": 12
})");
auto const output = handler.process(input, Context{yield});
@@ -309,7 +309,7 @@ TEST_F(RPCAccountChannelsHandlerTest, NonExistLedgerViaLedgerStringIndex)
ON_CALL(*backend_, fetchLedgerBySequence).WillByDefault(Return(std::optional<ripple::LedgerHeader>{}));
EXPECT_CALL(*backend_, fetchLedgerBySequence).Times(1);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"account": "{}",
"ledger_index": "4"
}})",
@@ -331,7 +331,7 @@ TEST_F(RPCAccountChannelsHandlerTest, NonExistLedgerViaLedgerIntIndex)
ON_CALL(*backend_, fetchLedgerBySequence).WillByDefault(Return(std::optional<ripple::LedgerHeader>{}));
EXPECT_CALL(*backend_, fetchLedgerBySequence).Times(1);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"account": "{}",
"ledger_index": 4
}})",
@@ -356,7 +356,7 @@ TEST_F(RPCAccountChannelsHandlerTest, NonExistLedgerViaLedgerHash2)
ON_CALL(*backend_, fetchLedgerByHash(ripple::uint256{kLEDGER_HASH}, _)).WillByDefault(Return(ledgerHeader));
EXPECT_CALL(*backend_, fetchLedgerByHash).Times(1);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"account": "{}",
"ledger_hash": "{}"
}})",
@@ -380,7 +380,7 @@ TEST_F(RPCAccountChannelsHandlerTest, NonExistLedgerViaLedgerIndex2)
// differ from previous logic
EXPECT_CALL(*backend_, fetchLedgerBySequence).Times(0);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"account": "{}",
"ledger_index": "31"
}})",
@@ -535,7 +535,7 @@ TEST_F(RPCAccountChannelsHandlerTest, UseLimit)
runSpawn([this](auto yield) {
auto handler = AnyHandler{AccountChannelsHandler{this->backend_}};
auto const input = json::parse(fmt::format(
R"({{
R"({{
"account": "{}",
"limit": 20
}})",
@@ -551,8 +551,8 @@ TEST_F(RPCAccountChannelsHandlerTest, UseLimit)
runSpawn([this](auto yield) {
auto const handler = AnyHandler{AccountChannelsHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"account": "{}",
R"({{
"account": "{}",
"limit": 9
}})",
kACCOUNT
@@ -564,8 +564,8 @@ TEST_F(RPCAccountChannelsHandlerTest, UseLimit)
runSpawn([this](auto yield) {
auto const handler = AnyHandler{AccountChannelsHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"account": "{}",
R"({{
"account": "{}",
"limit": 401
}})",
kACCOUNT
@@ -622,7 +622,7 @@ TEST_F(RPCAccountChannelsHandlerTest, UseDestination)
auto const input = json::parse(fmt::format(
R"({{
"account": "{}",
"limit": 30,
"limit": 30,
"destination_account":"{}"
}})",
kACCOUNT,
@@ -657,7 +657,7 @@ TEST_F(RPCAccountChannelsHandlerTest, EmptyChannel)
.WillByDefault(Return(ownerDir.getSerializer().peekData()));
EXPECT_CALL(*backend_, doFetchLedgerObject).Times(2);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"account": "{}"
}})",
kACCOUNT
@@ -742,7 +742,7 @@ TEST_F(RPCAccountChannelsHandlerTest, OptionalResponseField)
ON_CALL(*backend_, doFetchLedgerObjects).WillByDefault(Return(bbs));
EXPECT_CALL(*backend_, doFetchLedgerObjects).Times(1);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"account": "{}"
}})",
kACCOUNT
@@ -804,7 +804,7 @@ TEST_F(RPCAccountChannelsHandlerTest, MarkerOutput)
EXPECT_CALL(*backend_, doFetchLedgerObjects).Times(1);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"account": "{}",
"limit": {}
}})",
@@ -859,7 +859,7 @@ TEST_F(RPCAccountChannelsHandlerTest, MarkerInput)
EXPECT_CALL(*backend_, doFetchLedgerObjects).Times(1);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"account": "{}",
"limit": {},
"marker": "{},{}"

View File

@@ -342,7 +342,7 @@ TEST_F(RPCAccountInfoHandlerTest, SignerListsTrueV2)
{
auto const expectedOutput = fmt::format(
R"({{
"account_data":
"account_data":
{{
"Account": "{}",
"Balance": "200",
@@ -385,7 +385,7 @@ TEST_F(RPCAccountInfoHandlerTest, SignerListsTrueV2)
"index": "A9C28A28B85CD533217F5C0A0C7767666B093FA58A0F2D80026FCC4CD932DDC7"
}}
],
"account_flags":
"account_flags":
{{
"defaultRipple": false,
"depositAuth": false,
@@ -443,7 +443,7 @@ TEST_F(RPCAccountInfoHandlerTest, SignerListsTrueV1)
{
auto const expectedOutput = fmt::format(
R"({{
"account_data":
"account_data":
{{
"Account": "{}",
"Balance": "200",
@@ -486,7 +486,7 @@ TEST_F(RPCAccountInfoHandlerTest, SignerListsTrueV1)
}}
]
}},
"account_flags":
"account_flags":
{{
"defaultRipple": false,
"depositAuth": false,

View File

@@ -77,8 +77,8 @@ TEST_F(RPCAccountLinesHandlerTest, NonHexLedgerHash)
runSpawn([this](auto yield) {
auto const handler = AnyHandler{AccountLinesHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"account": "{}",
R"({{
"account": "{}",
"limit": 10,
"ledger_hash": "xxx"
}})",
@@ -99,7 +99,7 @@ TEST_F(RPCAccountLinesHandlerTest, NonStringLedgerHash)
auto const handler = AnyHandler{AccountLinesHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"account": "{}",
"account": "{}",
"limit": 10,
"ledger_hash": 123
}})",
@@ -119,8 +119,8 @@ TEST_F(RPCAccountLinesHandlerTest, InvalidLedgerIndexString)
runSpawn([this](auto yield) {
auto const handler = AnyHandler{AccountLinesHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"account": "{}",
R"({{
"account": "{}",
"limit": 10,
"ledger_index": "notvalidated"
}})",
@@ -140,8 +140,8 @@ TEST_F(RPCAccountLinesHandlerTest, MarkerNotString)
runSpawn([this](auto yield) {
auto const handler = AnyHandler{AccountLinesHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"account": "{}",
R"({{
"account": "{}",
"marker": 9
}})",
kACCOUNT
@@ -163,7 +163,7 @@ TEST_F(RPCAccountLinesHandlerTest, InvalidMarker)
runSpawn([this](auto yield) {
auto const handler = AnyHandler{AccountLinesHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
R"({{
"account": "{}",
"marker": "123invalid"
}})",
@@ -179,8 +179,8 @@ TEST_F(RPCAccountLinesHandlerTest, InvalidMarker)
runSpawn([this](auto yield) {
auto const handler = AnyHandler{AccountLinesHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"account": "{}",
R"({{
"account": "{}",
"marker": 401
}})",
kACCOUNT
@@ -199,7 +199,7 @@ TEST_F(RPCAccountLinesHandlerTest, AccountInvalidFormat)
runSpawn([this](auto yield) {
auto const handler = AnyHandler{AccountLinesHandler{backend_}};
auto const input = json::parse(
R"({
R"({
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jp"
})"
);
@@ -217,7 +217,7 @@ TEST_F(RPCAccountLinesHandlerTest, AccountNotString)
runSpawn([this](auto yield) {
auto const handler = AnyHandler{AccountLinesHandler{backend_}};
auto const input = json::parse(
R"({
R"({
"account": 12
})"
);
@@ -235,7 +235,7 @@ TEST_F(RPCAccountLinesHandlerTest, PeerInvalidFormat)
runSpawn([this](auto yield) {
auto const handler = AnyHandler{AccountLinesHandler{backend_}};
auto const input = json::parse(
R"({
R"({
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"peer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jp"
})"
@@ -253,7 +253,7 @@ TEST_F(RPCAccountLinesHandlerTest, PeerNotString)
runSpawn([this](auto yield) {
auto const handler = AnyHandler{AccountLinesHandler{backend_}};
auto const input = json::parse(
R"({
R"({
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"peer": 12
})"
@@ -272,7 +272,7 @@ TEST_F(RPCAccountLinesHandlerTest, LimitNotInt)
runSpawn([this](auto yield) {
auto const handler = AnyHandler{AccountLinesHandler{backend_}};
auto const input = json::parse(
R"({
R"({
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"limit": "t"
})"
@@ -290,7 +290,7 @@ TEST_F(RPCAccountLinesHandlerTest, LimitNagetive)
runSpawn([this](auto yield) {
auto const handler = AnyHandler{AccountLinesHandler{backend_}};
auto const input = json::parse(
R"({
R"({
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"limit": -1
})"
@@ -308,7 +308,7 @@ TEST_F(RPCAccountLinesHandlerTest, LimitZero)
runSpawn([this](auto yield) {
auto const handler = AnyHandler{AccountLinesHandler{backend_}};
auto const input = json::parse(
R"({
R"({
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"limit": 0
})"
@@ -355,7 +355,7 @@ TEST_F(RPCAccountLinesHandlerTest, NonExistLedgerViaLedgerStringIndex)
ON_CALL(*backend_, fetchLedgerBySequence).WillByDefault(Return(std::optional<ripple::LedgerHeader>{}));
EXPECT_CALL(*backend_, fetchLedgerBySequence).Times(1);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"account": "{}",
"ledger_index": "4"
}})",
@@ -377,7 +377,7 @@ TEST_F(RPCAccountLinesHandlerTest, NonExistLedgerViaLedgerIntIndex)
ON_CALL(*backend_, fetchLedgerBySequence).WillByDefault(Return(std::optional<ripple::LedgerHeader>{}));
EXPECT_CALL(*backend_, fetchLedgerBySequence).Times(1);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"account": "{}",
"ledger_index": 4
}})",
@@ -402,7 +402,7 @@ TEST_F(RPCAccountLinesHandlerTest, NonExistLedgerViaLedgerHash2)
ON_CALL(*backend_, fetchLedgerByHash(ripple::uint256{kLEDGER_HASH}, _)).WillByDefault(Return(ledgerHeader));
EXPECT_CALL(*backend_, fetchLedgerByHash).Times(1);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"account": "{}",
"ledger_hash": "{}"
}})",
@@ -426,7 +426,7 @@ TEST_F(RPCAccountLinesHandlerTest, NonExistLedgerViaLedgerIndex2)
// differ from previous logic
EXPECT_CALL(*backend_, fetchLedgerBySequence).Times(0);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"account": "{}",
"ledger_index": "31"
}})",
@@ -581,7 +581,7 @@ TEST_F(RPCAccountLinesHandlerTest, UseLimit)
runSpawn([this](auto yield) {
auto handler = AnyHandler{AccountLinesHandler{this->backend_}};
auto const input = json::parse(fmt::format(
R"({{
R"({{
"account": "{}",
"limit": 20
}})",
@@ -597,8 +597,8 @@ TEST_F(RPCAccountLinesHandlerTest, UseLimit)
runSpawn([this](auto yield) {
auto const handler = AnyHandler{AccountLinesHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"account": "{}",
R"({{
"account": "{}",
"limit": 9
}})",
kACCOUNT
@@ -610,8 +610,8 @@ TEST_F(RPCAccountLinesHandlerTest, UseLimit)
runSpawn([this](auto yield) {
auto const handler = AnyHandler{AccountLinesHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"account": "{}",
R"({{
"account": "{}",
"limit": 401
}})",
kACCOUNT
@@ -668,7 +668,7 @@ TEST_F(RPCAccountLinesHandlerTest, UseDestination)
auto const input = json::parse(fmt::format(
R"({{
"account": "{}",
"limit": 30,
"limit": 30,
"peer": "{}"
}})",
kACCOUNT,
@@ -703,7 +703,7 @@ TEST_F(RPCAccountLinesHandlerTest, EmptyChannel)
.WillByDefault(Return(ownerDir.getSerializer().peekData()));
EXPECT_CALL(*backend_, doFetchLedgerObject).Times(2);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"account": "{}"
}})",
kACCOUNT
@@ -793,7 +793,7 @@ TEST_F(RPCAccountLinesHandlerTest, OptionalResponseFieldWithDeepFreeze)
ON_CALL(*backend_, doFetchLedgerObjects).WillByDefault(Return(bbs));
EXPECT_CALL(*backend_, doFetchLedgerObjects).Times(1);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"account": "{}"
}})",
kACCOUNT
@@ -873,7 +873,7 @@ TEST_F(RPCAccountLinesHandlerTest, FrozenTrustLineResponse)
EXPECT_CALL(*backend_, doFetchLedgerObjects).WillOnce(Return(bbs));
auto const input = json::parse(fmt::format(
R"({{
R"({{
"account": "{}"
}})",
kACCOUNT
@@ -936,7 +936,7 @@ TEST_F(RPCAccountLinesHandlerTest, MarkerOutput)
EXPECT_CALL(*backend_, doFetchLedgerObjects).Times(1);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"account": "{}",
"limit": {}
}})",
@@ -991,7 +991,7 @@ TEST_F(RPCAccountLinesHandlerTest, MarkerInput)
EXPECT_CALL(*backend_, doFetchLedgerObjects).Times(1);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"account": "{}",
"limit": {},
"marker": "{},{}"

View File

@@ -1352,7 +1352,7 @@ TEST_F(RPCAccountObjectsHandlerTest, NFTLimitAdjust)
R"({{
"account":"{}",
"marker":"{},{}",
"limit": 12
"limit": 12
}})",
kACCOUNT,
ripple::strHex(marker),

View File

@@ -187,7 +187,7 @@ struct AccountTxParameterTest : public RPCAccountTxHandlerTest,
.testName = "MarkerLedgerNotInt",
.testJson = R"({
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"marker":
"marker":
{
"seq": "string",
"ledger": 1
@@ -200,7 +200,7 @@ struct AccountTxParameterTest : public RPCAccountTxHandlerTest,
.testName = "MarkerSeqNotInt",
.testJson = R"({
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"marker":
"marker":
{
"ledger": "string",
"seq": 1
@@ -318,7 +318,7 @@ struct AccountTxParameterTest : public RPCAccountTxHandlerTest,
AccountTxParamTestCaseBundle{
.testName = "LedgerIndexMaxMinAndLedgerIndex",
.testJson = R"({
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"ledger_index_max": 20,
"ledger_index_min": 11,
"ledger_index": 10
@@ -353,7 +353,7 @@ struct AccountTxParameterTest : public RPCAccountTxHandlerTest,
.testName = "LedgerIndexMaxMinAndLedgerHash",
.testJson = fmt::format(
R"({{
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"ledger_index_max": 20,
"ledger_index_min": 11,
"ledger_hash": "{}"
@@ -367,7 +367,7 @@ struct AccountTxParameterTest : public RPCAccountTxHandlerTest,
.testName = "LedgerIndexMaxMinAndLedgerHash_API_v1",
.testJson = fmt::format(
R"({{
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"ledger_index_max": 20,
"ledger_index_min": 11,
"ledger_hash": "{}"
@@ -393,7 +393,7 @@ struct AccountTxParameterTest : public RPCAccountTxHandlerTest,
AccountTxParamTestCaseBundle{
.testName = "InvalidTxType",
.testJson = R"({
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"tx_type": "unknow"
})",
.expectedError = "invalidParams",
@@ -1130,24 +1130,24 @@ TEST_F(RPCAccountTxHandlerTest, NFTTxs_API_v1)
"transactions": [
{
"meta": {
"AffectedNodes":
"AffectedNodes":
[
{
"ModifiedNode":
"ModifiedNode":
{
"FinalFields":
"FinalFields":
{
"NFTokens":
"NFTokens":
[
{
"NFToken":
"NFToken":
{
"NFTokenID": "05FB0EB4B899F056FA095537C5817163801F544BAFCEA39C995D76DB4D16F9DF",
"URI": "7465737475726C"
}
},
{
"NFToken":
"NFToken":
{
"NFTokenID": "1B8590C01B0006EDFA9ED60296DD052DC5E90F99659B25014D08E1BC983515BC",
"URI": "7465737475726C"
@@ -1156,12 +1156,12 @@ TEST_F(RPCAccountTxHandlerTest, NFTTxs_API_v1)
]
},
"LedgerEntryType": "NFTokenPage",
"PreviousFields":
"PreviousFields":
{
"NFTokens":
"NFTokens":
[
{
"NFToken":
"NFToken":
{
"NFTokenID": "1B8590C01B0006EDFA9ED60296DD052DC5E90F99659B25014D08E1BC983515BC",
"URI": "7465737475726C"
@@ -1176,7 +1176,7 @@ TEST_F(RPCAccountTxHandlerTest, NFTTxs_API_v1)
"TransactionResult": "tesSUCCESS",
"nftoken_id": "05FB0EB4B899F056FA095537C5817163801F544BAFCEA39C995D76DB4D16F9DF"
},
"tx":
"tx":
{
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"Fee": "50",
@@ -1192,14 +1192,14 @@ TEST_F(RPCAccountTxHandlerTest, NFTTxs_API_v1)
"validated": true
},
{
"meta":
"meta":
{
"AffectedNodes":
"AffectedNodes":
[
{
"DeletedNode":
"DeletedNode":
{
"FinalFields":
"FinalFields":
{
"NFTokenID": "05FB0EB4B899F056FA095537C5817163801F544BAFCEA39C995D76DB4D16F9DA",
"Owner": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
@@ -1214,7 +1214,7 @@ TEST_F(RPCAccountTxHandlerTest, NFTTxs_API_v1)
"TransactionResult": "tesSUCCESS",
"nftoken_id": "05FB0EB4B899F056FA095537C5817163801F544BAFCEA39C995D76DB4D16F9DA"
},
"tx":
"tx":
{
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"Fee": "50",
@@ -1230,13 +1230,13 @@ TEST_F(RPCAccountTxHandlerTest, NFTTxs_API_v1)
"validated": true
},
{
"meta":
"meta":
{
"AffectedNodes":
"AffectedNodes":
[
{
"DeletedNode": {
"FinalFields":
"FinalFields":
{
"NFTokenID": "05FB0EB4B899F056FA095537C5817163801F544BAFCEA39C995D76DB4D16F9DA"
},
@@ -1244,9 +1244,9 @@ TEST_F(RPCAccountTxHandlerTest, NFTTxs_API_v1)
}
},
{
"DeletedNode":
"DeletedNode":
{
"FinalFields":
"FinalFields":
{
"NFTokenID": "15FB0EB4B899F056FA095537C5817163801F544BAFCEA39C995D76DB4D16F9DF"
},
@@ -1256,17 +1256,17 @@ TEST_F(RPCAccountTxHandlerTest, NFTTxs_API_v1)
],
"TransactionIndex": 0,
"TransactionResult": "tesSUCCESS",
"nftoken_ids":
"nftoken_ids":
[
"05FB0EB4B899F056FA095537C5817163801F544BAFCEA39C995D76DB4D16F9DA",
"15FB0EB4B899F056FA095537C5817163801F544BAFCEA39C995D76DB4D16F9DF"
]
},
"tx":
"tx":
{
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"Fee": "50",
"NFTokenOffers":
"NFTokenOffers":
[
"05FB0EB4B899F056FA095537C5817163801F544BAFCEA39C995D76DB4D16F9DA",
"15FB0EB4B899F056FA095537C5817163801F544BAFCEA39C995D76DB4D16F9DF"
@@ -1282,12 +1282,12 @@ TEST_F(RPCAccountTxHandlerTest, NFTTxs_API_v1)
"validated": true
},
{
"meta":
"meta":
{
"AffectedNodes":
"AffectedNodes":
[
{
"CreatedNode":
"CreatedNode":
{
"LedgerEntryType": "NFTokenOffer",
"LedgerIndex": "05FB0EB4B899F056FA095537C5817163801F544BAFCEA39C995D76DB4D16F9DA"
@@ -1298,7 +1298,7 @@ TEST_F(RPCAccountTxHandlerTest, NFTTxs_API_v1)
"TransactionResult": "tesSUCCESS",
"offer_id": "05FB0EB4B899F056FA095537C5817163801F544BAFCEA39C995D76DB4D16F9DA"
},
"tx":
"tx":
{
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"Amount": "123",
@@ -1316,7 +1316,7 @@ TEST_F(RPCAccountTxHandlerTest, NFTTxs_API_v1)
}
],
"validated": true,
"marker":
"marker":
{
"ledger": 12,
"seq": 34
@@ -1363,24 +1363,24 @@ TEST_F(RPCAccountTxHandlerTest, NFTTxs_API_v2)
"transactions": [
{
"meta": {
"AffectedNodes":
"AffectedNodes":
[
{
"ModifiedNode":
"ModifiedNode":
{
"FinalFields":
"FinalFields":
{
"NFTokens":
"NFTokens":
[
{
"NFToken":
"NFToken":
{
"NFTokenID": "05FB0EB4B899F056FA095537C5817163801F544BAFCEA39C995D76DB4D16F9DF",
"URI": "7465737475726C"
}
},
{
"NFToken":
"NFToken":
{
"NFTokenID": "1B8590C01B0006EDFA9ED60296DD052DC5E90F99659B25014D08E1BC983515BC",
"URI": "7465737475726C"
@@ -1389,12 +1389,12 @@ TEST_F(RPCAccountTxHandlerTest, NFTTxs_API_v2)
]
},
"LedgerEntryType": "NFTokenPage",
"PreviousFields":
"PreviousFields":
{
"NFTokens":
"NFTokens":
[
{
"NFToken":
"NFToken":
{
"NFTokenID": "1B8590C01B0006EDFA9ED60296DD052DC5E90F99659B25014D08E1BC983515BC",
"URI": "7465737475726C"
@@ -1413,7 +1413,7 @@ TEST_F(RPCAccountTxHandlerTest, NFTTxs_API_v2)
"ledger_index": 11,
"ledger_hash": "4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652",
"close_time_iso": "2000-01-01T00:00:00Z",
"tx_json":
"tx_json":
{
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"Fee": "50",
@@ -1427,14 +1427,14 @@ TEST_F(RPCAccountTxHandlerTest, NFTTxs_API_v2)
"validated": true
},
{
"meta":
"meta":
{
"AffectedNodes":
"AffectedNodes":
[
{
"DeletedNode":
"DeletedNode":
{
"FinalFields":
"FinalFields":
{
"NFTokenID": "05FB0EB4B899F056FA095537C5817163801F544BAFCEA39C995D76DB4D16F9DA",
"Owner": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
@@ -1452,7 +1452,7 @@ TEST_F(RPCAccountTxHandlerTest, NFTTxs_API_v2)
"ledger_index": 11,
"ledger_hash": "4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652",
"close_time_iso": "2000-01-01T00:00:00Z",
"tx_json":
"tx_json":
{
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"Fee": "50",
@@ -1466,13 +1466,13 @@ TEST_F(RPCAccountTxHandlerTest, NFTTxs_API_v2)
"validated": true
},
{
"meta":
"meta":
{
"AffectedNodes":
"AffectedNodes":
[
{
"DeletedNode": {
"FinalFields":
"FinalFields":
{
"NFTokenID": "05FB0EB4B899F056FA095537C5817163801F544BAFCEA39C995D76DB4D16F9DA"
},
@@ -1480,9 +1480,9 @@ TEST_F(RPCAccountTxHandlerTest, NFTTxs_API_v2)
}
},
{
"DeletedNode":
"DeletedNode":
{
"FinalFields":
"FinalFields":
{
"NFTokenID": "15FB0EB4B899F056FA095537C5817163801F544BAFCEA39C995D76DB4D16F9DF"
},
@@ -1492,7 +1492,7 @@ TEST_F(RPCAccountTxHandlerTest, NFTTxs_API_v2)
],
"TransactionIndex": 0,
"TransactionResult": "tesSUCCESS",
"nftoken_ids":
"nftoken_ids":
[
"05FB0EB4B899F056FA095537C5817163801F544BAFCEA39C995D76DB4D16F9DA",
"15FB0EB4B899F056FA095537C5817163801F544BAFCEA39C995D76DB4D16F9DF"
@@ -1502,11 +1502,11 @@ TEST_F(RPCAccountTxHandlerTest, NFTTxs_API_v2)
"ledger_index": 11,
"ledger_hash": "4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652",
"close_time_iso": "2000-01-01T00:00:00Z",
"tx_json":
"tx_json":
{
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"Fee": "50",
"NFTokenOffers":
"NFTokenOffers":
[
"05FB0EB4B899F056FA095537C5817163801F544BAFCEA39C995D76DB4D16F9DA",
"15FB0EB4B899F056FA095537C5817163801F544BAFCEA39C995D76DB4D16F9DF"
@@ -1520,12 +1520,12 @@ TEST_F(RPCAccountTxHandlerTest, NFTTxs_API_v2)
"validated": true
},
{
"meta":
"meta":
{
"AffectedNodes":
"AffectedNodes":
[
{
"CreatedNode":
"CreatedNode":
{
"LedgerEntryType": "NFTokenOffer",
"LedgerIndex": "05FB0EB4B899F056FA095537C5817163801F544BAFCEA39C995D76DB4D16F9DA"
@@ -1540,7 +1540,7 @@ TEST_F(RPCAccountTxHandlerTest, NFTTxs_API_v2)
"ledger_index": 11,
"ledger_hash": "4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652",
"close_time_iso": "2000-01-01T00:00:00Z",
"tx_json":
"tx_json":
{
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"Amount": "123",
@@ -1556,7 +1556,7 @@ TEST_F(RPCAccountTxHandlerTest, NFTTxs_API_v2)
}
],
"validated": true,
"marker":
"marker":
{
"ledger": 12,
"seq": 34

View File

@@ -116,7 +116,7 @@ generateParameterBookOffersTestBundles()
ParameterTestBundle{
.testName = "MissingTakerGets",
.testJson = R"({
"taker_pays" :
"taker_pays" :
{
"currency" : "USD",
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
@@ -128,7 +128,7 @@ generateParameterBookOffersTestBundles()
ParameterTestBundle{
.testName = "MissingTakerPays",
.testJson = R"({
"taker_gets" :
"taker_gets" :
{
"currency" : "USD",
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
@@ -141,7 +141,7 @@ generateParameterBookOffersTestBundles()
.testName = "WrongTypeTakerPays",
.testJson = R"({
"taker_pays" : "wrong",
"taker_gets" :
"taker_gets" :
{
"currency" : "XRP"
}
@@ -153,7 +153,7 @@ generateParameterBookOffersTestBundles()
.testName = "WrongTypeTakerGets",
.testJson = R"({
"taker_gets" : "wrong",
"taker_pays" :
"taker_pays" :
{
"currency" : "XRP"
}
@@ -165,7 +165,7 @@ generateParameterBookOffersTestBundles()
.testName = "TakerPaysMissingCurrency",
.testJson = R"({
"taker_pays" : {},
"taker_gets" :
"taker_gets" :
{
"currency" : "XRP"
}
@@ -177,7 +177,7 @@ generateParameterBookOffersTestBundles()
.testName = "TakerGetsMissingCurrency",
.testJson = R"({
"taker_gets" : {},
"taker_pays" :
"taker_pays" :
{
"currency" : "XRP"
}
@@ -188,12 +188,12 @@ generateParameterBookOffersTestBundles()
ParameterTestBundle{
.testName = "TakerGetsWrongCurrency",
.testJson = R"({
"taker_gets" :
"taker_gets" :
{
"currency" : "CNYY",
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
},
"taker_pays" :
"taker_pays" :
{
"currency" : "XRP"
}
@@ -204,12 +204,12 @@ generateParameterBookOffersTestBundles()
ParameterTestBundle{
.testName = "TakerPaysWrongCurrency",
.testJson = R"({
"taker_pays" :
"taker_pays" :
{
"currency" : "CNYY",
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
},
"taker_gets" :
"taker_gets" :
{
"currency" : "XRP"
}
@@ -220,12 +220,12 @@ generateParameterBookOffersTestBundles()
ParameterTestBundle{
.testName = "TakerGetsCurrencyNotString",
.testJson = R"({
"taker_gets" :
"taker_gets" :
{
"currency" : 123,
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
},
"taker_pays" :
"taker_pays" :
{
"currency" : "XRP"
}
@@ -236,12 +236,12 @@ generateParameterBookOffersTestBundles()
ParameterTestBundle{
.testName = "TakerPaysCurrencyNotString",
.testJson = R"({
"taker_pays" :
"taker_pays" :
{
"currency" : 123,
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
},
"taker_gets" :
"taker_gets" :
{
"currency" : "XRP"
}
@@ -252,12 +252,12 @@ generateParameterBookOffersTestBundles()
ParameterTestBundle{
.testName = "TakerGetsWrongIssuer",
.testJson = R"({
"taker_gets" :
"taker_gets" :
{
"currency" : "CNY",
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs5"
},
"taker_pays" :
"taker_pays" :
{
"currency" : "XRP"
}
@@ -268,12 +268,12 @@ generateParameterBookOffersTestBundles()
ParameterTestBundle{
.testName = "TakerPaysWrongIssuer",
.testJson = R"({
"taker_pays" :
"taker_pays" :
{
"currency" : "CNY",
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs5"
},
"taker_gets" :
"taker_gets" :
{
"currency" : "XRP"
}
@@ -284,12 +284,12 @@ generateParameterBookOffersTestBundles()
ParameterTestBundle{
.testName = "InvalidTaker",
.testJson = R"({
"taker_pays" :
"taker_pays" :
{
"currency" : "CNY",
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
},
"taker_gets" :
"taker_gets" :
{
"currency" : "XRP"
},
@@ -301,12 +301,12 @@ generateParameterBookOffersTestBundles()
ParameterTestBundle{
.testName = "TakerNotString",
.testJson = R"({
"taker_pays" :
"taker_pays" :
{
"currency" : "CNY",
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
},
"taker_gets" :
"taker_gets" :
{
"currency" : "XRP"
},
@@ -318,12 +318,12 @@ generateParameterBookOffersTestBundles()
ParameterTestBundle{
.testName = "LimitNotInt",
.testJson = R"({
"taker_pays" :
"taker_pays" :
{
"currency" : "CNY",
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
},
"taker_gets" :
"taker_gets" :
{
"currency" : "XRP"
},
@@ -335,12 +335,12 @@ generateParameterBookOffersTestBundles()
ParameterTestBundle{
.testName = "LimitNagetive",
.testJson = R"({
"taker_pays" :
"taker_pays" :
{
"currency" : "CNY",
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
},
"taker_gets" :
"taker_gets" :
{
"currency" : "XRP"
},
@@ -352,12 +352,12 @@ generateParameterBookOffersTestBundles()
ParameterTestBundle{
.testName = "LimitZero",
.testJson = R"({
"taker_pays" :
"taker_pays" :
{
"currency" : "CNY",
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
},
"taker_gets" :
"taker_gets" :
{
"currency" : "XRP"
},
@@ -369,12 +369,12 @@ generateParameterBookOffersTestBundles()
ParameterTestBundle{
.testName = "LedgerIndexInvalid",
.testJson = R"({
"taker_pays" :
"taker_pays" :
{
"currency" : "CNY",
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
},
"taker_gets" :
"taker_gets" :
{
"currency" : "XRP"
},
@@ -386,12 +386,12 @@ generateParameterBookOffersTestBundles()
ParameterTestBundle{
.testName = "LedgerHashInvalid",
.testJson = R"({
"taker_pays" :
"taker_pays" :
{
"currency" : "CNY",
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
},
"taker_gets" :
"taker_gets" :
{
"currency" : "XRP"
},
@@ -403,12 +403,12 @@ generateParameterBookOffersTestBundles()
ParameterTestBundle{
.testName = "LedgerHashNotString",
.testJson = R"({
"taker_pays" :
"taker_pays" :
{
"currency" : "CNY",
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
},
"taker_gets" :
"taker_gets" :
{
"currency" : "XRP"
},
@@ -420,12 +420,12 @@ generateParameterBookOffersTestBundles()
ParameterTestBundle{
.testName = "GetsPaysXRPWithIssuer",
.testJson = R"({
"taker_pays" :
"taker_pays" :
{
"currency" : "XRP",
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
},
"taker_gets" :
"taker_gets" :
{
"currency" : "CNY",
"issuer" : "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
@@ -437,11 +437,11 @@ generateParameterBookOffersTestBundles()
ParameterTestBundle{
.testName = "PaysCurrencyWithXRPIssuer",
.testJson = R"({
"taker_pays" :
"taker_pays" :
{
"currency" : "JPY"
"currency" : "JPY"
},
"taker_gets" :
"taker_gets" :
{
"currency" : "CNY",
"issuer" : "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
@@ -453,14 +453,14 @@ generateParameterBookOffersTestBundles()
ParameterTestBundle{
.testName = "GetsCurrencyWithXRPIssuer",
.testJson = R"({
"taker_pays" :
"taker_pays" :
{
"currency" : "XRP"
"currency" : "XRP"
},
"taker_gets" :
"taker_gets" :
{
"currency" : "CNY"
}
"currency" : "CNY"
}
})",
.expectedError = "dstIsrMalformed",
.expectedErrorMessage = "Invalid field 'taker_gets.issuer', expected non-XRP issuer."
@@ -468,16 +468,16 @@ generateParameterBookOffersTestBundles()
ParameterTestBundle{
.testName = "GetsXRPWithIssuer",
.testJson = R"({
"taker_pays" :
"taker_pays" :
{
"currency" : "CNY",
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
},
"taker_gets" :
"taker_gets" :
{
"currency" : "XRP",
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
}
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
}
})",
.expectedError = "dstIsrMalformed",
.expectedErrorMessage = "Unneeded field 'taker_gets.issuer' for XRP currency specification."
@@ -485,16 +485,16 @@ generateParameterBookOffersTestBundles()
ParameterTestBundle{
.testName = "BadMarket",
.testJson = R"({
"taker_pays" :
"taker_pays" :
{
"currency" : "CNY",
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
},
"taker_gets" :
"taker_gets" :
{
"currency" : "CNY",
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
}
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
}
})",
.expectedError = "badMarket",
.expectedErrorMessage = "badMarket"
@@ -620,11 +620,11 @@ generateNormalPathBookOffersTestBundles()
auto const getsXRPPaysUSDInputJson = fmt::format(
R"({{
"taker_gets":
"taker_gets":
{{
"currency": "XRP"
}},
"taker_pays":
"taker_pays":
{{
"currency": "USD",
"issuer": "{}"
@@ -635,11 +635,11 @@ generateNormalPathBookOffersTestBundles()
auto const paysXRPGetsUSDInputJson = fmt::format(
R"({{
"taker_pays":
"taker_pays":
{{
"currency": "XRP"
}},
"taker_gets":
"taker_gets":
{{
"currency": "USD",
"issuer": "{}"
@@ -1351,11 +1351,11 @@ TEST_F(RPCBookOffersHandlerTest, LedgerNonExistViaIntSequence)
auto static const kINPUT = json::parse(fmt::format(
R"({{
"ledger_index": 30,
"taker_gets":
"taker_gets":
{{
"currency": "XRP"
}},
"taker_pays":
"taker_pays":
{{
"currency": "USD",
"issuer": "{}"
@@ -1382,11 +1382,11 @@ TEST_F(RPCBookOffersHandlerTest, LedgerNonExistViaSequence)
auto static const kINPUT = json::parse(fmt::format(
R"({{
"ledger_index": "30",
"taker_gets":
"taker_gets":
{{
"currency": "XRP"
}},
"taker_pays":
"taker_pays":
{{
"currency": "USD",
"issuer": "{}"
@@ -1414,11 +1414,11 @@ TEST_F(RPCBookOffersHandlerTest, LedgerNonExistViaHash)
auto static const kINPUT = json::parse(fmt::format(
R"({{
"ledger_hash": "{}",
"taker_gets":
"taker_gets":
{{
"currency": "XRP"
}},
"taker_pays":
"taker_pays":
{{
"currency": "USD",
"issuer": "{}"
@@ -1489,11 +1489,11 @@ TEST_F(RPCBookOffersHandlerTest, Limit)
auto static const kINPUT = json::parse(fmt::format(
R"({{
"taker_gets":
"taker_gets":
{{
"currency": "XRP"
}},
"taker_pays":
"taker_pays":
{{
"currency": "USD",
"issuer": "{}"
@@ -1562,11 +1562,11 @@ TEST_F(RPCBookOffersHandlerTest, LimitMoreThanMax)
auto static const kINPUT = json::parse(fmt::format(
R"({{
"taker_gets":
"taker_gets":
{{
"currency": "XRP"
}},
"taker_pays":
"taker_pays":
{{
"currency": "USD",
"issuer": "{}"

View File

@@ -90,7 +90,7 @@ generateTestValuesForParametersTest()
{
.testName = "SourceAccountMissing",
.testJson = R"({
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"ledger_hash": "4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652"
})",
.expectedError = "invalidParams",
@@ -99,8 +99,8 @@ generateTestValuesForParametersTest()
{
.testName = "SourceAccountMalformed",
.testJson = R"({
"source_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jp",
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"source_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jp",
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"ledger_hash": "4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652"
})",
.expectedError = "actMalformed",
@@ -109,8 +109,8 @@ generateTestValuesForParametersTest()
{
.testName = "SourceAccountNotString",
.testJson = R"({
"source_account": 1234,
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"source_account": 1234,
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"ledger_hash": "4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652"
})",
.expectedError = "invalidParams",
@@ -119,7 +119,7 @@ generateTestValuesForParametersTest()
{
.testName = "DestinationAccountMissing",
.testJson = R"({
"source_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"source_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"ledger_hash": "4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652"
})",
.expectedError = "invalidParams",
@@ -128,8 +128,8 @@ generateTestValuesForParametersTest()
{
.testName = "DestinationAccountMalformed",
.testJson = R"({
"source_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jp",
"source_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jp",
"ledger_hash": "4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652"
})",
.expectedError = "actMalformed",
@@ -138,7 +138,7 @@ generateTestValuesForParametersTest()
{
.testName = "DestinationAccountNotString",
.testJson = R"({
"source_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"source_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"destination_account": 1234,
"ledger_hash": "4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652"
})",
@@ -148,8 +148,8 @@ generateTestValuesForParametersTest()
{
.testName = "LedgerHashInvalid",
.testJson = R"({
"source_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"source_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"ledger_hash": "x"
})",
.expectedError = "invalidParams",
@@ -158,8 +158,8 @@ generateTestValuesForParametersTest()
{
.testName = "LedgerHashNotString",
.testJson = R"({
"source_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"source_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"ledger_hash": 123
})",
.expectedError = "invalidParams",
@@ -168,8 +168,8 @@ generateTestValuesForParametersTest()
{
.testName = "LedgerIndexNotInt",
.testJson = R"({
"source_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"source_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"ledger_index": "x"
})",
.expectedError = "invalidParams",
@@ -178,8 +178,8 @@ generateTestValuesForParametersTest()
{
.testName = "CredentialsNotArray",
.testJson = R"({
"source_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"source_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"credentials": "x"
})",
.expectedError = "invalidParams",
@@ -188,8 +188,8 @@ generateTestValuesForParametersTest()
{
.testName = "CredentialsNotStringsInArray",
.testJson = R"({
"source_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"source_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"ledger_hash": "4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652",
"credentials": [123]
})",
@@ -199,8 +199,8 @@ generateTestValuesForParametersTest()
{
.testName = "CredentialsNotHexedStringInArray",
.testJson = R"({
"source_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"source_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"ledger_hash": "4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652",
"credentials": ["234", "432"]
})",
@@ -242,8 +242,8 @@ TEST_F(RPCDepositAuthorizedTest, LedgerNotExistViaIntSequence)
auto const handler = AnyHandler{DepositAuthorizedHandler{backend_}};
auto const req = json::parse(fmt::format(
R"({{
"source_account": "{}",
"destination_account": "{}",
"source_account": "{}",
"destination_account": "{}",
"ledger_index": {}
}})",
kACCOUNT,
@@ -269,8 +269,8 @@ TEST_F(RPCDepositAuthorizedTest, LedgerNotExistViaStringSequence)
auto const handler = AnyHandler{DepositAuthorizedHandler{backend_}};
auto const req = json::parse(fmt::format(
R"({{
"source_account": "{}",
"destination_account": "{}",
"source_account": "{}",
"destination_account": "{}",
"ledger_index": "{}"
}})",
kACCOUNT,
@@ -296,8 +296,8 @@ TEST_F(RPCDepositAuthorizedTest, LedgerNotExistViaHash)
auto const handler = AnyHandler{DepositAuthorizedHandler{backend_}};
auto const req = json::parse(fmt::format(
R"({{
"source_account": "{}",
"destination_account": "{}",
"source_account": "{}",
"destination_account": "{}",
"ledger_hash": "{}"
}})",
kACCOUNT,

View File

@@ -280,14 +280,14 @@ TEST_F(RPCFeatureHandlerTest, SuccessPathViaNameWithSingleSupportedAndEnabledRes
auto const expectedOutput = fmt::format(
R"({{
"2E2FB9CF8A44EB80F4694D38AADAE9B8B7ADAFD2F092E10068E61C98C4F092B0":
"2E2FB9CF8A44EB80F4694D38AADAE9B8B7ADAFD2F092E10068E61C98C4F092B0":
{{
"name": "fixUniversalNumber",
"enabled": true,
"name": "fixUniversalNumber",
"enabled": true,
"supported": true
}},
"ledger_hash": "{}",
"ledger_index": {},
"ledger_hash": "{}",
"ledger_index": {},
"validated": true
}})",
kLEDGER_HASH,
@@ -330,14 +330,14 @@ TEST_F(RPCFeatureHandlerTest, SuccessPathViaHashWithSingleResult)
auto const expectedOutput = fmt::format(
R"({{
"2E2FB9CF8A44EB80F4694D38AADAE9B8B7ADAFD2F092E10068E61C98C4F092B0":
"2E2FB9CF8A44EB80F4694D38AADAE9B8B7ADAFD2F092E10068E61C98C4F092B0":
{{
"name": "fixUniversalNumber",
"enabled": true,
"name": "fixUniversalNumber",
"enabled": true,
"supported": true
}},
"ledger_hash": "{}",
"ledger_index": {},
"ledger_hash": "{}",
"ledger_index": {},
"validated": true
}})",
kLEDGER_HASH,
@@ -414,21 +414,21 @@ TEST_F(RPCFeatureHandlerTest, SuccessPathWithMultipleResults)
auto const expectedOutput = fmt::format(
R"({{
"features": {{
"2E2FB9CF8A44EB80F4694D38AADAE9B8B7ADAFD2F092E10068E61C98C4F092B0":
"2E2FB9CF8A44EB80F4694D38AADAE9B8B7ADAFD2F092E10068E61C98C4F092B0":
{{
"name": "fixUniversalNumber",
"enabled": true,
"name": "fixUniversalNumber",
"enabled": true,
"supported": true
}},
"DF8B4536989BDACE3F934F29423848B9F1D76D09BE6A1FCFE7E7F06AA26ABEAD":
{{
"name": "fixRemoveNFTokenAutoTrustLine",
"enabled": false,
"name": "fixRemoveNFTokenAutoTrustLine",
"enabled": false,
"supported": false
}}
}},
"ledger_hash": "{}",
"ledger_index": {},
"ledger_hash": "{}",
"ledger_index": {},
"validated": true
}})",
kLEDGER_HASH,

View File

@@ -143,7 +143,7 @@ generateTestValuesForParametersTest()
.testName = "no_base_asset",
.testJson = R"({
"quote_asset": "USD",
"oracles":
"oracles":
[
{
"account": "rGh1VZCRBJY6rJiaFpD4LZtyHiuCkC8aeD",
@@ -159,7 +159,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"quote_asset" : "USD",
"base_asset": "asdf",
"oracles":
"oracles":
[
{
"account": "rGh1VZCRBJY6rJiaFpD4LZtyHiuCkC8aeD",
@@ -175,7 +175,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"quote_asset" : "USD",
"base_asset": "",
"oracles":
"oracles":
[
{
"account": "rGh1VZCRBJY6rJiaFpD4LZtyHiuCkC8aeD",
@@ -191,7 +191,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"quote_asset" : "USD",
"base_asset": "+aa",
"oracles":
"oracles":
[
{
"account": "rGh1VZCRBJY6rJiaFpD4LZtyHiuCkC8aeD",
@@ -206,7 +206,7 @@ generateTestValuesForParametersTest()
.testName = "no_quote_asset",
.testJson = R"({
"base_asset": "USD",
"oracles":
"oracles":
[
{
"account": "rGh1VZCRBJY6rJiaFpD4LZtyHiuCkC8aeD",
@@ -222,7 +222,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"quote_asset" : "asdf",
"base_asset": "USD",
"oracles":
"oracles":
[
{
"account": "rGh1VZCRBJY6rJiaFpD4LZtyHiuCkC8aeD",
@@ -238,7 +238,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"quote_asset" : "",
"base_asset": "USD",
"oracles":
"oracles":
[
{
"account": "rGh1VZCRBJY6rJiaFpD4LZtyHiuCkC8aeD",
@@ -254,7 +254,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"quote_asset" : "+aa",
"base_asset": "USD",
"oracles":
"oracles":
[
{
"account": "rGh1VZCRBJY6rJiaFpD4LZtyHiuCkC8aeD",
@@ -290,7 +290,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"base_asset": "USD",
"quote_asset": "XRP",
"oracles":
"oracles":
[
{
"account": "rGh1VZCRBJY6rJiaFpD4LZtyHiuCkC8aeD",
@@ -307,7 +307,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"base_asset": "USD",
"quote_asset": "XRP",
"oracles":
"oracles":
[
{
"account": "rGh1VZCRBJY6rJiaFpD4LZtyHiuCkC8aeD",
@@ -341,7 +341,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"base_asset": "USD",
"quote_asset": "XRP",
"oracles":
"oracles":
[
{
"account": "rGh1VZCRBJY6rJiaFpD4LZtyHiuCkC8aeD",
@@ -358,7 +358,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"base_asset": "USD",
"quote_asset": "XRP",
"oracles":
"oracles":
[
{
"account": "invalid",
@@ -463,7 +463,7 @@ TEST_F(RPCGetAggregatePriceHandlerTest, LedgerNotFound)
R"({{
"base_asset": "USD",
"quote_asset": "XRP",
"oracles":
"oracles":
[
{{
"account": "{}",
@@ -497,7 +497,7 @@ TEST_F(RPCGetAggregatePriceHandlerTest, OracleLedgerEntrySinglePriceData)
R"({{
"base_asset": "USD",
"quote_asset": "XRP",
"oracles":
"oracles":
[
{{
"account": "{}",
@@ -511,7 +511,7 @@ TEST_F(RPCGetAggregatePriceHandlerTest, OracleLedgerEntrySinglePriceData)
auto const expected = json::parse(fmt::format(
R"({{
"entire_set":
"entire_set":
{{
"mean": "10",
"size": 1,
@@ -546,7 +546,7 @@ TEST_F(RPCGetAggregatePriceHandlerTest, OracleLedgerEntryStrOracleDocumentId)
R"({{
"base_asset": "USD",
"quote_asset": "XRP",
"oracles":
"oracles":
[
{{
"account": "{}",
@@ -560,7 +560,7 @@ TEST_F(RPCGetAggregatePriceHandlerTest, OracleLedgerEntryStrOracleDocumentId)
auto const expected = json::parse(fmt::format(
R"({{
"entire_set":
"entire_set":
{{
"mean": "10",
"size": 1,
@@ -595,7 +595,7 @@ TEST_F(RPCGetAggregatePriceHandlerTest, PreviousTxNotFound)
R"({{
"base_asset": "JPY",
"quote_asset": "XRP",
"oracles":
"oracles":
[
{{
"account": "{}",
@@ -609,7 +609,7 @@ TEST_F(RPCGetAggregatePriceHandlerTest, PreviousTxNotFound)
auto const expected = json::parse(fmt::format(
R"({{
"entire_set":
"entire_set":
{{
"mean": "10",
"size": 1,
@@ -674,7 +674,7 @@ TEST_F(RPCGetAggregatePriceHandlerTest, NewLedgerObjectHasNoPricePair)
auto const expected = json::parse(fmt::format(
R"({{
"entire_set":
"entire_set":
{{
"mean": "10",
"size": 1,
@@ -716,7 +716,7 @@ TEST_F(RPCGetAggregatePriceHandlerTest, OracleLedgerEntryMultipleOraclesOdd)
R"({{
"base_asset": "USD",
"quote_asset": "XRP",
"oracles":
"oracles":
[
{{
"account": "{}",
@@ -742,7 +742,7 @@ TEST_F(RPCGetAggregatePriceHandlerTest, OracleLedgerEntryMultipleOraclesOdd)
auto const expected = json::parse(fmt::format(
R"({{
"entire_set":
"entire_set":
{{
"mean": "110",
"size": 3,
@@ -784,7 +784,7 @@ TEST_F(RPCGetAggregatePriceHandlerTest, OracleLedgerEntryMultipleOraclesEven)
R"({{
"base_asset": "USD",
"quote_asset": "XRP",
"oracles":
"oracles":
[
{{
"account": "{}",
@@ -816,7 +816,7 @@ TEST_F(RPCGetAggregatePriceHandlerTest, OracleLedgerEntryMultipleOraclesEven)
auto const expected = json::parse(fmt::format(
R"({{
"entire_set":
"entire_set":
{{
"mean": "92.5",
"size": 4,
@@ -859,7 +859,7 @@ TEST_F(RPCGetAggregatePriceHandlerTest, OracleLedgerEntryTrim)
"base_asset": "USD",
"quote_asset": "XRP",
"trim": {},
"oracles":
"oracles":
[
{{
"account": "{}",
@@ -892,13 +892,13 @@ TEST_F(RPCGetAggregatePriceHandlerTest, OracleLedgerEntryTrim)
auto const expected = json::parse(fmt::format(
R"({{
"entire_set":
"entire_set":
{{
"mean": "92.5",
"size": 4,
"standard_deviation": "138.8944443333378"
}},
"trimmed_set":
"trimmed_set":
{{
"mean": "30",
"size": 2,
@@ -934,7 +934,7 @@ TEST_F(RPCGetAggregatePriceHandlerTest, NoOracleEntryFound)
R"({{
"base_asset": "USD",
"quote_asset": "XRP",
"oracles":
"oracles":
[
{{
"account": "{}",
@@ -968,7 +968,7 @@ TEST_F(RPCGetAggregatePriceHandlerTest, NoMatchAssetPair)
R"({{
"base_asset": "JPY",
"quote_asset": "XRP",
"oracles":
"oracles":
[
{{
"account": "{}",
@@ -1013,7 +1013,7 @@ TEST_F(RPCGetAggregatePriceHandlerTest, TimeThresholdIsZero)
"base_asset": "USD",
"quote_asset": "XRP",
"time_threshold": {},
"oracles":
"oracles":
[
{{
"account": "{}",
@@ -1046,7 +1046,7 @@ TEST_F(RPCGetAggregatePriceHandlerTest, TimeThresholdIsZero)
auto const expected = json::parse(fmt::format(
R"({{
"entire_set":
"entire_set":
{{
"mean": "10",
"size": 1,
@@ -1093,7 +1093,7 @@ TEST_F(RPCGetAggregatePriceHandlerTest, ValidTimeThreshold)
"base_asset": "USD",
"quote_asset": "XRP",
"time_threshold": {},
"oracles":
"oracles":
[
{{
"account": "{}",
@@ -1126,7 +1126,7 @@ TEST_F(RPCGetAggregatePriceHandlerTest, ValidTimeThreshold)
auto const expected = json::parse(fmt::format(
R"({{
"entire_set":
"entire_set":
{{
"mean": "15",
"size": 2,
@@ -1173,7 +1173,7 @@ TEST_F(RPCGetAggregatePriceHandlerTest, TimeThresholdTooLong)
"base_asset": "USD",
"quote_asset": "XRP",
"time_threshold": {},
"oracles":
"oracles":
[
{{
"account": "{}",
@@ -1206,7 +1206,7 @@ TEST_F(RPCGetAggregatePriceHandlerTest, TimeThresholdTooLong)
auto const expected = json::parse(fmt::format(
R"({{
"entire_set":
"entire_set":
{{
"mean": "92.5",
"size": 4,
@@ -1252,7 +1252,7 @@ TEST_F(RPCGetAggregatePriceHandlerTest, TimeThresholdIncludeOldest)
"base_asset": "USD",
"quote_asset": "XRP",
"time_threshold": {},
"oracles":
"oracles":
[
{{
"account": "{}",
@@ -1285,7 +1285,7 @@ TEST_F(RPCGetAggregatePriceHandlerTest, TimeThresholdIncludeOldest)
auto const expected = json::parse(fmt::format(
R"({{
"entire_set":
"entire_set":
{{
"mean": "92.5",
"size": 4,
@@ -1336,7 +1336,7 @@ TEST_F(RPCGetAggregatePriceHandlerTest, FromTx)
R"({{
"base_asset": "JPY",
"quote_asset": "XRP",
"oracles":
"oracles":
[
{{
"account": "{}",
@@ -1350,7 +1350,7 @@ TEST_F(RPCGetAggregatePriceHandlerTest, FromTx)
auto const expected = json::parse(fmt::format(
R"({{
"entire_set":
"entire_set":
{{
"mean": "10",
"size": 1,
@@ -1413,7 +1413,7 @@ TEST_F(RPCGetAggregatePriceHandlerTest, NotFoundInTxHistory)
R"({{
"base_asset": "JPY",
"quote_asset": "XRP",
"oracles":
"oracles":
[
{{
"account": "{}",

View File

@@ -910,7 +910,7 @@ generateTestValuesForParametersTest()
.testName = "EmptyAMMAssetJson",
.testJson = fmt::format(
R"({{
"amm":
"amm":
{{
"asset":{{}},
"asset2":
@@ -930,7 +930,7 @@ generateTestValuesForParametersTest()
.testName = "EmptyAMMAsset2Json",
.testJson = fmt::format(
R"({{
"amm":
"amm":
{{
"asset2":{{}},
"asset":
@@ -950,7 +950,7 @@ generateTestValuesForParametersTest()
.testName = "MissingAMMAsset2Json",
.testJson = fmt::format(
R"({{
"amm":
"amm":
{{
"asset":
{{
@@ -969,7 +969,7 @@ generateTestValuesForParametersTest()
.testName = "MissingAMMAssetJson",
.testJson = fmt::format(
R"({{
"amm":
"amm":
{{
"asset2":
{{
@@ -988,7 +988,7 @@ generateTestValuesForParametersTest()
.testName = "AMMAssetNotJson",
.testJson = fmt::format(
R"({{
"amm":
"amm":
{{
"asset": "invalid",
"asset2":
@@ -1008,7 +1008,7 @@ generateTestValuesForParametersTest()
.testName = "AMMAsset2NotJson",
.testJson = fmt::format(
R"({{
"amm":
"amm":
{{
"asset2": "invalid",
"asset":
@@ -1028,7 +1028,7 @@ generateTestValuesForParametersTest()
.testName = "WrongAMMAssetCurrency",
.testJson = fmt::format(
R"({{
"amm":
"amm":
{{
"asset2":
{{
@@ -1051,7 +1051,7 @@ generateTestValuesForParametersTest()
.testName = "WrongAMMAssetIssuer",
.testJson = fmt::format(
R"({{
"amm":
"amm":
{{
"asset2":
{{
@@ -1074,7 +1074,7 @@ generateTestValuesForParametersTest()
.testName = "MissingAMMAssetIssuerForNonXRP",
.testJson = fmt::format(
R"({{
"amm":
"amm":
{{
"asset2":
{{
@@ -1097,7 +1097,7 @@ generateTestValuesForParametersTest()
.testName = "AMMAssetHasIssuerForXRP",
.testJson = fmt::format(
R"({{
"amm":
"amm":
{{
"asset2":
{{
@@ -1122,7 +1122,7 @@ generateTestValuesForParametersTest()
.testName = "MissingAMMAssetCurrency",
.testJson = fmt::format(
R"({{
"amm":
"amm":
{{
"asset2":
{{
@@ -1143,7 +1143,7 @@ generateTestValuesForParametersTest()
.testName = "BridgeMissingBridgeAccount",
.testJson = fmt::format(
R"({{
"bridge":
"bridge":
{{
"LockingChainDoor": "{}",
"IssuingChainDoor": "{}",
@@ -1171,7 +1171,7 @@ generateTestValuesForParametersTest()
.testJson = fmt::format(
R"({{
"bridge_account": "{}",
"bridge":
"bridge":
{{
"LockingChainDoor": "{}",
"IssuingChainDoor": "{}",
@@ -1200,7 +1200,7 @@ generateTestValuesForParametersTest()
.testJson = fmt::format(
R"({{
"bridge_account": "{}",
"bridge":
"bridge":
{{
"LockingChainDoor": "{}",
"IssuingChainDoor": "{}",
@@ -1229,7 +1229,7 @@ generateTestValuesForParametersTest()
.testJson = fmt::format(
R"({{
"bridge_account": "{}",
"bridge":
"bridge":
{{
"LockingChainDoor": "{}",
"IssuingChainDoor": "{}",
@@ -1252,7 +1252,7 @@ generateTestValuesForParametersTest()
.testJson = fmt::format(
R"({{
"bridge_account": "abcd",
"bridge":
"bridge":
{{
"LockingChainDoor": "{}",
"IssuingChainDoor": "{}",
@@ -1280,7 +1280,7 @@ generateTestValuesForParametersTest()
.testJson = fmt::format(
R"({{
"bridge_account": "{}",
"bridge":
"bridge":
{{
"LockingChainDoor": "{}",
"IssuingChainDoor": "abcd",
@@ -1308,7 +1308,7 @@ generateTestValuesForParametersTest()
.testJson = fmt::format(
R"({{
"bridge_account": "{}",
"bridge":
"bridge":
{{
"LockingChainDoor": "{}",
"IssuingChainDoor": "{}",
@@ -1336,7 +1336,7 @@ generateTestValuesForParametersTest()
.testJson = fmt::format(
R"({{
"bridge_account": "{}",
"bridge":
"bridge":
{{
"LockingChainDoor": "{}",
"IssuingChainDoor": "{}",
@@ -1364,7 +1364,7 @@ generateTestValuesForParametersTest()
.testJson = fmt::format(
R"({{
"bridge_account": "{}",
"bridge":
"bridge":
{{
"LockingChainDoor": "{}",
"IssuingChainDoor": "{}",
@@ -1394,7 +1394,7 @@ generateTestValuesForParametersTest()
.testJson = fmt::format(
R"({{
"bridge_account": "{}",
"bridge":
"bridge":
{{
"LockingChainDoor": "{}",
"IssuingChainDoor": "{}",
@@ -1420,7 +1420,7 @@ generateTestValuesForParametersTest()
.testJson = fmt::format(
R"({{
"bridge_account": "{}",
"bridge":
"bridge":
{{
"IssuingChainDoor": "{}",
"LockingChainIssue":
@@ -1448,7 +1448,7 @@ generateTestValuesForParametersTest()
.testJson = fmt::format(
R"({{
"bridge_account": "{}",
"bridge":
"bridge":
{{
"LockingChainDoor": "{}",
"LockingChainIssue":
@@ -1474,7 +1474,7 @@ generateTestValuesForParametersTest()
.testJson = fmt::format(
R"({{
"bridge_account": "{}",
"bridge":
"bridge":
{{
"IssuingChainDoor": "{}",
"LockingChainDoor": "{}",
@@ -1498,7 +1498,7 @@ generateTestValuesForParametersTest()
.testJson = fmt::format(
R"({{
"bridge_account": "{}",
"bridge":
"bridge":
{{
"IssuingChainDoor": "{}",
"LockingChainDoor": "{}",
@@ -1541,7 +1541,7 @@ generateTestValuesForParametersTest()
.testName = "OwnedClaimIdJsonMissingClaimId",
.testJson = fmt::format(
R"({{
"xchain_owned_claim_id":
"xchain_owned_claim_id":
{{
"LockingChainDoor": "{}",
"IssuingChainDoor": "{}",
@@ -1568,7 +1568,7 @@ generateTestValuesForParametersTest()
.testName = "OwnedClaimIdJsonMissingDoor",
.testJson = fmt::format(
R"({{
"xchain_owned_claim_id":
"xchain_owned_claim_id":
{{
"xchain_owned_claim_id": 10,
"LockingChainDoor": "{}",
@@ -1594,7 +1594,7 @@ generateTestValuesForParametersTest()
.testName = "OwnedClaimIdJsonMissingIssue",
.testJson = fmt::format(
R"({{
"xchain_owned_claim_id":
"xchain_owned_claim_id":
{{
"xchain_owned_claim_id": 10,
"LockingChainDoor": "{}",
@@ -1616,7 +1616,7 @@ generateTestValuesForParametersTest()
.testName = "OwnedClaimIdJsonInvalidDoor",
.testJson = fmt::format(
R"({{
"xchain_owned_claim_id":
"xchain_owned_claim_id":
{{
"xchain_owned_claim_id": 10,
"LockingChainDoor": "abcd",
@@ -1643,7 +1643,7 @@ generateTestValuesForParametersTest()
.testName = "OwnedClaimIdJsonInvalidIssue",
.testJson = fmt::format(
R"({{
"xchain_owned_claim_id":
"xchain_owned_claim_id":
{{
"xchain_owned_claim_id": 10,
"LockingChainDoor": "{}",
@@ -1677,7 +1677,7 @@ generateTestValuesForParametersTest()
.testName = "OwnedCreateAccountClaimIdJsonMissingClaimId",
.testJson = fmt::format(
R"({{
"xchain_owned_create_account_claim_id":
"xchain_owned_create_account_claim_id":
{{
"LockingChainDoor": "{}",
"IssuingChainDoor": "{}",
@@ -1704,7 +1704,7 @@ generateTestValuesForParametersTest()
.testName = "OwnedCreateAccountClaimIdJsonMissingDoor",
.testJson = fmt::format(
R"({{
"xchain_owned_create_account_claim_id":
"xchain_owned_create_account_claim_id":
{{
"xchain_owned_create_account_claim_id": 10,
"LockingChainDoor": "{}",
@@ -1730,7 +1730,7 @@ generateTestValuesForParametersTest()
.testName = "OwnedCreateAccountClaimIdJsonMissingIssue",
.testJson = fmt::format(
R"({{
"xchain_owned_create_account_claim_id":
"xchain_owned_create_account_claim_id":
{{
"xchain_owned_create_account_claim_id": 10,
"LockingChainDoor": "{}",
@@ -1752,7 +1752,7 @@ generateTestValuesForParametersTest()
.testName = "OwnedCreateAccountClaimIdJsonInvalidDoor",
.testJson = fmt::format(
R"({{
"xchain_owned_create_account_claim_id":
"xchain_owned_create_account_claim_id":
{{
"xchain_owned_create_account_claim_id": 10,
"LockingChainDoor": "abcd",
@@ -1779,7 +1779,7 @@ generateTestValuesForParametersTest()
.testName = "OwnedCreateAccountClaimIdJsonInvalidIssue",
.testJson = fmt::format(
R"({{
"xchain_owned_create_account_claim_id":
"xchain_owned_create_account_claim_id":
{{
"xchain_owned_create_account_claim_id": 10,
"LockingChainDoor": "{}",

View File

@@ -82,8 +82,8 @@ TEST_F(RPCMPTHoldersHandlerTest, NonHexLedgerHash)
runSpawn([this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{MPTHoldersHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"mpt_issuance_id": "{}",
R"({{
"mpt_issuance_id": "{}",
"ledger_hash": "xxx"
}})",
kMPT_ID
@@ -103,7 +103,7 @@ TEST_F(RPCMPTHoldersHandlerTest, NonStringLedgerHash)
auto const handler = AnyHandler{MPTHoldersHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"mpt_issuance_id": "{}",
"mpt_issuance_id": "{}",
"ledger_hash": 123
}})",
kMPT_ID
@@ -122,8 +122,8 @@ TEST_F(RPCMPTHoldersHandlerTest, InvalidLedgerIndexString)
runSpawn([this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{MPTHoldersHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"mpt_issuance_id": "{}",
R"({{
"mpt_issuance_id": "{}",
"ledger_index": "notvalidated"
}})",
kMPT_ID
@@ -142,7 +142,7 @@ TEST_F(RPCMPTHoldersHandlerTest, MPTIDInvalidFormat)
{
runSpawn([this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{MPTHoldersHandler{backend_}};
auto const input = json::parse(R"({
auto const input = json::parse(R"({
"mpt_issuance_id": "xxx"
})");
auto const output = handler.process(input, Context{.yield = std::ref(yield)});
@@ -172,7 +172,7 @@ TEST_F(RPCMPTHoldersHandlerTest, MPTIDNotString)
{
runSpawn([this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{MPTHoldersHandler{backend_}};
auto const input = json::parse(R"({
auto const input = json::parse(R"({
"mpt_issuance_id": 12
})");
auto const output = handler.process(input, Context{.yield = std::ref(yield)});
@@ -190,7 +190,7 @@ TEST_F(RPCMPTHoldersHandlerTest, MarkerInvalidFormat)
runSpawn([this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{MPTHoldersHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
R"({{
"mpt_issuance_id": "{}",
"marker": "xxx"
}})",
@@ -210,7 +210,7 @@ TEST_F(RPCMPTHoldersHandlerTest, MarkerNotString)
runSpawn([this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{MPTHoldersHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
R"({{
"mpt_issuance_id": "{}",
"marker": 1
}})",
@@ -257,7 +257,7 @@ TEST_F(RPCMPTHoldersHandlerTest, NonExistLedgerViaLedgerStringIndex)
// mock fetchLedgerBySequence return empty
EXPECT_CALL(*backend_, fetchLedgerBySequence).WillOnce(Return(std::optional<ripple::LedgerInfo>{}));
auto const input = json::parse(fmt::format(
R"({{
R"({{
"mpt_issuance_id": "{}",
"ledger_index": "4"
}})",
@@ -278,7 +278,7 @@ TEST_F(RPCMPTHoldersHandlerTest, NonExistLedgerViaLedgerIntIndex)
// mock fetchLedgerBySequence return empty
EXPECT_CALL(*backend_, fetchLedgerBySequence).WillOnce(Return(std::optional<ripple::LedgerInfo>{}));
auto const input = json::parse(fmt::format(
R"({{
R"({{
"mpt_issuance_id": "{}",
"ledger_index": 4
}})",
@@ -303,7 +303,7 @@ TEST_F(RPCMPTHoldersHandlerTest, NonExistLedgerViaLedgerHash2)
ON_CALL(*backend_, fetchLedgerByHash(ripple::uint256{kLEDGER_HASH}, _)).WillByDefault(Return(ledgerinfo));
EXPECT_CALL(*backend_, fetchLedgerByHash).Times(1);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"mpt_issuance_id": "{}",
"ledger_hash": "{}"
}})",
@@ -327,7 +327,7 @@ TEST_F(RPCMPTHoldersHandlerTest, NonExistLedgerViaLedgerIndex2)
// differ from previous logic
EXPECT_CALL(*backend_, fetchLedgerBySequence).Times(0);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"mpt_issuance_id": "{}",
"ledger_index": "31"
}})",

View File

@@ -67,8 +67,8 @@ TEST_F(RPCNFTBuyOffersHandlerTest, NonHexLedgerHash)
runSpawn([this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{NFTBuyOffersHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"nft_id": "{}",
R"({{
"nft_id": "{}",
"ledger_hash": "xxx"
}})",
kNFT_ID
@@ -87,8 +87,8 @@ TEST_F(RPCNFTBuyOffersHandlerTest, LimitNotInt)
runSpawn([this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{NFTBuyOffersHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"nft_id": "{}",
R"({{
"nft_id": "{}",
"limit": "xxx"
}})",
kNFT_ID
@@ -106,8 +106,8 @@ TEST_F(RPCNFTBuyOffersHandlerTest, LimitNegative)
runSpawn([this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{NFTBuyOffersHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"nft_id": "{}",
R"({{
"nft_id": "{}",
"limit": -1
}})",
kNFT_ID
@@ -125,8 +125,8 @@ TEST_F(RPCNFTBuyOffersHandlerTest, LimitZero)
runSpawn([this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{NFTBuyOffersHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"nft_id": "{}",
R"({{
"nft_id": "{}",
"limit": 0
}})",
kNFT_ID
@@ -145,7 +145,7 @@ TEST_F(RPCNFTBuyOffersHandlerTest, NonStringLedgerHash)
auto const handler = AnyHandler{NFTBuyOffersHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"nft_id": "{}",
"nft_id": "{}",
"ledger_hash": 123
}})",
kNFT_ID
@@ -164,8 +164,8 @@ TEST_F(RPCNFTBuyOffersHandlerTest, InvalidLedgerIndexString)
runSpawn([this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{NFTBuyOffersHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"nft_id": "{}",
R"({{
"nft_id": "{}",
"ledger_index": "notvalidated"
}})",
kNFT_ID
@@ -184,7 +184,7 @@ TEST_F(RPCNFTBuyOffersHandlerTest, NFTIDInvalidFormat)
{
runSpawn([this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{NFTBuyOffersHandler{backend_}};
auto const input = json::parse(R"({
auto const input = json::parse(R"({
"nft_id": "00080000B4F4AFC5FBCBD76873F18006173D2193467D3EE7"
})");
auto const output = handler.process(input, Context{.yield = yield});
@@ -200,7 +200,7 @@ TEST_F(RPCNFTBuyOffersHandlerTest, NFTIDNotString)
{
runSpawn([this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{NFTBuyOffersHandler{backend_}};
auto const input = json::parse(R"({
auto const input = json::parse(R"({
"nft_id": 12
})");
auto const output = handler.process(input, Context{.yield = yield});
@@ -246,7 +246,7 @@ TEST_F(RPCNFTBuyOffersHandlerTest, NonExistLedgerViaLedgerIndex)
ON_CALL(*backend_, fetchLedgerBySequence).WillByDefault(Return(std::optional<ripple::LedgerHeader>{}));
EXPECT_CALL(*backend_, fetchLedgerBySequence).Times(1);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"nft_id": "{}",
"ledger_index": "4"
}})",
@@ -271,7 +271,7 @@ TEST_F(RPCNFTBuyOffersHandlerTest, NonExistLedgerViaLedgerHash2)
ON_CALL(*backend_, fetchLedgerByHash(ripple::uint256{kLEDGER_HASH}, _)).WillByDefault(Return(ledgerHeader));
EXPECT_CALL(*backend_, fetchLedgerByHash).Times(1);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"nft_id": "{}",
"ledger_hash": "{}"
}})",
@@ -295,7 +295,7 @@ TEST_F(RPCNFTBuyOffersHandlerTest, NonExistLedgerViaLedgerIndex2)
// differ from previous logic
EXPECT_CALL(*backend_, fetchLedgerBySequence).Times(0);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"nft_id": "{}",
"ledger_index": "31"
}})",
@@ -342,8 +342,8 @@ TEST_F(RPCNFTBuyOffersHandlerTest, MarkerNotString)
runSpawn([this](auto yield) {
auto const handler = AnyHandler{NFTBuyOffersHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"nft_id": "{}",
R"({{
"nft_id": "{}",
"marker": 9
}})",
kNFT_ID
@@ -364,7 +364,7 @@ TEST_F(RPCNFTBuyOffersHandlerTest, InvalidMarker)
runSpawn([this](auto yield) {
auto const handler = AnyHandler{NFTBuyOffersHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
R"({{
"nft_id": "{}",
"marker": "123invalid"
}})",
@@ -380,8 +380,8 @@ TEST_F(RPCNFTBuyOffersHandlerTest, InvalidMarker)
runSpawn([&, this](auto yield) {
auto const handler = AnyHandler{NFTBuyOffersHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"nft_id": "{}",
R"({{
"nft_id": "{}",
"marker": 250
}})",
kNFT_ID
@@ -617,8 +617,8 @@ TEST_F(RPCNFTBuyOffersHandlerTest, ResultsWithoutMarkerForInputWithMarkerAndLimi
runSpawn([this](auto yield) {
auto const handler = AnyHandler{NFTBuyOffersHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"nft_id": "{}",
R"({{
"nft_id": "{}",
"limit": 49
}})",
kNFT_ID
@@ -630,8 +630,8 @@ TEST_F(RPCNFTBuyOffersHandlerTest, ResultsWithoutMarkerForInputWithMarkerAndLimi
runSpawn([this](auto yield) {
auto const handler = AnyHandler{NFTBuyOffersHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"nft_id": "{}",
R"({{
"nft_id": "{}",
"limit": 501
}})",
kNFT_ID

View File

@@ -178,7 +178,7 @@ generateTestValuesForParametersTest()
.testName = "MarkerLedgerNotInt",
.testJson = R"({
"nft_id":"00010000A7CAD27B688D14BA1A9FA5366554D6ADCF9CE0875B974D9F00000004",
"marker":
"marker":
{
"seq": "string",
"ledger": 1
@@ -191,7 +191,7 @@ generateTestValuesForParametersTest()
.testName = "MarkerSeqNotInt",
.testJson = R"({
"nft_id":"00010000A7CAD27B688D14BA1A9FA5366554D6ADCF9CE0875B974D9F00000004",
"marker":
"marker":
{
"ledger": "string",
"seq": 1
@@ -231,7 +231,7 @@ generateTestValuesForParametersTest()
NFTHistoryParamTestCaseBundle{
.testName = "LedgerIndexMaxMinAndLedgerIndex",
.testJson = R"({
"nft_id":"00010000A7CAD27B688D14BA1A9FA5366554D6ADCF9CE0875B974D9F00000004",
"nft_id":"00010000A7CAD27B688D14BA1A9FA5366554D6ADCF9CE0875B974D9F00000004",
"ledger_index_max": 20,
"ledger_index_min": 11,
"ledger_index": 10

View File

@@ -62,8 +62,8 @@ TEST_F(RPCNFTInfoHandlerTest, NonHexLedgerHash)
runSpawn([this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{NFTInfoHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"nft_id": "{}",
R"({{
"nft_id": "{}",
"ledger_hash": "xxx"
}})",
kNFT_ID
@@ -83,7 +83,7 @@ TEST_F(RPCNFTInfoHandlerTest, NonStringLedgerHash)
auto const handler = AnyHandler{NFTInfoHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"nft_id": "{}",
"nft_id": "{}",
"ledger_hash": 123
}})",
kNFT_ID
@@ -102,8 +102,8 @@ TEST_F(RPCNFTInfoHandlerTest, InvalidLedgerIndexString)
runSpawn([this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{NFTInfoHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"nft_id": "{}",
R"({{
"nft_id": "{}",
"ledger_index": "notvalidated"
}})",
kNFT_ID
@@ -122,7 +122,7 @@ TEST_F(RPCNFTInfoHandlerTest, NFTIDInvalidFormat)
{
runSpawn([this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{NFTInfoHandler{backend_}};
auto const input = json::parse(R"({
auto const input = json::parse(R"({
"nft_id": "00080000B4F4AFC5FBCBD76873F18006173D2193467D3EE7"
})");
auto const output = handler.process(input, Context{.yield = yield});
@@ -138,7 +138,7 @@ TEST_F(RPCNFTInfoHandlerTest, NFTIDNotString)
{
runSpawn([this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{NFTInfoHandler{backend_}};
auto const input = json::parse(R"({
auto const input = json::parse(R"({
"nft_id": 12
})");
auto const output = handler.process(input, Context{.yield = yield});
@@ -184,7 +184,7 @@ TEST_F(RPCNFTInfoHandlerTest, NonExistLedgerViaLedgerStringIndex)
ON_CALL(*backend_, fetchLedgerBySequence).WillByDefault(Return(std::optional<ripple::LedgerHeader>{}));
EXPECT_CALL(*backend_, fetchLedgerBySequence).Times(1);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"nft_id": "{}",
"ledger_index": "4"
}})",
@@ -206,7 +206,7 @@ TEST_F(RPCNFTInfoHandlerTest, NonExistLedgerViaLedgerIntIndex)
ON_CALL(*backend_, fetchLedgerBySequence).WillByDefault(Return(std::optional<ripple::LedgerHeader>{}));
EXPECT_CALL(*backend_, fetchLedgerBySequence).Times(1);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"nft_id": "{}",
"ledger_index": 4
}})",
@@ -231,7 +231,7 @@ TEST_F(RPCNFTInfoHandlerTest, NonExistLedgerViaLedgerHash2)
ON_CALL(*backend_, fetchLedgerByHash(ripple::uint256{kLEDGER_HASH}, _)).WillByDefault(Return(ledgerHeader));
EXPECT_CALL(*backend_, fetchLedgerByHash).Times(1);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"nft_id": "{}",
"ledger_hash": "{}"
}})",
@@ -255,7 +255,7 @@ TEST_F(RPCNFTInfoHandlerTest, NonExistLedgerViaLedgerIndex2)
// differ from previous logic
EXPECT_CALL(*backend_, fetchLedgerBySequence).Times(0);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"nft_id": "{}",
"ledger_index": "31"
}})",

View File

@@ -67,8 +67,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, LimitNotInt)
runSpawn([this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{NFTSellOffersHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"nft_id": "{}",
R"({{
"nft_id": "{}",
"limit": "xxx"
}})",
kNFT_ID
@@ -86,8 +86,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, LimitNegative)
runSpawn([this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{NFTSellOffersHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"nft_id": "{}",
R"({{
"nft_id": "{}",
"limit": -1
}})",
kNFT_ID
@@ -105,8 +105,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, LimitZero)
runSpawn([this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{NFTSellOffersHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"nft_id": "{}",
R"({{
"nft_id": "{}",
"limit": 0
}})",
kNFT_ID
@@ -124,8 +124,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, NonHexLedgerHash)
runSpawn([this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{NFTSellOffersHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"nft_id": "{}",
R"({{
"nft_id": "{}",
"ledger_hash": "xxx"
}})",
kNFT_ID
@@ -145,7 +145,7 @@ TEST_F(RPCNFTSellOffersHandlerTest, NonStringLedgerHash)
auto const handler = AnyHandler{NFTSellOffersHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"nft_id": "{}",
"nft_id": "{}",
"ledger_hash": 123
}})",
kNFT_ID
@@ -164,8 +164,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, InvalidLedgerIndexString)
runSpawn([this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{NFTSellOffersHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"nft_id": "{}",
R"({{
"nft_id": "{}",
"ledger_index": "notvalidated"
}})",
kNFT_ID
@@ -184,7 +184,7 @@ TEST_F(RPCNFTSellOffersHandlerTest, NFTIDInvalidFormat)
{
runSpawn([this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{NFTSellOffersHandler{backend_}};
auto const input = json::parse(R"({
auto const input = json::parse(R"({
"nft_id": "00080000B4F4AFC5FBCBD76873F18006173D2193467D3EE7"
})");
auto const output = handler.process(input, Context{.yield = yield});
@@ -200,7 +200,7 @@ TEST_F(RPCNFTSellOffersHandlerTest, NFTIDNotString)
{
runSpawn([this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{NFTSellOffersHandler{backend_}};
auto const input = json::parse(R"({
auto const input = json::parse(R"({
"nft_id": 12
})");
auto const output = handler.process(input, Context{.yield = yield});
@@ -246,7 +246,7 @@ TEST_F(RPCNFTSellOffersHandlerTest, NonExistLedgerViaLedgerIndex)
ON_CALL(*backend_, fetchLedgerBySequence).WillByDefault(Return(std::optional<ripple::LedgerHeader>{}));
EXPECT_CALL(*backend_, fetchLedgerBySequence).Times(1);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"nft_id": "{}",
"ledger_index": "4"
}})",
@@ -271,7 +271,7 @@ TEST_F(RPCNFTSellOffersHandlerTest, NonExistLedgerViaLedgerHash2)
ON_CALL(*backend_, fetchLedgerByHash(ripple::uint256{kLEDGER_HASH}, _)).WillByDefault(Return(ledgerHeader));
EXPECT_CALL(*backend_, fetchLedgerByHash).Times(1);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"nft_id": "{}",
"ledger_hash": "{}"
}})",
@@ -295,7 +295,7 @@ TEST_F(RPCNFTSellOffersHandlerTest, NonExistLedgerViaLedgerIndex2)
// differ from previous logic
EXPECT_CALL(*backend_, fetchLedgerBySequence).Times(0);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"nft_id": "{}",
"ledger_index": "31"
}})",
@@ -342,8 +342,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, MarkerNotString)
runSpawn([this](auto yield) {
auto const handler = AnyHandler{NFTSellOffersHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"nft_id": "{}",
R"({{
"nft_id": "{}",
"marker": 9
}})",
kNFT_ID
@@ -364,7 +364,7 @@ TEST_F(RPCNFTSellOffersHandlerTest, InvalidMarker)
runSpawn([this](auto yield) {
auto const handler = AnyHandler{NFTSellOffersHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
R"({{
"nft_id": "{}",
"marker": "123invalid"
}})",
@@ -380,8 +380,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, InvalidMarker)
runSpawn([&, this](auto yield) {
auto const handler = AnyHandler{NFTSellOffersHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"nft_id": "{}",
R"({{
"nft_id": "{}",
"marker": 250
}})",
kNFT_ID
@@ -617,8 +617,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, ResultsWithoutMarkerForInputWithMarkerAndLim
runSpawn([this](auto yield) {
auto const handler = AnyHandler{NFTSellOffersHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"nft_id": "{}",
R"({{
"nft_id": "{}",
"limit": 49
}})",
kNFT_ID
@@ -630,8 +630,8 @@ TEST_F(RPCNFTSellOffersHandlerTest, ResultsWithoutMarkerForInputWithMarkerAndLim
runSpawn([this](auto yield) {
auto const handler = AnyHandler{NFTSellOffersHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"nft_id": "{}",
R"({{
"nft_id": "{}",
"limit": 501
}})",
kNFT_ID

View File

@@ -106,8 +106,8 @@ TEST_F(RPCNFTsByIssuerHandlerTest, NonHexLedgerHash)
runSpawn([this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{NFTsByIssuerHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"issuer": "{}",
R"({{
"issuer": "{}",
"ledger_hash": "xxx"
}})",
kACCOUNT
@@ -127,7 +127,7 @@ TEST_F(RPCNFTsByIssuerHandlerTest, NonStringLedgerHash)
auto const handler = AnyHandler{NFTsByIssuerHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"issuer": "{}",
"issuer": "{}",
"ledger_hash": 123
}})",
kACCOUNT
@@ -146,8 +146,8 @@ TEST_F(RPCNFTsByIssuerHandlerTest, InvalidLedgerIndexString)
runSpawn([this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{NFTsByIssuerHandler{backend_}};
auto const input = json::parse(fmt::format(
R"({{
"issuer": "{}",
R"({{
"issuer": "{}",
"ledger_index": "notvalidated"
}})",
kACCOUNT
@@ -166,7 +166,7 @@ TEST_F(RPCNFTsByIssuerHandlerTest, NFTIssuerInvalidFormat)
{
runSpawn([this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{NFTsByIssuerHandler{backend_}};
auto const input = json::parse(R"({
auto const input = json::parse(R"({
"issuer": "xxx"
})");
auto const output = handler.process(input, Context{.yield = std::ref(yield)});
@@ -196,7 +196,7 @@ TEST_F(RPCNFTsByIssuerHandlerTest, NFTIssuerNotString)
{
runSpawn([this](boost::asio::yield_context yield) {
auto const handler = AnyHandler{NFTsByIssuerHandler{backend_}};
auto const input = json::parse(R"({
auto const input = json::parse(R"({
"issuer": 12
})");
auto const output = handler.process(input, Context{.yield = std::ref(yield)});
@@ -241,7 +241,7 @@ TEST_F(RPCNFTsByIssuerHandlerTest, NonExistLedgerViaLedgerStringIndex)
// mock fetchLedgerBySequence return empty
EXPECT_CALL(*backend_, fetchLedgerBySequence).WillOnce(Return(std::optional<ripple::LedgerHeader>{}));
auto const input = json::parse(fmt::format(
R"({{
R"({{
"issuer": "{}",
"ledger_index": "4"
}})",
@@ -262,7 +262,7 @@ TEST_F(RPCNFTsByIssuerHandlerTest, NonExistLedgerViaLedgerIntIndex)
// mock fetchLedgerBySequence return empty
EXPECT_CALL(*backend_, fetchLedgerBySequence).WillOnce(Return(std::optional<ripple::LedgerHeader>{}));
auto const input = json::parse(fmt::format(
R"({{
R"({{
"issuer": "{}",
"ledger_index": 4
}})",
@@ -287,7 +287,7 @@ TEST_F(RPCNFTsByIssuerHandlerTest, NonExistLedgerViaLedgerHash2)
ON_CALL(*backend_, fetchLedgerByHash(ripple::uint256{kLEDGER_HASH}, _)).WillByDefault(Return(ledgerHeader));
EXPECT_CALL(*backend_, fetchLedgerByHash).Times(1);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"issuer": "{}",
"ledger_hash": "{}"
}})",
@@ -311,7 +311,7 @@ TEST_F(RPCNFTsByIssuerHandlerTest, NonExistLedgerViaLedgerIndex2)
// differ from previous logic
EXPECT_CALL(*backend_, fetchLedgerBySequence).Times(0);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"issuer": "{}",
"ledger_index": "31"
}})",

View File

@@ -205,7 +205,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"books": [
{
"taker_pays":
"taker_pays":
{
"currency": "XRP"
},
@@ -221,7 +221,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"books": [
{
"taker_gets":
"taker_gets":
{
"currency": "XRP"
},
@@ -237,7 +237,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"books": [
{
"taker_gets":
"taker_gets":
{
"currency": "XRP"
},
@@ -253,7 +253,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"books": [
{
"taker_pays":
"taker_pays":
{
"currency": "XRP"
},
@@ -269,7 +269,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"books": [
{
"taker_gets":
"taker_gets":
{
"currency": "XRP"
},
@@ -288,7 +288,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"books": [
{
"taker_pays":
"taker_pays":
{
"currency": "XRP"
},
@@ -307,7 +307,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"books": [
{
"taker_gets":
"taker_gets":
{
"currency": "XRP"
},
@@ -326,7 +326,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"books": [
{
"taker_pays":
"taker_pays":
{
"currency": "XRP"
},
@@ -345,7 +345,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"books": [
{
"taker_gets":
"taker_gets":
{
"currency": "XRP"
},
@@ -363,7 +363,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"books": [
{
"taker_pays":
"taker_pays":
{
"currency": "XRP"
},
@@ -381,7 +381,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"books": [
{
"taker_gets":
"taker_gets":
{
"currency": "XRP"
},
@@ -400,7 +400,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"books": [
{
"taker_pays":
"taker_pays":
{
"currency": "XRP"
},
@@ -419,7 +419,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"books": [
{
"taker_gets":
"taker_gets":
{
"currency": "XRP"
},
@@ -438,7 +438,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"books": [
{
"taker_pays":
"taker_pays":
{
"currency": "XRP"
},
@@ -457,7 +457,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"books": [
{
"taker_pays":
"taker_pays":
{
"currency": "USD",
"issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
@@ -477,7 +477,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"books": [
{
"taker_pays":
"taker_pays":
{
"currency": "XRP",
"issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
@@ -497,7 +497,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"books": [
{
"taker_pays":
"taker_pays":
{
"currency": "XRP"
},
@@ -515,7 +515,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"books": [
{
"taker_pays":
"taker_pays":
{
"currency": "XRP"
},
@@ -535,7 +535,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"books": [
{
"taker_pays":
"taker_pays":
{
"currency": "XRP"
},
@@ -555,7 +555,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"books": [
{
"taker_pays":
"taker_pays":
{
"currency": "XRP"
},
@@ -575,7 +575,7 @@ generateTestValuesForParametersTest()
.testJson = R"({
"books": [
{
"taker_pays":
"taker_pays":
{
"currency": "XRP"
},
@@ -654,7 +654,7 @@ TEST_F(RPCSubscribeHandlerTest, StreamsWithoutLedger)
TEST_F(RPCSubscribeHandlerTest, StreamsLedger)
{
static constexpr auto kEXPECTED_OUTPUT =
R"({
R"({
"validated_ledgers":"10-30",
"ledger_index":30,
"ledger_hash":"4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652",
@@ -734,14 +734,14 @@ TEST_F(RPCSubscribeHandlerTest, JustBooks)
{
auto const input = json::parse(fmt::format(
R"({{
"books":
"books":
[
{{
"taker_pays":
"taker_pays":
{{
"currency": "XRP"
}},
"taker_gets":
"taker_gets":
{{
"currency": "USD",
"issuer": "{}"
@@ -766,14 +766,14 @@ TEST_F(RPCSubscribeHandlerTest, BooksBothSet)
{
auto const input = json::parse(fmt::format(
R"({{
"books":
"books":
[
{{
"taker_pays":
"taker_pays":
{{
"currency": "XRP"
}},
"taker_gets":
"taker_gets":
{{
"currency": "USD",
"issuer": "{}"
@@ -799,14 +799,14 @@ TEST_F(RPCSubscribeHandlerTest, BooksBothSnapshotSet)
{
auto const input = json::parse(fmt::format(
R"({{
"books":
"books":
[
{{
"taker_gets":
"taker_gets":
{{
"currency": "XRP"
}},
"taker_pays":
"taker_pays":
{{
"currency": "USD",
"issuer": "{}"
@@ -970,14 +970,14 @@ TEST_F(RPCSubscribeHandlerTest, BooksBothUnsetSnapshotSet)
{
auto const input = json::parse(fmt::format(
R"({{
"books":
"books":
[
{{
"taker_gets":
"taker_gets":
{{
"currency": "XRP"
}},
"taker_pays":
"taker_pays":
{{
"currency": "USD",
"issuer": "{}"

View File

@@ -40,8 +40,8 @@ TEST_F(RPCTestHandlerTest, HandlerSuccess)
{
runSpawn([](auto yield) {
auto const handler = AnyHandler{HandlerFake{}};
auto const input = json::parse(R"({
"hello": "world",
auto const input = json::parse(R"({
"hello": "world",
"limit": 10
})");
@@ -69,8 +69,8 @@ TEST_F(RPCTestHandlerTest, HandlerErrorHandling)
{
runSpawn([](auto yield) {
auto const handler = AnyHandler{HandlerFake{}};
auto const input = json::parse(R"({
"hello": "not world",
auto const input = json::parse(R"({
"hello": "not world",
"limit": 10
})");
@@ -88,8 +88,8 @@ TEST_F(RPCTestHandlerTest, HandlerInnerErrorHandling)
{
runSpawn([](auto yield) {
auto const handler = AnyHandler{FailingHandlerFake{}};
auto const input = json::parse(R"({
"hello": "world",
auto const input = json::parse(R"({
"hello": "world",
"limit": 10
})");

View File

@@ -112,7 +112,7 @@ TEST_F(RPCTransactionEntryHandlerTest, NonExistLedgerViaLedgerIndex)
ON_CALL(*backend_, fetchLedgerBySequence).WillByDefault(Return(std::optional<ripple::LedgerHeader>{}));
EXPECT_CALL(*backend_, fetchLedgerBySequence).Times(1);
auto const input = json::parse(fmt::format(
R"({{
R"({{
"ledger_index": "4",
"tx_hash": "{}"
}})",
@@ -138,7 +138,7 @@ TEST_F(RPCTransactionEntryHandlerTest, TXNotFound)
runSpawn([this](auto yield) {
auto const handler = AnyHandler{TransactionEntryHandler{backend_}};
auto const req = json::parse(fmt::format(
R"({{
R"({{
"tx_hash": "{}"
}})",
kTXN_ID
@@ -168,7 +168,7 @@ TEST_F(RPCTransactionEntryHandlerTest, LedgerSeqNotMatch)
runSpawn([this](auto yield) {
auto const handler = AnyHandler{TransactionEntryHandler{backend_}};
auto const req = json::parse(fmt::format(
R"({{
R"({{
"tx_hash": "{}",
"ledger_index": "30"
}})",
@@ -245,7 +245,7 @@ TEST_F(RPCTransactionEntryHandlerTest, NormalPath)
runSpawn([&, this](auto yield) {
auto const handler = AnyHandler{TransactionEntryHandler{backend_}};
auto const req = json::parse(fmt::format(
R"({{
R"({{
"tx_hash": "{}",
"ledger_index": {}
}})",
@@ -319,7 +319,7 @@ TEST_F(RPCTransactionEntryHandlerTest, NormalPathV2)
runSpawn([&, this](auto yield) {
auto const handler = AnyHandler{TransactionEntryHandler{backend_}};
auto const req = json::parse(fmt::format(
R"({{
R"({{
"tx_hash": "{}",
"ledger_index": {}
}})",

View File

@@ -167,10 +167,10 @@ generateTestValuesForParametersTest()
UnsubscribeParamTestCaseBundle{
.testName = "BooksItemTakerGetsNotObject",
.testJson = R"({
"books":
"books":
[
{
"taker_pays":
"taker_pays":
{
"currency": "XRP"
},
@@ -184,10 +184,10 @@ generateTestValuesForParametersTest()
UnsubscribeParamTestCaseBundle{
.testName = "BooksItemTakerPaysNotObject",
.testJson = R"({
"books":
"books":
[
{
"taker_gets":
"taker_gets":
{
"currency": "XRP"
},
@@ -201,10 +201,10 @@ generateTestValuesForParametersTest()
UnsubscribeParamTestCaseBundle{
.testName = "BooksItemTakerPaysMissingCurrency",
.testJson = R"({
"books":
"books":
[
{
"taker_gets":
"taker_gets":
{
"currency": "XRP"
},
@@ -218,10 +218,10 @@ generateTestValuesForParametersTest()
UnsubscribeParamTestCaseBundle{
.testName = "BooksItemTakerGetsMissingCurrency",
.testJson = R"({
"books":
"books":
[
{
"taker_pays":
"taker_pays":
{
"currency": "XRP"
},
@@ -235,10 +235,10 @@ generateTestValuesForParametersTest()
UnsubscribeParamTestCaseBundle{
.testName = "BooksItemTakerPaysCurrencyNotString",
.testJson = R"({
"books":
"books":
[
{
"taker_gets":
"taker_gets":
{
"currency": "XRP"
},
@@ -255,10 +255,10 @@ generateTestValuesForParametersTest()
UnsubscribeParamTestCaseBundle{
.testName = "BooksItemTakerGetsCurrencyNotString",
.testJson = R"({
"books":
"books":
[
{
"taker_pays":
"taker_pays":
{
"currency": "XRP"
},
@@ -275,10 +275,10 @@ generateTestValuesForParametersTest()
UnsubscribeParamTestCaseBundle{
.testName = "BooksItemTakerPaysInvalidCurrency",
.testJson = R"({
"books":
"books":
[
{
"taker_gets":
"taker_gets":
{
"currency": "XRP"
},
@@ -295,10 +295,10 @@ generateTestValuesForParametersTest()
UnsubscribeParamTestCaseBundle{
.testName = "BooksItemTakerGetsInvalidCurrency",
.testJson = R"({
"books":
"books":
[
{
"taker_pays":
"taker_pays":
{
"currency": "XRP"
},
@@ -315,10 +315,10 @@ generateTestValuesForParametersTest()
UnsubscribeParamTestCaseBundle{
.testName = "BooksItemTakerPaysMissingIssuer",
.testJson = R"({
"books":
"books":
[
{
"taker_gets":
"taker_gets":
{
"currency": "XRP"
},
@@ -334,10 +334,10 @@ generateTestValuesForParametersTest()
UnsubscribeParamTestCaseBundle{
.testName = "BooksItemTakerGetsMissingIssuer",
.testJson = R"({
"books":
"books":
[
{
"taker_pays":
"taker_pays":
{
"currency": "XRP"
},
@@ -353,10 +353,10 @@ generateTestValuesForParametersTest()
UnsubscribeParamTestCaseBundle{
.testName = "BooksItemTakerPaysIssuerNotString",
.testJson = R"({
"books":
"books":
[
{
"taker_gets":
"taker_gets":
{
"currency": "XRP"
},
@@ -373,10 +373,10 @@ generateTestValuesForParametersTest()
UnsubscribeParamTestCaseBundle{
.testName = "BooksItemTakerGetsIssuerNotString",
.testJson = R"({
"books":
"books":
[
{
"taker_pays":
"taker_pays":
{
"currency": "XRP"
},
@@ -393,10 +393,10 @@ generateTestValuesForParametersTest()
UnsubscribeParamTestCaseBundle{
.testName = "BooksItemTakerPaysInvalidIssuer",
.testJson = R"({
"books":
"books":
[
{
"taker_gets":
"taker_gets":
{
"currency": "XRP"
},
@@ -413,10 +413,10 @@ generateTestValuesForParametersTest()
UnsubscribeParamTestCaseBundle{
.testName = "BooksItemTakerGetsInvalidIssuer",
.testJson = R"({
"books":
"books":
[
{
"taker_pays":
"taker_pays":
{
"currency": "XRP"
},
@@ -433,10 +433,10 @@ generateTestValuesForParametersTest()
UnsubscribeParamTestCaseBundle{
.testName = "BooksItemTakerGetsXRPHasIssuer",
.testJson = R"({
"books":
"books":
[
{
"taker_pays":
"taker_pays":
{
"currency": "USD",
"issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
@@ -454,10 +454,10 @@ generateTestValuesForParametersTest()
UnsubscribeParamTestCaseBundle{
.testName = "BooksItemTakerPaysXRPHasIssuer",
.testJson = R"({
"books":
"books":
[
{
"taker_pays":
"taker_pays":
{
"currency": "XRP",
"issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
@@ -475,10 +475,10 @@ generateTestValuesForParametersTest()
UnsubscribeParamTestCaseBundle{
.testName = "BooksItemBadMartket",
.testJson = R"({
"books":
"books":
[
{
"taker_pays":
"taker_pays":
{
"currency": "XRP"
},
@@ -494,10 +494,10 @@ generateTestValuesForParametersTest()
UnsubscribeParamTestCaseBundle{
.testName = "BooksItemInvalidBoth",
.testJson = R"({
"books":
"books":
[
{
"taker_pays":
"taker_pays":
{
"currency": "XRP"
},