From 92e5c4792bf344c78cc4cea77f008a5d54073346 Mon Sep 17 00:00:00 2001 From: Peter Chen <34582813+PeterChen13579@users.noreply.github.com> Date: Mon, 11 Sep 2023 07:39:38 -0400 Subject: [PATCH] Change boost::json to json in unittests (#831) --- unittests/rpc/ForwardingProxyTests.cpp | 45 ++++++++-------- .../rpc/handlers/AccountCurrenciesTests.cpp | 14 ++--- unittests/rpc/handlers/AccountInfoTests.cpp | 22 ++++---- unittests/rpc/handlers/AccountNFTsTests.cpp | 18 +++---- .../rpc/handlers/AccountObjectsTests.cpp | 52 +++++++++---------- unittests/rpc/handlers/AccountOffersTests.cpp | 20 +++---- unittests/rpc/handlers/AccountTxTests.cpp | 30 +++++------ unittests/rpc/handlers/BookChangesTests.cpp | 6 +-- unittests/rpc/handlers/BookOffersTests.cpp | 10 ++-- unittests/rpc/handlers/NFTHistoryTests.cpp | 26 +++++----- unittests/rpc/handlers/NoRippleCheckTests.cpp | 6 +-- unittests/rpc/handlers/ServerInfoTests.cpp | 10 ++-- 12 files changed, 130 insertions(+), 129 deletions(-) diff --git a/unittests/rpc/ForwardingProxyTests.cpp b/unittests/rpc/ForwardingProxyTests.cpp index bf131a1c..46dc0b62 100644 --- a/unittests/rpc/ForwardingProxyTests.cpp +++ b/unittests/rpc/ForwardingProxyTests.cpp @@ -30,6 +30,7 @@ using namespace rpc; using namespace testing; +namespace json = boost::json; constexpr static auto CLIENT_IP = "127.0.0.1"; @@ -54,7 +55,7 @@ TEST_F(RPCForwardingProxyTest, ShouldForwardReturnsFalseIfClioOnly) auto const rawHandlerProviderPtr = static_cast(handlerProvider.get()); auto const apiVersion = 2u; auto const method = "test"; - auto const params = boost::json::parse("{}"); + auto const params = json::parse("{}"); ON_CALL(*rawHandlerProviderPtr, isClioOnly(_)).WillByDefault(Return(true)); EXPECT_CALL(*rawHandlerProviderPtr, isClioOnly(method)).Times(1); @@ -74,7 +75,7 @@ TEST_F(RPCForwardingProxyTest, ShouldForwardReturnsTrueIfProxied) auto const rawHandlerProviderPtr = static_cast(handlerProvider.get()); auto const apiVersion = 2u; auto const method = "submit"; - auto const params = boost::json::parse("{}"); + auto const params = json::parse("{}"); ON_CALL(*rawHandlerProviderPtr, isClioOnly(_)).WillByDefault(Return(false)); EXPECT_CALL(*rawHandlerProviderPtr, isClioOnly(method)).Times(1); @@ -94,7 +95,7 @@ TEST_F(RPCForwardingProxyTest, ShouldForwardReturnsTrueIfCurrentLedgerSpecified) auto const rawHandlerProviderPtr = static_cast(handlerProvider.get()); auto const apiVersion = 2u; auto const method = "anymethod"; - auto const params = boost::json::parse(R"({"ledger_index": "current"})"); + auto const params = json::parse(R"({"ledger_index": "current"})"); ON_CALL(*rawHandlerProviderPtr, isClioOnly(_)).WillByDefault(Return(false)); EXPECT_CALL(*rawHandlerProviderPtr, isClioOnly(method)).Times(1); @@ -114,7 +115,7 @@ TEST_F(RPCForwardingProxyTest, ShouldForwardReturnsTrueIfClosedLedgerSpecified) auto const rawHandlerProviderPtr = static_cast(handlerProvider.get()); auto const apiVersion = 2u; auto const method = "anymethod"; - auto const params = boost::json::parse(R"({"ledger_index": "closed"})"); + auto const params = json::parse(R"({"ledger_index": "closed"})"); ON_CALL(*rawHandlerProviderPtr, isClioOnly(_)).WillByDefault(Return(false)); EXPECT_CALL(*rawHandlerProviderPtr, isClioOnly(method)).Times(1); @@ -134,7 +135,7 @@ TEST_F(RPCForwardingProxyTest, ShouldForwardReturnsTrueIfAccountInfoWithQueueSpe auto const rawHandlerProviderPtr = static_cast(handlerProvider.get()); auto const apiVersion = 2u; auto const method = "account_info"; - auto const params = boost::json::parse(R"({"queue": true})"); + auto const params = json::parse(R"({"queue": true})"); ON_CALL(*rawHandlerProviderPtr, isClioOnly(_)).WillByDefault(Return(false)); EXPECT_CALL(*rawHandlerProviderPtr, isClioOnly(method)).Times(1); @@ -154,7 +155,7 @@ TEST_F(RPCForwardingProxyTest, ShouldForwardReturnsTrueIfLedgerWithQueueSpecifie auto const rawHandlerProviderPtr = static_cast(handlerProvider.get()); auto const apiVersion = 2u; auto const method = "ledger"; - auto const params = boost::json::parse(R"({"queue": true})"); + auto const params = json::parse(R"({"queue": true})"); ON_CALL(*rawHandlerProviderPtr, isClioOnly(_)).WillByDefault(Return(false)); EXPECT_CALL(*rawHandlerProviderPtr, isClioOnly(method)).Times(1); @@ -174,7 +175,7 @@ TEST_F(RPCForwardingProxyTest, ShouldForwardReturnsTrueIfLedgerWithFullSpecified auto const rawHandlerProviderPtr = static_cast(handlerProvider.get()); auto const apiVersion = 2u; auto const method = "ledger"; - auto const params = boost::json::parse(R"({"full": true})"); + auto const params = json::parse(R"({"full": true})"); ON_CALL(*rawHandlerProviderPtr, isClioOnly(_)).WillByDefault(Return(false)); EXPECT_CALL(*rawHandlerProviderPtr, isClioOnly(method)).Times(1); @@ -194,7 +195,7 @@ TEST_F(RPCForwardingProxyTest, ShouldForwardReturnsTrueIfLedgerWithAccountsSpeci auto const rawHandlerProviderPtr = static_cast(handlerProvider.get()); auto const apiVersion = 2u; auto const method = "ledger"; - auto const params = boost::json::parse(R"({"accounts": true})"); + auto const params = json::parse(R"({"accounts": true})"); ON_CALL(*rawHandlerProviderPtr, isClioOnly(_)).WillByDefault(Return(false)); EXPECT_CALL(*rawHandlerProviderPtr, isClioOnly(method)).Times(1); @@ -214,7 +215,7 @@ TEST_F(RPCForwardingProxyTest, ShouldForwardReturnsFalseIfAccountInfoQueueIsFals auto const rawHandlerProviderPtr = static_cast(handlerProvider.get()); auto const apiVersion = 2u; auto const method = "account_info"; - auto const params = boost::json::parse(R"({"queue": false})"); + auto const params = json::parse(R"({"queue": false})"); ON_CALL(*rawHandlerProviderPtr, isClioOnly(_)).WillByDefault(Return(false)); EXPECT_CALL(*rawHandlerProviderPtr, isClioOnly(method)).Times(1); @@ -234,7 +235,7 @@ TEST_F(RPCForwardingProxyTest, ShouldForwardReturnsFalseIfLedgerQueueIsFalse) auto const rawHandlerProviderPtr = static_cast(handlerProvider.get()); auto const apiVersion = 2u; auto const method = "ledger"; - auto const params = boost::json::parse(R"({"queue": false})"); + auto const params = json::parse(R"({"queue": false})"); ON_CALL(*rawHandlerProviderPtr, isClioOnly(_)).WillByDefault(Return(false)); EXPECT_CALL(*rawHandlerProviderPtr, isClioOnly(method)).Times(1); @@ -254,7 +255,7 @@ TEST_F(RPCForwardingProxyTest, ShouldForwardReturnsFalseIfLedgerFullIsFalse) auto const rawHandlerProviderPtr = static_cast(handlerProvider.get()); auto const apiVersion = 2u; auto const method = "ledger"; - auto const params = boost::json::parse(R"({"full": false})"); + auto const params = json::parse(R"({"full": false})"); ON_CALL(*rawHandlerProviderPtr, isClioOnly(_)).WillByDefault(Return(false)); EXPECT_CALL(*rawHandlerProviderPtr, isClioOnly(method)).Times(1); @@ -274,7 +275,7 @@ TEST_F(RPCForwardingProxyTest, ShouldForwardReturnsFalseIfLedgerAccountsIsFalse) auto const rawHandlerProviderPtr = static_cast(handlerProvider.get()); auto const apiVersion = 2u; auto const method = "ledger"; - auto const params = boost::json::parse(R"({"accounts": false})"); + auto const params = json::parse(R"({"accounts": false})"); ON_CALL(*rawHandlerProviderPtr, isClioOnly(_)).WillByDefault(Return(false)); EXPECT_CALL(*rawHandlerProviderPtr, isClioOnly(method)).Times(1); @@ -293,7 +294,7 @@ TEST_F(RPCForwardingProxyTest, ShouldForwardReturnsTrueIfAPIVersionIsV1) { auto const apiVersion = 1u; auto const method = "api_version_check"; - auto const params = boost::json::parse("{}"); + auto const params = json::parse("{}"); runSpawn([&](auto yield) { auto const range = mockBackendPtr->fetchLedgerRange(); @@ -310,7 +311,7 @@ TEST_F(RPCForwardingProxyTest, ShouldForwardReturnsFalseIfAPIVersionIsV2) auto const rawHandlerProviderPtr = static_cast(handlerProvider.get()); auto const apiVersion = 2u; auto const method = "api_version_check"; - auto const params = boost::json::parse("{}"); + auto const params = json::parse("{}"); ON_CALL(*rawHandlerProviderPtr, isClioOnly(_)).WillByDefault(Return(false)); EXPECT_CALL(*rawHandlerProviderPtr, isClioOnly(method)).Times(1); @@ -329,7 +330,7 @@ TEST_F(RPCForwardingProxyTest, ShouldNeverForwardSubscribe) { auto const apiVersion = 1u; auto const method = "subscribe"; - auto const params = boost::json::parse("{}"); + auto const params = json::parse("{}"); runSpawn([&](auto yield) { auto const range = mockBackendPtr->fetchLedgerRange(); @@ -345,7 +346,7 @@ TEST_F(RPCForwardingProxyTest, ShouldNeverForwardUnsubscribe) { auto const apiVersion = 1u; auto const method = "unsubscribe"; - auto const params = boost::json::parse("{}"); + auto const params = json::parse("{}"); runSpawn([&](auto yield) { auto const range = mockBackendPtr->fetchLedgerRange(); @@ -363,10 +364,10 @@ TEST_F(RPCForwardingProxyTest, ForwardCallsBalancerWithCorrectParams) auto const rawBalancerPtr = static_cast(loadBalancer.get()); auto const apiVersion = 2u; auto const method = "submit"; - auto const params = boost::json::parse(R"({"test": true})"); - auto const forwarded = boost::json::parse(R"({"test": true, "command": "submit"})"); + auto const params = json::parse(R"({"test": true})"); + auto const forwarded = json::parse(R"({"test": true, "command": "submit"})"); - ON_CALL(*rawBalancerPtr, forwardToRippled).WillByDefault(Return(std::make_optional())); + ON_CALL(*rawBalancerPtr, forwardToRippled).WillByDefault(Return(std::make_optional())); EXPECT_CALL(*rawBalancerPtr, forwardToRippled(forwarded.as_object(), CLIENT_IP, _)).Times(1); ON_CALL(*rawHandlerProviderPtr, contains).WillByDefault(Return(true)); @@ -382,7 +383,7 @@ TEST_F(RPCForwardingProxyTest, ForwardCallsBalancerWithCorrectParams) auto const res = proxy.forward(ctx); - auto const data = std::get_if(&res); + auto const data = std::get_if(&res); EXPECT_TRUE(data != nullptr); }); } @@ -393,8 +394,8 @@ TEST_F(RPCForwardingProxyTest, ForwardingFailYieldsErrorStatus) auto const rawBalancerPtr = static_cast(loadBalancer.get()); auto const apiVersion = 2u; auto const method = "submit"; - auto const params = boost::json::parse(R"({"test": true})"); - auto const forwarded = boost::json::parse(R"({"test": true, "command": "submit"})"); + auto const params = json::parse(R"({"test": true})"); + auto const forwarded = json::parse(R"({"test": true, "command": "submit"})"); ON_CALL(*rawBalancerPtr, forwardToRippled).WillByDefault(Return(std::nullopt)); EXPECT_CALL(*rawBalancerPtr, forwardToRippled(forwarded.as_object(), CLIENT_IP, _)).Times(1); diff --git a/unittests/rpc/handlers/AccountCurrenciesTests.cpp b/unittests/rpc/handlers/AccountCurrenciesTests.cpp index 637dc8f9..c4d93c34 100644 --- a/unittests/rpc/handlers/AccountCurrenciesTests.cpp +++ b/unittests/rpc/handlers/AccountCurrenciesTests.cpp @@ -52,7 +52,7 @@ TEST_F(RPCAccountCurrenciesHandlerTest, AccountNotExist) ON_CALL(*rawBackendPtr, doFetchLedgerObject).WillByDefault(Return(std::optional{})); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObject).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}" }})", @@ -76,7 +76,7 @@ TEST_F(RPCAccountCurrenciesHandlerTest, LedgerNonExistViaIntSequence) // return empty ledgerinfo ON_CALL(*rawBackendPtr, fetchLedgerBySequence(30, _)).WillByDefault(Return(std::optional{})); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}" }})", @@ -101,7 +101,7 @@ TEST_F(RPCAccountCurrenciesHandlerTest, LedgerNonExistViaStringSequence) // return empty ledgerinfo ON_CALL(*rawBackendPtr, fetchLedgerBySequence(12, _)).WillByDefault(Return(std::optional{})); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "ledger_index":"{}" @@ -128,7 +128,7 @@ TEST_F(RPCAccountCurrenciesHandlerTest, LedgerNonExistViaHash) ON_CALL(*rawBackendPtr, fetchLedgerByHash(ripple::uint256{LEDGERHASH}, _)) .WillByDefault(Return(std::optional{})); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "ledger_hash":"{}" @@ -197,7 +197,7 @@ TEST_F(RPCAccountCurrenciesHandlerTest, DefaultParameter) ON_CALL(*rawBackendPtr, doFetchLedgerObjects).WillByDefault(Return(bbs)); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObjects).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}" }})", @@ -235,7 +235,7 @@ TEST_F(RPCAccountCurrenciesHandlerTest, RequestViaLegderHash) ON_CALL(*rawBackendPtr, doFetchLedgerObjects).WillByDefault(Return(bbs)); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObjects).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "ledger_hash":"{}" @@ -276,7 +276,7 @@ TEST_F(RPCAccountCurrenciesHandlerTest, RequestViaLegderSeq) ON_CALL(*rawBackendPtr, doFetchLedgerObjects).WillByDefault(Return(bbs)); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObjects).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "ledger_index":{} diff --git a/unittests/rpc/handlers/AccountInfoTests.cpp b/unittests/rpc/handlers/AccountInfoTests.cpp index aa418bec..c1ec596a 100644 --- a/unittests/rpc/handlers/AccountInfoTests.cpp +++ b/unittests/rpc/handlers/AccountInfoTests.cpp @@ -125,7 +125,7 @@ TEST_F(RPCAccountInfoHandlerTest, LedgerNonExistViaIntSequence) // return empty ledgerinfo ON_CALL(*rawBackendPtr, fetchLedgerBySequence(30, _)).WillByDefault(Return(std::optional{})); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account": "{}", "ledger_index": 30 @@ -150,7 +150,7 @@ TEST_F(RPCAccountInfoHandlerTest, LedgerNonExistViaStringSequence) // return empty ledgerinfo ON_CALL(*rawBackendPtr, fetchLedgerBySequence(30, _)).WillByDefault(Return(std::nullopt)); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account": "{}", "ledger_index": "30" @@ -176,7 +176,7 @@ TEST_F(RPCAccountInfoHandlerTest, LedgerNonExistViaHash) ON_CALL(*rawBackendPtr, fetchLedgerByHash(ripple::uint256{LEDGERHASH}, _)) .WillByDefault(Return(std::optional{})); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account": "{}", "ledger_hash": "{}" @@ -205,7 +205,7 @@ TEST_F(RPCAccountInfoHandlerTest, AccountNotExist) ON_CALL(*rawBackendPtr, doFetchLedgerObject).WillByDefault(Return(std::optional{})); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObject).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account": "{}" }})", @@ -233,7 +233,7 @@ TEST_F(RPCAccountInfoHandlerTest, AccountInvalid) ON_CALL(*rawBackendPtr, doFetchLedgerObject).WillByDefault(Return(CreateFeeSettingBlob(1, 2, 3, 4, 0))); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObject).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account": "{}" }})", @@ -269,7 +269,7 @@ TEST_F(RPCAccountInfoHandlerTest, SignerListsInvalid) .WillByDefault(Return(CreateAmendmentsObject({}).getSerializer().peekData())); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObject).Times(4); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account": "{}", "signer_lists": true @@ -370,7 +370,7 @@ TEST_F(RPCAccountInfoHandlerTest, SignerListsTrue) .WillByDefault(Return(CreateAmendmentsObject({}).getSerializer().peekData())); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObject).Times(4); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account": "{}", "signer_lists": true @@ -443,7 +443,7 @@ TEST_F(RPCAccountInfoHandlerTest, Flags) .WillByDefault(Return(CreateAmendmentsObject({}).getSerializer().peekData())); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObject).Times(3); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account": "{}" }})", @@ -474,7 +474,7 @@ TEST_F(RPCAccountInfoHandlerTest, IdentAndSignerListsFalse) .WillByDefault(Return(CreateAmendmentsObject({}).getSerializer().peekData())); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObject).Times(3); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "ident": "{}" }})", @@ -551,7 +551,7 @@ TEST_F(RPCAccountInfoHandlerTest, DisallowIncoming) .WillByDefault(Return(CreateAmendmentsObject({rpc::Amendments::DisallowIncoming}).getSerializer().peekData())); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObject).Times(3); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account": "{}" }})", @@ -624,7 +624,7 @@ TEST_F(RPCAccountInfoHandlerTest, Clawback) .WillByDefault(Return(CreateAmendmentsObject({rpc::Amendments::Clawback}).getSerializer().peekData())); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObject).Times(3); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account": "{}" }})", diff --git a/unittests/rpc/handlers/AccountNFTsTests.cpp b/unittests/rpc/handlers/AccountNFTsTests.cpp index a92b120c..6804ae36 100644 --- a/unittests/rpc/handlers/AccountNFTsTests.cpp +++ b/unittests/rpc/handlers/AccountNFTsTests.cpp @@ -171,7 +171,7 @@ TEST_F(RPCAccountNFTsHandlerTest, LedgerNotFoundViaHash) ON_CALL(*rawBackendPtr, fetchLedgerByHash(ripple::uint256{LEDGERHASH}, _)) .WillByDefault(Return(std::optional{})); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "ledger_hash":"{}" @@ -198,7 +198,7 @@ TEST_F(RPCAccountNFTsHandlerTest, LedgerNotFoundViaStringIndex) // return empty ledgerinfo ON_CALL(*rawBackendPtr, fetchLedgerBySequence(seq, _)).WillByDefault(Return(std::optional{})); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "ledger_index":"{}" @@ -225,7 +225,7 @@ TEST_F(RPCAccountNFTsHandlerTest, LedgerNotFoundViaIntIndex) // return empty ledgerinfo ON_CALL(*rawBackendPtr, fetchLedgerBySequence(seq, _)).WillByDefault(Return(std::optional{})); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "ledger_index":{} @@ -254,7 +254,7 @@ TEST_F(RPCAccountNFTsHandlerTest, AccountNotFound) ON_CALL(*rawBackendPtr, doFetchLedgerObject).WillByDefault(Return(std::optional{})); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObject).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}" }})", @@ -316,7 +316,7 @@ TEST_F(RPCAccountNFTsHandlerTest, NormalPath) .WillByDefault(Return(pageObject.getSerializer().peekData())); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObject).Times(2); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}" }})", @@ -351,7 +351,7 @@ TEST_F(RPCAccountNFTsHandlerTest, Limit) .WillByDefault(Return(pageObject.getSerializer().peekData())); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObject).Times(1 + limit); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "limit":{} @@ -387,7 +387,7 @@ TEST_F(RPCAccountNFTsHandlerTest, Marker) .WillByDefault(Return(pageObject.getSerializer().peekData())); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObject).Times(2); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "marker":"{}" @@ -450,7 +450,7 @@ TEST_F(RPCAccountNFTsHandlerTest, LimitLessThanMin) .WillByDefault(Return(pageObject.getSerializer().peekData())); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObject).Times(2); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "limit":{} @@ -513,7 +513,7 @@ TEST_F(RPCAccountNFTsHandlerTest, LimitMoreThanMax) .WillByDefault(Return(pageObject.getSerializer().peekData())); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObject).Times(2); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "limit":{} diff --git a/unittests/rpc/handlers/AccountObjectsTests.cpp b/unittests/rpc/handlers/AccountObjectsTests.cpp index 780d0851..c36831d4 100644 --- a/unittests/rpc/handlers/AccountObjectsTests.cpp +++ b/unittests/rpc/handlers/AccountObjectsTests.cpp @@ -176,7 +176,7 @@ TEST_F(RPCAccountObjectsHandlerTest, LedgerNonExistViaIntSequence) ON_CALL(*rawBackendPtr, fetchLedgerBySequence(MAXSEQ, _)) .WillByDefault(Return(std::optional{})); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "ledger_index":30 @@ -201,7 +201,7 @@ TEST_F(RPCAccountObjectsHandlerTest, LedgerNonExistViaStringSequence) // return empty ledgerinfo ON_CALL(*rawBackendPtr, fetchLedgerBySequence(MAXSEQ, _)).WillByDefault(Return(std::nullopt)); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "ledger_index":"30" @@ -227,7 +227,7 @@ TEST_F(RPCAccountObjectsHandlerTest, LedgerNonExistViaHash) ON_CALL(*rawBackendPtr, fetchLedgerByHash(ripple::uint256{LEDGERHASH}, _)) .WillByDefault(Return(std::optional{})); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "ledger_hash":"{}" @@ -256,7 +256,7 @@ TEST_F(RPCAccountObjectsHandlerTest, AccountNotExist) ON_CALL(*rawBackendPtr, doFetchLedgerObject).WillByDefault(Return(std::optional{})); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObject).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}" }})", @@ -334,7 +334,7 @@ TEST_F(RPCAccountObjectsHandlerTest, DefaultParameterNoNFTFound) ON_CALL(*rawBackendPtr, doFetchLedgerObjects).WillByDefault(Return(bbs)); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObjects).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}" }})", @@ -385,7 +385,7 @@ TEST_F(RPCAccountObjectsHandlerTest, Limit) ON_CALL(*rawBackendPtr, doFetchLedgerObjects).WillByDefault(Return(bbs)); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObjects).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "limit":{} @@ -434,7 +434,7 @@ TEST_F(RPCAccountObjectsHandlerTest, Marker) ON_CALL(*rawBackendPtr, doFetchLedgerObjects).WillByDefault(Return(bbs)); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObjects).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "marker":"{},{}" @@ -496,7 +496,7 @@ TEST_F(RPCAccountObjectsHandlerTest, MultipleDirNoNFT) ON_CALL(*rawBackendPtr, doFetchLedgerObjects).WillByDefault(Return(bbs)); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObjects).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "limit":{} @@ -555,7 +555,7 @@ TEST_F(RPCAccountObjectsHandlerTest, TypeFilter) ON_CALL(*rawBackendPtr, doFetchLedgerObjects).WillByDefault(Return(bbs)); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObjects).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "type":"offer" @@ -611,7 +611,7 @@ TEST_F(RPCAccountObjectsHandlerTest, TypeFilterReturnEmpty) ON_CALL(*rawBackendPtr, doFetchLedgerObjects).WillByDefault(Return(bbs)); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObjects).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "type": "check" @@ -674,7 +674,7 @@ TEST_F(RPCAccountObjectsHandlerTest, DeletionBlockersOnlyFilter) ON_CALL(*rawBackendPtr, doFetchLedgerObjects).WillByDefault(Return(bbs)); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObjects).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account": "{}", "deletion_blockers_only": true @@ -725,7 +725,7 @@ TEST_F(RPCAccountObjectsHandlerTest, DeletionBlockersOnlyFilterWithTypeFilter) ON_CALL(*rawBackendPtr, doFetchLedgerObjects).WillByDefault(Return(bbs)); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObjects).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account": "{}", "deletion_blockers_only": true, @@ -793,7 +793,7 @@ TEST_F(RPCAccountObjectsHandlerTest, DeletionBlockersOnlyFilterEmptyResult) ON_CALL(*rawBackendPtr, doFetchLedgerObjects).WillByDefault(Return(bbs)); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObjects).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account": "{}", "deletion_blockers_only": true @@ -858,7 +858,7 @@ TEST_F(RPCAccountObjectsHandlerTest, DeletionBlockersOnlyFilterWithIncompatibleT ON_CALL(*rawBackendPtr, doFetchLedgerObjects).WillByDefault(Return(bbs)); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObjects).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account": "{}", "deletion_blockers_only": true, @@ -978,7 +978,7 @@ TEST_F(RPCAccountObjectsHandlerTest, NFTMixOtherObjects) ON_CALL(*rawBackendPtr, doFetchLedgerObjects).WillByDefault(Return(bbs)); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObjects).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}" }})", @@ -1022,7 +1022,7 @@ TEST_F(RPCAccountObjectsHandlerTest, NFTReachLimitReturnMarker) EXPECT_CALL(*rawBackendPtr, doFetchLedgerObject).Times(11); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "limit":{} @@ -1075,7 +1075,7 @@ TEST_F(RPCAccountObjectsHandlerTest, NFTReachLimitNoMarker) EXPECT_CALL(*rawBackendPtr, doFetchLedgerObject).Times(12); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "limit":{} @@ -1157,7 +1157,7 @@ TEST_F(RPCAccountObjectsHandlerTest, NFTMarker) EXPECT_CALL(*rawBackendPtr, doFetchLedgerObject).Times(13); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "marker":"{},{}" @@ -1218,7 +1218,7 @@ TEST_F(RPCAccountObjectsHandlerTest, NFTMarkerNoMoreNFT) EXPECT_CALL(*rawBackendPtr, doFetchLedgerObject).Times(2); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "marker":"{},{}" @@ -1250,7 +1250,7 @@ TEST_F(RPCAccountObjectsHandlerTest, NFTMarkerNotInRange) ON_CALL(*rawBackendPtr, doFetchLedgerObject(accountKk, MAXSEQ, _)).WillByDefault(Return(Blob{'f', 'a', 'k', 'e'})); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObject).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account": "{}", "marker" : "{},{}" @@ -1287,7 +1287,7 @@ TEST_F(RPCAccountObjectsHandlerTest, NFTMarkerNotExist) ON_CALL(*rawBackendPtr, doFetchLedgerObject(accountNftMax, MAXSEQ, _)).WillByDefault(Return(std::nullopt)); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObject).Times(2); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account": "{}", "marker" : "{},{}" @@ -1367,7 +1367,7 @@ TEST_F(RPCAccountObjectsHandlerTest, NFTLimitAdjust) EXPECT_CALL(*rawBackendPtr, doFetchLedgerObject).Times(13); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "marker":"{},{}", @@ -1469,7 +1469,7 @@ TEST_F(RPCAccountObjectsHandlerTest, FilterNFT) ON_CALL(*rawBackendPtr, doFetchLedgerObjects).WillByDefault(Return(bbs)); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObjects).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "type": "nft_page" @@ -1517,7 +1517,7 @@ TEST_F(RPCAccountObjectsHandlerTest, NFTZeroMarkerNotAffectOtherMarker) ON_CALL(*rawBackendPtr, doFetchLedgerObjects).WillByDefault(Return(bbs)); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObjects).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "limit":{}, @@ -1602,7 +1602,7 @@ TEST_F(RPCAccountObjectsHandlerTest, LimitLessThanMin) ON_CALL(*rawBackendPtr, doFetchLedgerObjects).WillByDefault(Return(bbs)); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObjects).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "limit": {} @@ -1683,7 +1683,7 @@ TEST_F(RPCAccountObjectsHandlerTest, LimitMoreThanMax) ON_CALL(*rawBackendPtr, doFetchLedgerObjects).WillByDefault(Return(bbs)); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObjects).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "limit": {} diff --git a/unittests/rpc/handlers/AccountOffersTests.cpp b/unittests/rpc/handlers/AccountOffersTests.cpp index 9fc3069b..4a4d9605 100644 --- a/unittests/rpc/handlers/AccountOffersTests.cpp +++ b/unittests/rpc/handlers/AccountOffersTests.cpp @@ -164,7 +164,7 @@ TEST_F(RPCAccountOffersHandlerTest, LedgerNotFoundViaHash) ON_CALL(*rawBackendPtr, fetchLedgerByHash(ripple::uint256{LEDGERHASH}, _)) .WillByDefault(Return(std::optional{})); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "ledger_hash":"{}" @@ -191,7 +191,7 @@ TEST_F(RPCAccountOffersHandlerTest, LedgerNotFoundViaStringIndex) // return empty ledgerinfo ON_CALL(*rawBackendPtr, fetchLedgerBySequence(seq, _)).WillByDefault(Return(std::optional{})); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "ledger_index":"{}" @@ -218,7 +218,7 @@ TEST_F(RPCAccountOffersHandlerTest, LedgerNotFoundViaIntIndex) // return empty ledgerinfo ON_CALL(*rawBackendPtr, fetchLedgerBySequence(seq, _)).WillByDefault(Return(std::optional{})); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "ledger_index":{} @@ -247,7 +247,7 @@ TEST_F(RPCAccountOffersHandlerTest, AccountNotFound) ON_CALL(*rawBackendPtr, doFetchLedgerObject).WillByDefault(Return(std::optional{})); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObject).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}" }})", @@ -324,7 +324,7 @@ TEST_F(RPCAccountOffersHandlerTest, DefaultParams) ON_CALL(*rawBackendPtr, doFetchLedgerObjects).WillByDefault(Return(bbs)); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObjects).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}" }})", @@ -374,7 +374,7 @@ TEST_F(RPCAccountOffersHandlerTest, Limit) ON_CALL(*rawBackendPtr, doFetchLedgerObjects).WillByDefault(Return(bbs)); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObjects).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "limit":10 @@ -429,7 +429,7 @@ TEST_F(RPCAccountOffersHandlerTest, Marker) ON_CALL(*rawBackendPtr, doFetchLedgerObjects).WillByDefault(Return(bbs)); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObjects).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "marker":"{},{}" @@ -467,7 +467,7 @@ TEST_F(RPCAccountOffersHandlerTest, MarkerNotExists) ON_CALL(*rawBackendPtr, doFetchLedgerObject(hintIndex, ledgerSeq, _)).WillByDefault(Return(std::nullopt)); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObject).Times(2); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "marker":"{},{}" @@ -524,7 +524,7 @@ TEST_F(RPCAccountOffersHandlerTest, LimitLessThanMin) ON_CALL(*rawBackendPtr, doFetchLedgerObjects).WillByDefault(Return(bbs)); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObjects).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "limit":{} @@ -578,7 +578,7 @@ TEST_F(RPCAccountOffersHandlerTest, LimitMoreThanMax) ON_CALL(*rawBackendPtr, doFetchLedgerObjects).WillByDefault(Return(bbs)); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObjects).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "limit":{} diff --git a/unittests/rpc/handlers/AccountTxTests.cpp b/unittests/rpc/handlers/AccountTxTests.cpp index 4b3c2ab6..a843335d 100644 --- a/unittests/rpc/handlers/AccountTxTests.cpp +++ b/unittests/rpc/handlers/AccountTxTests.cpp @@ -309,7 +309,7 @@ TEST_F(RPCAccountTxHandlerTest, IndexSpecificForwardTrue) runSpawn([&, this](auto yield) { auto const handler = AnyHandler{AccountTxHandler{mockBackendPtr}}; - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "ledger_index_min": {}, @@ -350,7 +350,7 @@ TEST_F(RPCAccountTxHandlerTest, IndexSpecificForwardFalse) runSpawn([&, this](auto yield) { auto const handler = AnyHandler{AccountTxHandler{mockBackendPtr}}; - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "ledger_index_min": {}, @@ -391,7 +391,7 @@ TEST_F(RPCAccountTxHandlerTest, IndexNotSpecificForwardTrue) runSpawn([&, this](auto yield) { auto const handler = AnyHandler{AccountTxHandler{mockBackendPtr}}; - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "ledger_index_min": {}, @@ -432,7 +432,7 @@ TEST_F(RPCAccountTxHandlerTest, IndexNotSpecificForwardFalse) runSpawn([&, this](auto yield) { auto const handler = AnyHandler{AccountTxHandler{mockBackendPtr}}; - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "ledger_index_min": {}, @@ -473,7 +473,7 @@ TEST_F(RPCAccountTxHandlerTest, BinaryTrue) runSpawn([&, this](auto yield) { auto const handler = AnyHandler{AccountTxHandler{mockBackendPtr}}; - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "ledger_index_min": {}, @@ -522,7 +522,7 @@ TEST_F(RPCAccountTxHandlerTest, LimitAndMarker) runSpawn([&, this](auto yield) { auto const handler = AnyHandler{AccountTxHandler{mockBackendPtr}}; - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "ledger_index_min": {}, @@ -570,7 +570,7 @@ TEST_F(RPCAccountTxHandlerTest, SpecificLedgerIndex) runSpawn([&, this](auto yield) { auto const handler = AnyHandler{AccountTxHandler{mockBackendPtr}}; - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "ledger_index":{} @@ -599,7 +599,7 @@ TEST_F(RPCAccountTxHandlerTest, SpecificNonexistLedgerIntIndex) runSpawn([&, this](auto yield) { auto const handler = AnyHandler{AccountTxHandler{mockBackendPtr}}; - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "ledger_index":{} @@ -625,7 +625,7 @@ TEST_F(RPCAccountTxHandlerTest, SpecificNonexistLedgerStringIndex) runSpawn([&, this](auto yield) { auto const handler = AnyHandler{AccountTxHandler{mockBackendPtr}}; - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "ledger_index":"{}" @@ -665,7 +665,7 @@ TEST_F(RPCAccountTxHandlerTest, SpecificLedgerHash) runSpawn([&, this](auto yield) { auto const handler = AnyHandler{AccountTxHandler{mockBackendPtr}}; - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "ledger_hash":"{}" @@ -708,7 +708,7 @@ TEST_F(RPCAccountTxHandlerTest, SpecificLedgerIndexValidated) runSpawn([&, this](auto yield) { auto const handler = AnyHandler{AccountTxHandler{mockBackendPtr}}; - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "ledger_index":"validated" @@ -745,7 +745,7 @@ TEST_F(RPCAccountTxHandlerTest, TxLessThanMinSeq) runSpawn([&, this](auto yield) { auto const handler = AnyHandler{AccountTxHandler{mockBackendPtr}}; - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "ledger_index_min": {}, @@ -786,7 +786,7 @@ TEST_F(RPCAccountTxHandlerTest, TxLargerThanMaxSeq) runSpawn([&, this](auto yield) { auto const handler = AnyHandler{AccountTxHandler{mockBackendPtr}}; - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account":"{}", "ledger_index_min": {}, @@ -1015,7 +1015,7 @@ TEST_F(RPCAccountTxHandlerTest, NFTTxs) runSpawn([&, this](auto yield) { auto const handler = AnyHandler{AccountTxHandler{mockBackendPtr}}; - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account": "{}", "ledger_index_min": {}, @@ -1028,6 +1028,6 @@ TEST_F(RPCAccountTxHandlerTest, NFTTxs) -1)); auto const output = handler.process(input, Context{yield}); ASSERT_TRUE(output); - EXPECT_EQ(*output, boost::json::parse(OUT)); + EXPECT_EQ(*output, json::parse(OUT)); }); } diff --git a/unittests/rpc/handlers/BookChangesTests.cpp b/unittests/rpc/handlers/BookChangesTests.cpp index b2630fd8..b526a867 100644 --- a/unittests/rpc/handlers/BookChangesTests.cpp +++ b/unittests/rpc/handlers/BookChangesTests.cpp @@ -107,7 +107,7 @@ TEST_F(RPCBookChangesHandlerTest, LedgerNonExistViaIntSequence) ON_CALL(*rawBackendPtr, fetchLedgerBySequence(MAXSEQ, _)) .WillByDefault(Return(std::optional{})); - auto const static input = boost::json::parse(R"({"ledger_index":30})"); + auto const static input = json::parse(R"({"ledger_index":30})"); auto const handler = AnyHandler{BookChangesHandler{mockBackendPtr}}; runSpawn([&](auto yield) { auto const output = handler.process(input, Context{yield}); @@ -127,7 +127,7 @@ TEST_F(RPCBookChangesHandlerTest, LedgerNonExistViaStringSequence) // return empty ledgerinfo ON_CALL(*rawBackendPtr, fetchLedgerBySequence(MAXSEQ, _)).WillByDefault(Return(std::nullopt)); - auto const static input = boost::json::parse(R"({"ledger_index":"30"})"); + auto const static input = json::parse(R"({"ledger_index":"30"})"); auto const handler = AnyHandler{BookChangesHandler{mockBackendPtr}}; runSpawn([&](auto yield) { auto const output = handler.process(input, Context{yield}); @@ -148,7 +148,7 @@ TEST_F(RPCBookChangesHandlerTest, LedgerNonExistViaHash) ON_CALL(*rawBackendPtr, fetchLedgerByHash(ripple::uint256{LEDGERHASH}, _)) .WillByDefault(Return(std::optional{})); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "ledger_hash":"{}" }})", diff --git a/unittests/rpc/handlers/BookOffersTests.cpp b/unittests/rpc/handlers/BookOffersTests.cpp index 27c9192c..d368ebe1 100644 --- a/unittests/rpc/handlers/BookOffersTests.cpp +++ b/unittests/rpc/handlers/BookOffersTests.cpp @@ -1107,7 +1107,7 @@ TEST_F(RPCBookOffersHandlerTest, LedgerNonExistViaIntSequence) // return empty ledgerinfo ON_CALL(*rawBackendPtr, fetchLedgerBySequence(30, _)).WillByDefault(Return(std::optional{})); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "ledger_index": 30, "taker_gets": @@ -1140,7 +1140,7 @@ TEST_F(RPCBookOffersHandlerTest, LedgerNonExistViaSequence) // return empty ledgerinfo ON_CALL(*rawBackendPtr, fetchLedgerBySequence(30, _)).WillByDefault(Return(std::optional{})); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "ledger_index": "30", "taker_gets": @@ -1174,7 +1174,7 @@ TEST_F(RPCBookOffersHandlerTest, LedgerNonExistViaHash) ON_CALL(*rawBackendPtr, fetchLedgerByHash(ripple::uint256{LEDGERHASH}, _)) .WillByDefault(Return(std::optional{})); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "ledger_hash": "{}", "taker_gets": @@ -1248,7 +1248,7 @@ TEST_F(RPCBookOffersHandlerTest, Limit) ON_CALL(*rawBackendPtr, doFetchLedgerObjects).WillByDefault(Return(bbs)); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObjects).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "taker_gets": {{ @@ -1319,7 +1319,7 @@ TEST_F(RPCBookOffersHandlerTest, LimitMoreThanMax) ON_CALL(*rawBackendPtr, doFetchLedgerObjects).WillByDefault(Return(bbs)); EXPECT_CALL(*rawBackendPtr, doFetchLedgerObjects).Times(1); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "taker_gets": {{ diff --git a/unittests/rpc/handlers/NFTHistoryTests.cpp b/unittests/rpc/handlers/NFTHistoryTests.cpp index a4f47d4d..a2a5879a 100644 --- a/unittests/rpc/handlers/NFTHistoryTests.cpp +++ b/unittests/rpc/handlers/NFTHistoryTests.cpp @@ -268,7 +268,7 @@ TEST_F(RPCNFTHistoryHandlerTest, IndexSpecificForwardTrue) runSpawn([&, this](auto yield) { auto const handler = AnyHandler{NFTHistoryHandler{mockBackendPtr}}; - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "nft_id":"{}", "ledger_index_min": {}, @@ -309,7 +309,7 @@ TEST_F(RPCNFTHistoryHandlerTest, IndexSpecificForwardFalse) runSpawn([&, this](auto yield) { auto const handler = AnyHandler{NFTHistoryHandler{mockBackendPtr}}; - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "nft_id":"{}", "ledger_index_min": {}, @@ -346,7 +346,7 @@ TEST_F(RPCNFTHistoryHandlerTest, IndexNotSpecificForwardTrue) runSpawn([&, this](auto yield) { auto const handler = AnyHandler{NFTHistoryHandler{mockBackendPtr}}; - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "nft_id":"{}", "ledger_index_min": {}, @@ -387,7 +387,7 @@ TEST_F(RPCNFTHistoryHandlerTest, IndexNotSpecificForwardFalse) runSpawn([&, this](auto yield) { auto const handler = AnyHandler{NFTHistoryHandler{mockBackendPtr}}; - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "nft_id":"{}", "ledger_index_min": {}, @@ -428,7 +428,7 @@ TEST_F(RPCNFTHistoryHandlerTest, BinaryTrue) runSpawn([&, this](auto yield) { auto const handler = AnyHandler{NFTHistoryHandler{mockBackendPtr}}; - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "nft_id":"{}", "ledger_index_min": {}, @@ -477,7 +477,7 @@ TEST_F(RPCNFTHistoryHandlerTest, LimitAndMarker) runSpawn([&, this](auto yield) { auto const handler = AnyHandler{NFTHistoryHandler{mockBackendPtr}}; - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "nft_id":"{}", "ledger_index_min": {}, @@ -525,7 +525,7 @@ TEST_F(RPCNFTHistoryHandlerTest, SpecificLedgerIndex) runSpawn([&, this](auto yield) { auto const handler = AnyHandler{NFTHistoryHandler{mockBackendPtr}}; - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "nft_id":"{}", "ledger_index":{} @@ -554,7 +554,7 @@ TEST_F(RPCNFTHistoryHandlerTest, SpecificNonexistLedgerIntIndex) runSpawn([&, this](auto yield) { auto const handler = AnyHandler{NFTHistoryHandler{mockBackendPtr}}; - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "nft_id":"{}", "ledger_index":{} @@ -580,7 +580,7 @@ TEST_F(RPCNFTHistoryHandlerTest, SpecificNonexistLedgerStringIndex) runSpawn([&, this](auto yield) { auto const handler = AnyHandler{NFTHistoryHandler{mockBackendPtr}}; - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "nft_id":"{}", "ledger_index":"{}" @@ -620,7 +620,7 @@ TEST_F(RPCNFTHistoryHandlerTest, SpecificLedgerHash) runSpawn([&, this](auto yield) { auto const handler = AnyHandler{NFTHistoryHandler{mockBackendPtr}}; - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "nft_id":"{}", "ledger_hash":"{}" @@ -658,7 +658,7 @@ TEST_F(RPCNFTHistoryHandlerTest, TxLessThanMinSeq) runSpawn([&, this](auto yield) { auto const handler = AnyHandler{NFTHistoryHandler{mockBackendPtr}}; - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "nft_id":"{}", "ledger_index_min": {}, @@ -699,7 +699,7 @@ TEST_F(RPCNFTHistoryHandlerTest, TxLargerThanMaxSeq) runSpawn([&, this](auto yield) { auto const handler = AnyHandler{NFTHistoryHandler{mockBackendPtr}}; - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "nft_id":"{}", "ledger_index_min": {}, @@ -740,7 +740,7 @@ TEST_F(RPCNFTHistoryHandlerTest, LimitMoreThanMax) runSpawn([&, this](auto yield) { auto const handler = AnyHandler{NFTHistoryHandler{mockBackendPtr}}; - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "nft_id":"{}", "ledger_index_min": {}, diff --git a/unittests/rpc/handlers/NoRippleCheckTests.cpp b/unittests/rpc/handlers/NoRippleCheckTests.cpp index fc035c4c..743cfd0c 100644 --- a/unittests/rpc/handlers/NoRippleCheckTests.cpp +++ b/unittests/rpc/handlers/NoRippleCheckTests.cpp @@ -174,7 +174,7 @@ TEST_F(RPCNoRippleCheckTest, LedgerNotExistViaHash) // return empty ledgerinfo ON_CALL(*rawBackendPtr, fetchLedgerByHash(ripple::uint256{LEDGERHASH}, _)).WillByDefault(Return(std::nullopt)); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account": "{}", "role": "gateway", @@ -202,7 +202,7 @@ TEST_F(RPCNoRippleCheckTest, LedgerNotExistViaIntIndex) // return empty ledgerinfo ON_CALL(*rawBackendPtr, fetchLedgerBySequence(seq, _)).WillByDefault(Return(std::nullopt)); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account": "{}", "role": "gateway", @@ -230,7 +230,7 @@ TEST_F(RPCNoRippleCheckTest, LedgerNotExistViaStringIndex) // return empty ledgerinfo ON_CALL(*rawBackendPtr, fetchLedgerBySequence(seq, _)).WillByDefault(Return(std::nullopt)); - auto const static input = boost::json::parse(fmt::format( + auto const static input = json::parse(fmt::format( R"({{ "account": "{}", "role": "gateway", diff --git a/unittests/rpc/handlers/ServerInfoTests.cpp b/unittests/rpc/handlers/ServerInfoTests.cpp index 675248e6..e4a54d37 100644 --- a/unittests/rpc/handlers/ServerInfoTests.cpp +++ b/unittests/rpc/handlers/ServerInfoTests.cpp @@ -284,7 +284,7 @@ TEST_F(RPCServerInfoHandlerTest, AdminSectionPresentWhenAdminFlagIsSet) mockBackendPtr->updateRange(10); // min mockBackendPtr->updateRange(30); // max - auto const empty = boost::json::object{}; + auto const empty = json::object{}; auto const ledgerinfo = CreateLedgerInfo(LEDGERHASH, 30, 3); // 3 seconds old ON_CALL(*rawBackendPtr, fetchLedgerBySequence).WillByDefault(Return(ledgerinfo)); EXPECT_CALL(*rawBackendPtr, fetchLedgerBySequence).Times(1); @@ -336,7 +336,7 @@ TEST_F(RPCServerInfoHandlerTest, RippledForwardedValuesPresent) mockBackendPtr->updateRange(10); // min mockBackendPtr->updateRange(30); // max - auto const empty = boost::json::object{}; + auto const empty = json::object{}; auto const ledgerinfo = CreateLedgerInfo(LEDGERHASH, 30, 3); // 3 seconds old ON_CALL(*rawBackendPtr, fetchLedgerBySequence).WillByDefault(Return(ledgerinfo)); EXPECT_CALL(*rawBackendPtr, fetchLedgerBySequence).Times(1); @@ -351,7 +351,7 @@ TEST_F(RPCServerInfoHandlerTest, RippledForwardedValuesPresent) ON_CALL(*rawETLServicePtr, isAmendmentBlocked).WillByDefault(Return(false)); EXPECT_CALL(*rawETLServicePtr, isAmendmentBlocked).Times(1); - auto const rippledObj = boost::json::parse(R"({ + auto const rippledObj = json::parse(R"({ "result": { "info": { "build_version": "1234", @@ -399,7 +399,7 @@ TEST_F(RPCServerInfoHandlerTest, RippledForwardedValuesMissingNoExceptionThrown) mockBackendPtr->updateRange(10); // min mockBackendPtr->updateRange(30); // max - auto const empty = boost::json::object{}; + auto const empty = json::object{}; auto const ledgerinfo = CreateLedgerInfo(LEDGERHASH, 30, 3); // 3 seconds old ON_CALL(*rawBackendPtr, fetchLedgerBySequence).WillByDefault(Return(ledgerinfo)); EXPECT_CALL(*rawBackendPtr, fetchLedgerBySequence).Times(1); @@ -414,7 +414,7 @@ TEST_F(RPCServerInfoHandlerTest, RippledForwardedValuesMissingNoExceptionThrown) ON_CALL(*rawETLServicePtr, isAmendmentBlocked).WillByDefault(Return(false)); EXPECT_CALL(*rawETLServicePtr, isAmendmentBlocked).Times(1); - auto const rippledObj = boost::json::parse(R"({ + auto const rippledObj = json::parse(R"({ "result": { "info": {} }