mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-25 14:15:53 +00:00
@@ -40,12 +40,9 @@ constexpr static auto TOKENID = "000827103B94ECBB7BF0A0A6ED62B3607801A27B65F4679
|
||||
constexpr static auto MAXSEQ = 30;
|
||||
constexpr static auto MINSEQ = 10;
|
||||
|
||||
class RPCAccountObjectsHandlerTest : public HandlerBaseTest
|
||||
{
|
||||
};
|
||||
class RPCAccountObjectsHandlerTest : public HandlerBaseTest {};
|
||||
|
||||
struct AccountObjectsParamTestCaseBundle
|
||||
{
|
||||
struct AccountObjectsParamTestCaseBundle {
|
||||
std::string testName;
|
||||
std::string testJson;
|
||||
std::string expectedError;
|
||||
@@ -54,13 +51,11 @@ struct AccountObjectsParamTestCaseBundle
|
||||
|
||||
// parameterized test cases for parameters check
|
||||
struct AccountObjectsParameterTest : public RPCAccountObjectsHandlerTest,
|
||||
public WithParamInterface<AccountObjectsParamTestCaseBundle>
|
||||
{
|
||||
struct NameGenerator
|
||||
{
|
||||
public WithParamInterface<AccountObjectsParamTestCaseBundle> {
|
||||
struct NameGenerator {
|
||||
template <class ParamType>
|
||||
std::string
|
||||
operator()(const testing::TestParamInfo<ParamType>& info) const
|
||||
operator()(testing::TestParamInfo<ParamType> const& info) const
|
||||
{
|
||||
auto bundle = static_cast<AccountObjectsParamTestCaseBundle>(info.param);
|
||||
return bundle.testName;
|
||||
@@ -130,7 +125,8 @@ generateTestValuesForParametersTest()
|
||||
"NFTMarkerInvalid",
|
||||
fmt::format(
|
||||
R"({{"account":"rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun", "marker":"wronghex256,{}"}})",
|
||||
std::numeric_limits<uint32_t>::max()),
|
||||
std::numeric_limits<uint32_t>::max()
|
||||
),
|
||||
"invalidParams",
|
||||
"Malformed cursor."},
|
||||
AccountObjectsParamTestCaseBundle{
|
||||
@@ -150,7 +146,8 @@ INSTANTIATE_TEST_CASE_P(
|
||||
RPCAccountObjectsGroup1,
|
||||
AccountObjectsParameterTest,
|
||||
ValuesIn(generateTestValuesForParametersTest()),
|
||||
AccountObjectsParameterTest::NameGenerator{});
|
||||
AccountObjectsParameterTest::NameGenerator{}
|
||||
);
|
||||
|
||||
TEST_P(AccountObjectsParameterTest, InvalidParams)
|
||||
{
|
||||
@@ -182,7 +179,8 @@ TEST_F(RPCAccountObjectsHandlerTest, LedgerNonExistViaIntSequence)
|
||||
"account":"{}",
|
||||
"ledger_index":30
|
||||
}})",
|
||||
ACCOUNT));
|
||||
ACCOUNT
|
||||
));
|
||||
auto const handler = AnyHandler{AccountObjectsHandler{mockBackendPtr}};
|
||||
runSpawn([&](auto yield) {
|
||||
auto const output = handler.process(input, Context{yield});
|
||||
@@ -208,7 +206,8 @@ TEST_F(RPCAccountObjectsHandlerTest, LedgerNonExistViaStringSequence)
|
||||
"account":"{}",
|
||||
"ledger_index":"30"
|
||||
}})",
|
||||
ACCOUNT));
|
||||
ACCOUNT
|
||||
));
|
||||
auto const handler = AnyHandler{AccountObjectsHandler{mockBackendPtr}};
|
||||
runSpawn([&](auto yield) {
|
||||
auto const output = handler.process(input, Context{yield});
|
||||
@@ -236,7 +235,8 @@ TEST_F(RPCAccountObjectsHandlerTest, LedgerNonExistViaHash)
|
||||
"ledger_hash":"{}"
|
||||
}})",
|
||||
ACCOUNT,
|
||||
LEDGERHASH));
|
||||
LEDGERHASH
|
||||
));
|
||||
auto const handler = AnyHandler{AccountObjectsHandler{mockBackendPtr}};
|
||||
runSpawn([&](auto yield) {
|
||||
auto const output = handler.process(input, Context{yield});
|
||||
@@ -264,7 +264,8 @@ TEST_F(RPCAccountObjectsHandlerTest, AccountNotExist)
|
||||
R"({{
|
||||
"account":"{}"
|
||||
}})",
|
||||
ACCOUNT));
|
||||
ACCOUNT
|
||||
));
|
||||
auto const handler = AnyHandler{AccountObjectsHandler{mockBackendPtr}};
|
||||
runSpawn([&](auto yield) {
|
||||
auto const output = handler.process(input, Context{yield});
|
||||
@@ -342,7 +343,8 @@ TEST_F(RPCAccountObjectsHandlerTest, DefaultParameterNoNFTFound)
|
||||
R"({{
|
||||
"account":"{}"
|
||||
}})",
|
||||
ACCOUNT));
|
||||
ACCOUNT
|
||||
));
|
||||
|
||||
auto const handler = AnyHandler{AccountObjectsHandler{mockBackendPtr}};
|
||||
runSpawn([&](auto yield) {
|
||||
@@ -381,8 +383,7 @@ TEST_F(RPCAccountObjectsHandlerTest, Limit)
|
||||
EXPECT_CALL(*rawBackendPtr, doFetchLedgerObject).Times(3);
|
||||
|
||||
std::vector<Blob> bbs;
|
||||
while (count-- != 0)
|
||||
{
|
||||
while (count-- != 0) {
|
||||
auto const line1 = CreateRippleStateLedgerObject("USD", ISSUER, 100, ACCOUNT, 10, ACCOUNT2, 20, TXNID, 123, 0);
|
||||
bbs.push_back(line1.getSerializer().peekData());
|
||||
}
|
||||
@@ -395,7 +396,8 @@ TEST_F(RPCAccountObjectsHandlerTest, Limit)
|
||||
"limit":{}
|
||||
}})",
|
||||
ACCOUNT,
|
||||
limit));
|
||||
limit
|
||||
));
|
||||
|
||||
auto const handler = AnyHandler{AccountObjectsHandler{mockBackendPtr}};
|
||||
runSpawn([&](auto yield) {
|
||||
@@ -430,8 +432,7 @@ TEST_F(RPCAccountObjectsHandlerTest, Marker)
|
||||
EXPECT_CALL(*rawBackendPtr, doFetchLedgerObject).Times(3);
|
||||
|
||||
std::vector<Blob> bbs;
|
||||
while (count-- != 0)
|
||||
{
|
||||
while (count-- != 0) {
|
||||
auto const line1 = CreateRippleStateLedgerObject("USD", ISSUER, 100, ACCOUNT, 10, ACCOUNT2, 20, TXNID, 123, 0);
|
||||
bbs.push_back(line1.getSerializer().peekData());
|
||||
}
|
||||
@@ -445,7 +446,8 @@ TEST_F(RPCAccountObjectsHandlerTest, Marker)
|
||||
}})",
|
||||
ACCOUNT,
|
||||
INDEX1,
|
||||
page));
|
||||
page
|
||||
));
|
||||
|
||||
auto const handler = AnyHandler{AccountObjectsHandler{mockBackendPtr}};
|
||||
runSpawn([&](auto yield) {
|
||||
@@ -492,8 +494,7 @@ TEST_F(RPCAccountObjectsHandlerTest, MultipleDirNoNFT)
|
||||
std::vector<Blob> bbs;
|
||||
// 10 items per page, 2 pages
|
||||
cc = count * 2;
|
||||
while (cc-- != 0)
|
||||
{
|
||||
while (cc-- != 0) {
|
||||
auto const line1 = CreateRippleStateLedgerObject("USD", ISSUER, 100, ACCOUNT, 10, ACCOUNT2, 20, TXNID, 123, 0);
|
||||
bbs.push_back(line1.getSerializer().peekData());
|
||||
}
|
||||
@@ -506,7 +507,8 @@ TEST_F(RPCAccountObjectsHandlerTest, MultipleDirNoNFT)
|
||||
"limit":{}
|
||||
}})",
|
||||
ACCOUNT,
|
||||
2 * count));
|
||||
2 * count
|
||||
));
|
||||
|
||||
auto const handler = AnyHandler{AccountObjectsHandler{mockBackendPtr}};
|
||||
runSpawn([&](auto yield) {
|
||||
@@ -552,7 +554,8 @@ TEST_F(RPCAccountObjectsHandlerTest, TypeFilter)
|
||||
ripple::to_string(ripple::xrpCurrency()),
|
||||
ACCOUNT2,
|
||||
toBase58(ripple::xrpAccount()),
|
||||
INDEX1);
|
||||
INDEX1
|
||||
);
|
||||
bbs.push_back(line1.getSerializer().peekData());
|
||||
bbs.push_back(offer.getSerializer().peekData());
|
||||
|
||||
@@ -564,7 +567,8 @@ TEST_F(RPCAccountObjectsHandlerTest, TypeFilter)
|
||||
"account":"{}",
|
||||
"type":"offer"
|
||||
}})",
|
||||
ACCOUNT));
|
||||
ACCOUNT
|
||||
));
|
||||
|
||||
auto const handler = AnyHandler{AccountObjectsHandler{mockBackendPtr}};
|
||||
runSpawn([&](auto yield) {
|
||||
@@ -608,7 +612,8 @@ TEST_F(RPCAccountObjectsHandlerTest, TypeFilterReturnEmpty)
|
||||
ripple::to_string(ripple::xrpCurrency()),
|
||||
ACCOUNT2,
|
||||
toBase58(ripple::xrpAccount()),
|
||||
INDEX1);
|
||||
INDEX1
|
||||
);
|
||||
bbs.push_back(line1.getSerializer().peekData());
|
||||
bbs.push_back(offer.getSerializer().peekData());
|
||||
|
||||
@@ -620,7 +625,8 @@ TEST_F(RPCAccountObjectsHandlerTest, TypeFilterReturnEmpty)
|
||||
"account":"{}",
|
||||
"type": "check"
|
||||
}})",
|
||||
ACCOUNT));
|
||||
ACCOUNT
|
||||
));
|
||||
|
||||
auto const handler = AnyHandler{AccountObjectsHandler{mockBackendPtr}};
|
||||
runSpawn([&](auto yield) {
|
||||
@@ -668,7 +674,8 @@ TEST_F(RPCAccountObjectsHandlerTest, DeletionBlockersOnlyFilter)
|
||||
ripple::to_string(ripple::xrpCurrency()),
|
||||
ACCOUNT2,
|
||||
toBase58(ripple::xrpAccount()),
|
||||
INDEX1);
|
||||
INDEX1
|
||||
);
|
||||
|
||||
std::vector<Blob> bbs;
|
||||
bbs.push_back(line.getSerializer().peekData());
|
||||
@@ -683,7 +690,8 @@ TEST_F(RPCAccountObjectsHandlerTest, DeletionBlockersOnlyFilter)
|
||||
"account": "{}",
|
||||
"deletion_blockers_only": true
|
||||
}})",
|
||||
ACCOUNT));
|
||||
ACCOUNT
|
||||
));
|
||||
|
||||
auto const handler = AnyHandler{AccountObjectsHandler{mockBackendPtr}};
|
||||
runSpawn([&](auto yield) {
|
||||
@@ -735,7 +743,8 @@ TEST_F(RPCAccountObjectsHandlerTest, DeletionBlockersOnlyFilterWithTypeFilter)
|
||||
"deletion_blockers_only": true,
|
||||
"type": "payment_channel"
|
||||
}})",
|
||||
ACCOUNT));
|
||||
ACCOUNT
|
||||
));
|
||||
|
||||
auto const handler = AnyHandler{AccountObjectsHandler{mockBackendPtr}};
|
||||
runSpawn([&](auto yield) {
|
||||
@@ -780,7 +789,8 @@ TEST_F(RPCAccountObjectsHandlerTest, DeletionBlockersOnlyFilterEmptyResult)
|
||||
ripple::to_string(ripple::xrpCurrency()),
|
||||
ACCOUNT2,
|
||||
toBase58(ripple::xrpAccount()),
|
||||
INDEX1);
|
||||
INDEX1
|
||||
);
|
||||
auto const offer2 = CreateOfferLedgerObject(
|
||||
ACCOUNT,
|
||||
20,
|
||||
@@ -789,7 +799,8 @@ TEST_F(RPCAccountObjectsHandlerTest, DeletionBlockersOnlyFilterEmptyResult)
|
||||
ripple::to_string(ripple::xrpCurrency()),
|
||||
ACCOUNT2,
|
||||
toBase58(ripple::xrpAccount()),
|
||||
INDEX1);
|
||||
INDEX1
|
||||
);
|
||||
|
||||
std::vector<Blob> bbs;
|
||||
bbs.push_back(offer1.getSerializer().peekData());
|
||||
@@ -803,7 +814,8 @@ TEST_F(RPCAccountObjectsHandlerTest, DeletionBlockersOnlyFilterEmptyResult)
|
||||
"account": "{}",
|
||||
"deletion_blockers_only": true
|
||||
}})",
|
||||
ACCOUNT));
|
||||
ACCOUNT
|
||||
));
|
||||
|
||||
auto const handler = AnyHandler{AccountObjectsHandler{mockBackendPtr}};
|
||||
runSpawn([&](auto yield) {
|
||||
@@ -846,7 +858,8 @@ TEST_F(RPCAccountObjectsHandlerTest, DeletionBlockersOnlyFilterWithIncompatibleT
|
||||
ripple::to_string(ripple::xrpCurrency()),
|
||||
ACCOUNT2,
|
||||
toBase58(ripple::xrpAccount()),
|
||||
INDEX1);
|
||||
INDEX1
|
||||
);
|
||||
auto const offer2 = CreateOfferLedgerObject(
|
||||
ACCOUNT,
|
||||
20,
|
||||
@@ -855,7 +868,8 @@ TEST_F(RPCAccountObjectsHandlerTest, DeletionBlockersOnlyFilterWithIncompatibleT
|
||||
ripple::to_string(ripple::xrpCurrency()),
|
||||
ACCOUNT2,
|
||||
toBase58(ripple::xrpAccount()),
|
||||
INDEX1);
|
||||
INDEX1
|
||||
);
|
||||
|
||||
std::vector<Blob> bbs;
|
||||
bbs.push_back(offer1.getSerializer().peekData());
|
||||
@@ -870,7 +884,8 @@ TEST_F(RPCAccountObjectsHandlerTest, DeletionBlockersOnlyFilterWithIncompatibleT
|
||||
"deletion_blockers_only": true,
|
||||
"type": "offer"
|
||||
}})",
|
||||
ACCOUNT));
|
||||
ACCOUNT
|
||||
));
|
||||
|
||||
auto const handler = AnyHandler{AccountObjectsHandler{mockBackendPtr}};
|
||||
runSpawn([&](auto yield) {
|
||||
@@ -988,7 +1003,8 @@ TEST_F(RPCAccountObjectsHandlerTest, NFTMixOtherObjects)
|
||||
R"({{
|
||||
"account":"{}"
|
||||
}})",
|
||||
ACCOUNT));
|
||||
ACCOUNT
|
||||
));
|
||||
|
||||
auto const handler = AnyHandler{AccountObjectsHandler{mockBackendPtr}};
|
||||
runSpawn([&](auto yield) {
|
||||
@@ -1015,8 +1031,7 @@ TEST_F(RPCAccountObjectsHandlerTest, NFTReachLimitReturnMarker)
|
||||
auto current = ripple::keylet::nftpage_max(account).key;
|
||||
std::string first{INDEX1};
|
||||
sort(first.begin(), first.end());
|
||||
for (auto i = 0; i < 10; i++)
|
||||
{
|
||||
for (auto i = 0; i < 10; i++) {
|
||||
std::next_permutation(first.begin(), first.end());
|
||||
auto previous =
|
||||
ripple::keylet::nftpage(ripple::keylet::nftpage_min(account), ripple::uint256{first.c_str()}).key;
|
||||
@@ -1035,7 +1050,8 @@ TEST_F(RPCAccountObjectsHandlerTest, NFTReachLimitReturnMarker)
|
||||
"limit":{}
|
||||
}})",
|
||||
ACCOUNT,
|
||||
10));
|
||||
10
|
||||
));
|
||||
|
||||
auto const handler = AnyHandler{AccountObjectsHandler{mockBackendPtr}};
|
||||
runSpawn([&](auto yield) {
|
||||
@@ -1044,7 +1060,8 @@ TEST_F(RPCAccountObjectsHandlerTest, NFTReachLimitReturnMarker)
|
||||
EXPECT_EQ(output.value().as_object().at("account_objects").as_array().size(), 10);
|
||||
EXPECT_EQ(
|
||||
output.value().as_object().at("marker").as_string(),
|
||||
fmt::format("{},{}", ripple::strHex(current), std::numeric_limits<uint32_t>::max()));
|
||||
fmt::format("{},{}", ripple::strHex(current), std::numeric_limits<uint32_t>::max())
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1065,8 +1082,7 @@ TEST_F(RPCAccountObjectsHandlerTest, NFTReachLimitNoMarker)
|
||||
auto current = ripple::keylet::nftpage_max(account).key;
|
||||
std::string first{INDEX1};
|
||||
sort(first.begin(), first.end());
|
||||
for (auto i = 0; i < 10; i++)
|
||||
{
|
||||
for (auto i = 0; i < 10; i++) {
|
||||
std::next_permutation(first.begin(), first.end());
|
||||
auto previous =
|
||||
ripple::keylet::nftpage(ripple::keylet::nftpage_min(account), ripple::uint256{first.c_str()}).key;
|
||||
@@ -1089,7 +1105,8 @@ TEST_F(RPCAccountObjectsHandlerTest, NFTReachLimitNoMarker)
|
||||
"limit":{}
|
||||
}})",
|
||||
ACCOUNT,
|
||||
11));
|
||||
11
|
||||
));
|
||||
|
||||
auto const handler = AnyHandler{AccountObjectsHandler{mockBackendPtr}};
|
||||
runSpawn([&](auto yield) {
|
||||
@@ -1099,7 +1116,8 @@ TEST_F(RPCAccountObjectsHandlerTest, NFTReachLimitNoMarker)
|
||||
//"0000000000000000000000000000000000000000000000000000000000000000,4294967295"
|
||||
EXPECT_EQ(
|
||||
output.value().as_object().at("marker").as_string(),
|
||||
fmt::format("{},{}", ripple::strHex(ripple::uint256(beast::zero)), std::numeric_limits<uint32_t>::max()));
|
||||
fmt::format("{},{}", ripple::strHex(ripple::uint256(beast::zero)), std::numeric_limits<uint32_t>::max())
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1119,10 +1137,9 @@ TEST_F(RPCAccountObjectsHandlerTest, NFTMarker)
|
||||
|
||||
std::string first{INDEX1};
|
||||
auto current = ripple::keylet::nftpage(ripple::keylet::nftpage_min(account), ripple::uint256{first.c_str()}).key;
|
||||
const auto marker = current;
|
||||
auto const marker = current;
|
||||
sort(first.begin(), first.end());
|
||||
for (auto i = 0; i < 10; i++)
|
||||
{
|
||||
for (auto i = 0; i < 10; i++) {
|
||||
std::next_permutation(first.begin(), first.end());
|
||||
auto previous =
|
||||
ripple::keylet::nftpage(ripple::keylet::nftpage_min(account), ripple::uint256{first.c_str()}).key;
|
||||
@@ -1153,7 +1170,8 @@ TEST_F(RPCAccountObjectsHandlerTest, NFTMarker)
|
||||
ripple::to_string(ripple::xrpCurrency()),
|
||||
ACCOUNT2,
|
||||
toBase58(ripple::xrpAccount()),
|
||||
INDEX1);
|
||||
INDEX1
|
||||
);
|
||||
|
||||
std::vector<Blob> bbs;
|
||||
bbs.push_back(line.getSerializer().peekData());
|
||||
@@ -1172,7 +1190,8 @@ TEST_F(RPCAccountObjectsHandlerTest, NFTMarker)
|
||||
}})",
|
||||
ACCOUNT,
|
||||
ripple::strHex(marker),
|
||||
std::numeric_limits<uint32_t>::max()));
|
||||
std::numeric_limits<uint32_t>::max()
|
||||
));
|
||||
|
||||
auto const handler = AnyHandler{AccountObjectsHandler{mockBackendPtr}};
|
||||
runSpawn([&](auto yield) {
|
||||
@@ -1214,7 +1233,8 @@ TEST_F(RPCAccountObjectsHandlerTest, NFTMarkerNoMoreNFT)
|
||||
ripple::to_string(ripple::xrpCurrency()),
|
||||
ACCOUNT2,
|
||||
toBase58(ripple::xrpAccount()),
|
||||
INDEX1);
|
||||
INDEX1
|
||||
);
|
||||
|
||||
std::vector<Blob> bbs;
|
||||
bbs.push_back(line.getSerializer().peekData());
|
||||
@@ -1233,7 +1253,8 @@ TEST_F(RPCAccountObjectsHandlerTest, NFTMarkerNoMoreNFT)
|
||||
}})",
|
||||
ACCOUNT,
|
||||
ripple::strHex(ripple::uint256{beast::zero}),
|
||||
std::numeric_limits<uint32_t>::max()));
|
||||
std::numeric_limits<uint32_t>::max()
|
||||
));
|
||||
|
||||
auto const handler = AnyHandler{AccountObjectsHandler{mockBackendPtr}};
|
||||
runSpawn([&](auto yield) {
|
||||
@@ -1266,7 +1287,8 @@ TEST_F(RPCAccountObjectsHandlerTest, NFTMarkerNotInRange)
|
||||
}})",
|
||||
ACCOUNT,
|
||||
INDEX1,
|
||||
std::numeric_limits<std::uint32_t>::max()));
|
||||
std::numeric_limits<std::uint32_t>::max()
|
||||
));
|
||||
|
||||
auto const handler = AnyHandler{AccountObjectsHandler{mockBackendPtr}};
|
||||
runSpawn([&](auto yield) {
|
||||
@@ -1304,7 +1326,8 @@ TEST_F(RPCAccountObjectsHandlerTest, NFTMarkerNotExist)
|
||||
}})",
|
||||
ACCOUNT,
|
||||
ripple::strHex(accountNftMax),
|
||||
std::numeric_limits<std::uint32_t>::max()));
|
||||
std::numeric_limits<std::uint32_t>::max()
|
||||
));
|
||||
|
||||
auto const handler = AnyHandler{AccountObjectsHandler{mockBackendPtr}};
|
||||
runSpawn([&](auto yield) {
|
||||
@@ -1332,10 +1355,9 @@ TEST_F(RPCAccountObjectsHandlerTest, NFTLimitAdjust)
|
||||
|
||||
std::string first{INDEX1};
|
||||
auto current = ripple::keylet::nftpage(ripple::keylet::nftpage_min(account), ripple::uint256{first.c_str()}).key;
|
||||
const auto marker = current;
|
||||
auto const marker = current;
|
||||
sort(first.begin(), first.end());
|
||||
for (auto i = 0; i < 10; i++)
|
||||
{
|
||||
for (auto i = 0; i < 10; i++) {
|
||||
std::next_permutation(first.begin(), first.end());
|
||||
auto previous =
|
||||
ripple::keylet::nftpage(ripple::keylet::nftpage_min(account), ripple::uint256{first.c_str()}).key;
|
||||
@@ -1365,7 +1387,8 @@ TEST_F(RPCAccountObjectsHandlerTest, NFTLimitAdjust)
|
||||
ripple::to_string(ripple::xrpCurrency()),
|
||||
ACCOUNT2,
|
||||
toBase58(ripple::xrpAccount()),
|
||||
INDEX1);
|
||||
INDEX1
|
||||
);
|
||||
|
||||
std::vector<Blob> bbs;
|
||||
bbs.push_back(line.getSerializer().peekData());
|
||||
@@ -1385,7 +1408,8 @@ TEST_F(RPCAccountObjectsHandlerTest, NFTLimitAdjust)
|
||||
}})",
|
||||
ACCOUNT,
|
||||
ripple::strHex(marker),
|
||||
std::numeric_limits<uint32_t>::max()));
|
||||
std::numeric_limits<uint32_t>::max()
|
||||
));
|
||||
|
||||
auto const handler = AnyHandler{AccountObjectsHandler{mockBackendPtr}};
|
||||
runSpawn([&](auto yield) {
|
||||
@@ -1484,7 +1508,8 @@ TEST_F(RPCAccountObjectsHandlerTest, FilterNFT)
|
||||
"account":"{}",
|
||||
"type": "nft_page"
|
||||
}})",
|
||||
ACCOUNT));
|
||||
ACCOUNT
|
||||
));
|
||||
|
||||
auto const handler = AnyHandler{AccountObjectsHandler{mockBackendPtr}};
|
||||
runSpawn([&](auto yield) {
|
||||
@@ -1519,8 +1544,7 @@ TEST_F(RPCAccountObjectsHandlerTest, NFTZeroMarkerNotAffectOtherMarker)
|
||||
EXPECT_CALL(*rawBackendPtr, doFetchLedgerObject).Times(2);
|
||||
|
||||
std::vector<Blob> bbs;
|
||||
while (count-- != 0)
|
||||
{
|
||||
while (count-- != 0) {
|
||||
auto const line1 = CreateRippleStateLedgerObject("USD", ISSUER, 100, ACCOUNT, 10, ACCOUNT2, 20, TXNID, 123, 0);
|
||||
bbs.push_back(line1.getSerializer().peekData());
|
||||
}
|
||||
@@ -1536,7 +1560,8 @@ TEST_F(RPCAccountObjectsHandlerTest, NFTZeroMarkerNotAffectOtherMarker)
|
||||
ACCOUNT,
|
||||
limit,
|
||||
ripple::strHex(ripple::uint256{beast::zero}),
|
||||
std::numeric_limits<uint32_t>::max()));
|
||||
std::numeric_limits<uint32_t>::max()
|
||||
));
|
||||
|
||||
auto const handler = AnyHandler{AccountObjectsHandler{mockBackendPtr}};
|
||||
runSpawn([&](auto yield) {
|
||||
@@ -1581,7 +1606,8 @@ TEST_F(RPCAccountObjectsHandlerTest, LimitLessThanMin)
|
||||
}}
|
||||
]
|
||||
}})",
|
||||
AccountObjectsHandler::LIMIT_MIN);
|
||||
AccountObjectsHandler::LIMIT_MIN
|
||||
);
|
||||
|
||||
auto const rawBackendPtr = dynamic_cast<MockBackend*>(mockBackendPtr.get());
|
||||
ASSERT_NE(rawBackendPtr, nullptr);
|
||||
@@ -1618,7 +1644,8 @@ TEST_F(RPCAccountObjectsHandlerTest, LimitLessThanMin)
|
||||
"limit": {}
|
||||
}})",
|
||||
ACCOUNT,
|
||||
AccountObjectsHandler::LIMIT_MIN - 1));
|
||||
AccountObjectsHandler::LIMIT_MIN - 1
|
||||
));
|
||||
|
||||
auto const handler = AnyHandler{AccountObjectsHandler{mockBackendPtr}};
|
||||
runSpawn([&](auto yield) {
|
||||
@@ -1662,7 +1689,8 @@ TEST_F(RPCAccountObjectsHandlerTest, LimitMoreThanMax)
|
||||
}}
|
||||
]
|
||||
}})",
|
||||
AccountObjectsHandler::LIMIT_MAX);
|
||||
AccountObjectsHandler::LIMIT_MAX
|
||||
);
|
||||
|
||||
auto const rawBackendPtr = dynamic_cast<MockBackend*>(mockBackendPtr.get());
|
||||
ASSERT_NE(rawBackendPtr, nullptr);
|
||||
@@ -1699,7 +1727,8 @@ TEST_F(RPCAccountObjectsHandlerTest, LimitMoreThanMax)
|
||||
"limit": {}
|
||||
}})",
|
||||
ACCOUNT,
|
||||
AccountObjectsHandler::LIMIT_MAX + 1));
|
||||
AccountObjectsHandler::LIMIT_MAX + 1
|
||||
));
|
||||
|
||||
auto const handler = AnyHandler{AccountObjectsHandler{mockBackendPtr}};
|
||||
runSpawn([&](auto yield) {
|
||||
|
||||
Reference in New Issue
Block a user