mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-04 11:55:51 +00:00
style: clang-tidy auto fixes (#2741)
Co-authored-by: godexsoft <385326+godexsoft@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
be6aaffa7a
commit
8375eb1766
@@ -36,9 +36,7 @@
|
|||||||
#include <xrpl/protocol/LedgerFormats.h>
|
#include <xrpl/protocol/LedgerFormats.h>
|
||||||
#include <xrpl/protocol/LedgerHeader.h>
|
#include <xrpl/protocol/LedgerHeader.h>
|
||||||
#include <xrpl/protocol/SField.h>
|
#include <xrpl/protocol/SField.h>
|
||||||
#include <xrpl/protocol/STAmount.h>
|
|
||||||
#include <xrpl/protocol/STLedgerEntry.h>
|
#include <xrpl/protocol/STLedgerEntry.h>
|
||||||
#include <xrpl/protocol/UintTypes.h>
|
|
||||||
#include <xrpl/protocol/jss.h>
|
#include <xrpl/protocol/jss.h>
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|||||||
@@ -64,8 +64,8 @@ public:
|
|||||||
std::string issuer;
|
std::string issuer;
|
||||||
uint32_t sequence{};
|
uint32_t sequence{};
|
||||||
|
|
||||||
std::optional<uint16_t> transferFee{};
|
std::optional<uint16_t> transferFee;
|
||||||
std::optional<uint8_t> assetScale{};
|
std::optional<uint8_t> assetScale;
|
||||||
|
|
||||||
std::optional<std::uint64_t> maximumAmount;
|
std::optional<std::uint64_t> maximumAmount;
|
||||||
std::optional<std::uint64_t> outstandingAmount;
|
std::optional<std::uint64_t> outstandingAmount;
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
#include <boost/json/conversion.hpp>
|
#include <boost/json/conversion.hpp>
|
||||||
#include <boost/json/object.hpp>
|
#include <boost/json/object.hpp>
|
||||||
#include <boost/json/value.hpp>
|
#include <boost/json/value.hpp>
|
||||||
|
#include <boost/json/value_from.hpp>
|
||||||
#include <boost/json/value_to.hpp>
|
#include <boost/json/value_to.hpp>
|
||||||
#include <xrpl/basics/strHex.h>
|
#include <xrpl/basics/strHex.h>
|
||||||
#include <xrpl/protocol/AccountID.h>
|
#include <xrpl/protocol/AccountID.h>
|
||||||
@@ -36,9 +37,7 @@
|
|||||||
#include <xrpl/protocol/LedgerFormats.h>
|
#include <xrpl/protocol/LedgerFormats.h>
|
||||||
#include <xrpl/protocol/LedgerHeader.h>
|
#include <xrpl/protocol/LedgerHeader.h>
|
||||||
#include <xrpl/protocol/SField.h>
|
#include <xrpl/protocol/SField.h>
|
||||||
#include <xrpl/protocol/STAmount.h>
|
|
||||||
#include <xrpl/protocol/STLedgerEntry.h>
|
#include <xrpl/protocol/STLedgerEntry.h>
|
||||||
#include <xrpl/protocol/UintTypes.h>
|
|
||||||
#include <xrpl/protocol/jss.h>
|
#include <xrpl/protocol/jss.h>
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
#include "util/NameGenerator.hpp"
|
#include "util/NameGenerator.hpp"
|
||||||
#include "util/TestObject.hpp"
|
#include "util/TestObject.hpp"
|
||||||
|
|
||||||
|
#include <boost/asio/spawn.hpp>
|
||||||
#include <boost/json/parse.hpp>
|
#include <boost/json/parse.hpp>
|
||||||
#include <boost/json/value.hpp>
|
#include <boost/json/value.hpp>
|
||||||
#include <boost/json/value_to.hpp>
|
#include <boost/json/value_to.hpp>
|
||||||
@@ -40,6 +41,7 @@
|
|||||||
#include <xrpl/protocol/STObject.h>
|
#include <xrpl/protocol/STObject.h>
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
#include <functional>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@@ -136,48 +138,48 @@ static auto
|
|||||||
generateTestValuesForInvalidParamsTest()
|
generateTestValuesForInvalidParamsTest()
|
||||||
{
|
{
|
||||||
return std::vector<AccountMPTokenIssuancesParamTestCaseBundle>{
|
return std::vector<AccountMPTokenIssuancesParamTestCaseBundle>{
|
||||||
{"NonHexLedgerHash",
|
{.testName="NonHexLedgerHash",
|
||||||
fmt::format(R"JSON({{ "account": "{}", "ledger_hash": "xxx" }})JSON", kACCOUNT),
|
.testJson=fmt::format(R"JSON({{ "account": "{}", "ledger_hash": "xxx" }})JSON", kACCOUNT),
|
||||||
"invalidParams",
|
.expectedError="invalidParams",
|
||||||
"ledger_hashMalformed"},
|
.expectedErrorMessage="ledger_hashMalformed"},
|
||||||
{"NonStringLedgerHash",
|
{.testName="NonStringLedgerHash",
|
||||||
fmt::format(R"JSON({{ "account": "{}", "ledger_hash": 123 }})JSON", kACCOUNT),
|
.testJson=fmt::format(R"JSON({{ "account": "{}", "ledger_hash": 123 }})JSON", kACCOUNT),
|
||||||
"invalidParams",
|
.expectedError="invalidParams",
|
||||||
"ledger_hashNotString"},
|
.expectedErrorMessage="ledger_hashNotString"},
|
||||||
{"InvalidLedgerIndexString",
|
{.testName="InvalidLedgerIndexString",
|
||||||
fmt::format(R"JSON({{ "account": "{}", "ledger_index": "notvalidated" }})JSON", kACCOUNT),
|
.testJson=fmt::format(R"JSON({{ "account": "{}", "ledger_index": "notvalidated" }})JSON", kACCOUNT),
|
||||||
"invalidParams",
|
.expectedError="invalidParams",
|
||||||
"ledgerIndexMalformed"},
|
.expectedErrorMessage="ledgerIndexMalformed"},
|
||||||
{"MarkerNotString",
|
{.testName="MarkerNotString",
|
||||||
fmt::format(R"JSON({{ "account": "{}", "marker": 9 }})JSON", kACCOUNT),
|
.testJson=fmt::format(R"JSON({{ "account": "{}", "marker": 9 }})JSON", kACCOUNT),
|
||||||
"invalidParams",
|
.expectedError="invalidParams",
|
||||||
"markerNotString"},
|
.expectedErrorMessage="markerNotString"},
|
||||||
{"InvalidMarkerContent",
|
{.testName="InvalidMarkerContent",
|
||||||
fmt::format(R"JSON({{ "account": "{}", "marker": "123invalid" }})JSON", kACCOUNT),
|
.testJson=fmt::format(R"JSON({{ "account": "{}", "marker": "123invalid" }})JSON", kACCOUNT),
|
||||||
"invalidParams",
|
.expectedError="invalidParams",
|
||||||
"Malformed cursor."},
|
.expectedErrorMessage="Malformed cursor."},
|
||||||
{"AccountMissing", R"JSON({ "limit": 10 })JSON", "invalidParams", "Required field 'account' missing"},
|
{.testName="AccountMissing", .testJson=R"JSON({ "limit": 10 })JSON", .expectedError="invalidParams", .expectedErrorMessage="Required field 'account' missing"},
|
||||||
{"AccountNotString", R"JSON({ "account": 123 })JSON", "actMalformed", "Account malformed."},
|
{.testName="AccountNotString", .testJson=R"JSON({ "account": 123 })JSON", .expectedError="actMalformed", .expectedErrorMessage="Account malformed."},
|
||||||
{"AccountMalformed",
|
{.testName="AccountMalformed",
|
||||||
R"JSON({ "account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jp" })JSON",
|
.testJson=R"JSON({ "account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jp" })JSON",
|
||||||
"actMalformed",
|
.expectedError="actMalformed",
|
||||||
"Account malformed."},
|
.expectedErrorMessage="Account malformed."},
|
||||||
{"LimitNotInteger",
|
{.testName="LimitNotInteger",
|
||||||
fmt::format(R"JSON({{ "account": "{}", "limit": "t" }})JSON", kACCOUNT),
|
.testJson=fmt::format(R"JSON({{ "account": "{}", "limit": "t" }})JSON", kACCOUNT),
|
||||||
"invalidParams",
|
.expectedError="invalidParams",
|
||||||
"Invalid parameters."},
|
.expectedErrorMessage="Invalid parameters."},
|
||||||
{"LimitNegative",
|
{.testName="LimitNegative",
|
||||||
fmt::format(R"JSON({{ "account": "{}", "limit": -1 }})JSON", kACCOUNT),
|
.testJson=fmt::format(R"JSON({{ "account": "{}", "limit": -1 }})JSON", kACCOUNT),
|
||||||
"invalidParams",
|
.expectedError="invalidParams",
|
||||||
"Invalid parameters."},
|
.expectedErrorMessage="Invalid parameters."},
|
||||||
{"LimitZero",
|
{.testName="LimitZero",
|
||||||
fmt::format(R"JSON({{ "account": "{}", "limit": 0 }})JSON", kACCOUNT),
|
.testJson=fmt::format(R"JSON({{ "account": "{}", "limit": 0 }})JSON", kACCOUNT),
|
||||||
"invalidParams",
|
.expectedError="invalidParams",
|
||||||
"Invalid parameters."},
|
.expectedErrorMessage="Invalid parameters."},
|
||||||
{"LimitTypeInvalid",
|
{.testName="LimitTypeInvalid",
|
||||||
fmt::format(R"JSON({{ "account": "{}", "limit": true }})JSON", kACCOUNT),
|
.testJson=fmt::format(R"JSON({{ "account": "{}", "limit": true }})JSON", kACCOUNT),
|
||||||
"invalidParams",
|
.expectedError="invalidParams",
|
||||||
"Invalid parameters."}
|
.expectedErrorMessage="Invalid parameters."}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -436,7 +438,7 @@ TEST_F(RPCAccountMPTokenIssuancesHandlerTest, DefaultParameters)
|
|||||||
|
|
||||||
TEST_F(RPCAccountMPTokenIssuancesHandlerTest, UseLimit)
|
TEST_F(RPCAccountMPTokenIssuancesHandlerTest, UseLimit)
|
||||||
{
|
{
|
||||||
constexpr int limit = 20;
|
constexpr int kLIMIT = 20;
|
||||||
auto ledgerHeader = createLedgerHeader(kLEDGER_HASH, 30);
|
auto ledgerHeader = createLedgerHeader(kLEDGER_HASH, 30);
|
||||||
ON_CALL(*backend_, fetchLedgerBySequence).WillByDefault(Return(ledgerHeader));
|
ON_CALL(*backend_, fetchLedgerBySequence).WillByDefault(Return(ledgerHeader));
|
||||||
|
|
||||||
@@ -449,7 +451,7 @@ TEST_F(RPCAccountMPTokenIssuancesHandlerTest, UseLimit)
|
|||||||
std::vector<Blob> bbs;
|
std::vector<Blob> bbs;
|
||||||
|
|
||||||
for (int i = 0; i < 50; ++i) {
|
for (int i = 0; i < 50; ++i) {
|
||||||
indexes.emplace_back(ripple::uint256{kISSUANCE_INDEX1});
|
indexes.emplace_back(kISSUANCE_INDEX1);
|
||||||
auto const issuance = createMptIssuanceObject(kACCOUNT, i);
|
auto const issuance = createMptIssuanceObject(kACCOUNT, i);
|
||||||
bbs.push_back(issuance.getSerializer().peekData());
|
bbs.push_back(issuance.getSerializer().peekData());
|
||||||
}
|
}
|
||||||
@@ -462,7 +464,7 @@ TEST_F(RPCAccountMPTokenIssuancesHandlerTest, UseLimit)
|
|||||||
ON_CALL(*backend_, doFetchLedgerObjects).WillByDefault(Return(bbs));
|
ON_CALL(*backend_, doFetchLedgerObjects).WillByDefault(Return(bbs));
|
||||||
EXPECT_CALL(*backend_, doFetchLedgerObjects).Times(3);
|
EXPECT_CALL(*backend_, doFetchLedgerObjects).Times(3);
|
||||||
|
|
||||||
runSpawn([this, limit](auto yield) {
|
runSpawn([this, kLIMIT](auto yield) {
|
||||||
auto const input = json::parse(
|
auto const input = json::parse(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
R"JSON({{
|
R"JSON({{
|
||||||
@@ -470,7 +472,7 @@ TEST_F(RPCAccountMPTokenIssuancesHandlerTest, UseLimit)
|
|||||||
"limit": {}
|
"limit": {}
|
||||||
}})JSON",
|
}})JSON",
|
||||||
kACCOUNT,
|
kACCOUNT,
|
||||||
limit
|
kLIMIT
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -479,7 +481,7 @@ TEST_F(RPCAccountMPTokenIssuancesHandlerTest, UseLimit)
|
|||||||
ASSERT_TRUE(output);
|
ASSERT_TRUE(output);
|
||||||
|
|
||||||
auto const resultJson = (*output.result).as_object();
|
auto const resultJson = (*output.result).as_object();
|
||||||
EXPECT_EQ(resultJson.at("mpt_issuances").as_array().size(), limit);
|
EXPECT_EQ(resultJson.at("mpt_issuances").as_array().size(), kLIMIT);
|
||||||
ASSERT_TRUE(resultJson.contains("marker"));
|
ASSERT_TRUE(resultJson.contains("marker"));
|
||||||
EXPECT_THAT(boost::json::value_to<std::string>(resultJson.at("marker")), EndsWith(",0"));
|
EXPECT_THAT(boost::json::value_to<std::string>(resultJson.at("marker")), EndsWith(",0"));
|
||||||
});
|
});
|
||||||
@@ -534,11 +536,13 @@ TEST_F(RPCAccountMPTokenIssuancesHandlerTest, MarkerOutput)
|
|||||||
EXPECT_CALL(*backend_, doFetchLedgerObject).Times(3);
|
EXPECT_CALL(*backend_, doFetchLedgerObject).Times(3);
|
||||||
|
|
||||||
std::vector<ripple::uint256> indexes;
|
std::vector<ripple::uint256> indexes;
|
||||||
|
indexes.reserve(10);
|
||||||
for (int i = 0; i < 10; ++i) {
|
for (int i = 0; i < 10; ++i) {
|
||||||
indexes.emplace_back(kISSUANCE_INDEX1);
|
indexes.emplace_back(kISSUANCE_INDEX1);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<Blob> bbs;
|
std::vector<Blob> bbs;
|
||||||
|
bbs.reserve(kLIMIT);
|
||||||
for (int i = 0; i < kLIMIT; ++i) {
|
for (int i = 0; i < kLIMIT; ++i) {
|
||||||
bbs.push_back(createMptIssuanceObject(kACCOUNT, i).getSerializer().peekData());
|
bbs.push_back(createMptIssuanceObject(kACCOUNT, i).getSerializer().peekData());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,48 +112,48 @@ static auto
|
|||||||
generateTestValuesForInvalidParamsTest()
|
generateTestValuesForInvalidParamsTest()
|
||||||
{
|
{
|
||||||
return std::vector<AccountMPTokensParamTestCaseBundle>{
|
return std::vector<AccountMPTokensParamTestCaseBundle>{
|
||||||
{"NonHexLedgerHash",
|
{.testName="NonHexLedgerHash",
|
||||||
fmt::format(R"JSON({{ "account": "{}", "ledger_hash": "xxx" }})JSON", kACCOUNT),
|
.testJson=fmt::format(R"JSON({{ "account": "{}", "ledger_hash": "xxx" }})JSON", kACCOUNT),
|
||||||
"invalidParams",
|
.expectedError="invalidParams",
|
||||||
"ledger_hashMalformed"},
|
.expectedErrorMessage="ledger_hashMalformed"},
|
||||||
{"NonStringLedgerHash",
|
{.testName="NonStringLedgerHash",
|
||||||
fmt::format(R"JSON({{ "account": "{}", "ledger_hash": 123 }})JSON", kACCOUNT),
|
.testJson=fmt::format(R"JSON({{ "account": "{}", "ledger_hash": 123 }})JSON", kACCOUNT),
|
||||||
"invalidParams",
|
.expectedError="invalidParams",
|
||||||
"ledger_hashNotString"},
|
.expectedErrorMessage="ledger_hashNotString"},
|
||||||
{"InvalidLedgerIndexString",
|
{.testName="InvalidLedgerIndexString",
|
||||||
fmt::format(R"JSON({{ "account": "{}", "ledger_index": "notvalidated" }})JSON", kACCOUNT),
|
.testJson=fmt::format(R"JSON({{ "account": "{}", "ledger_index": "notvalidated" }})JSON", kACCOUNT),
|
||||||
"invalidParams",
|
.expectedError="invalidParams",
|
||||||
"ledgerIndexMalformed"},
|
.expectedErrorMessage="ledgerIndexMalformed"},
|
||||||
{"MarkerNotString",
|
{.testName="MarkerNotString",
|
||||||
fmt::format(R"JSON({{ "account": "{}", "marker": 9 }})JSON", kACCOUNT),
|
.testJson=fmt::format(R"JSON({{ "account": "{}", "marker": 9 }})JSON", kACCOUNT),
|
||||||
"invalidParams",
|
.expectedError="invalidParams",
|
||||||
"markerNotString"},
|
.expectedErrorMessage="markerNotString"},
|
||||||
{"InvalidMarkerContent",
|
{.testName="InvalidMarkerContent",
|
||||||
fmt::format(R"JSON({{ "account": "{}", "marker": "123invalid" }})JSON", kACCOUNT),
|
.testJson=fmt::format(R"JSON({{ "account": "{}", "marker": "123invalid" }})JSON", kACCOUNT),
|
||||||
"invalidParams",
|
.expectedError="invalidParams",
|
||||||
"Malformed cursor."},
|
.expectedErrorMessage="Malformed cursor."},
|
||||||
{"AccountMissing", R"JSON({ "limit": 10 })JSON", "invalidParams", "Required field 'account' missing"},
|
{.testName="AccountMissing", .testJson=R"JSON({ "limit": 10 })JSON", .expectedError="invalidParams", .expectedErrorMessage="Required field 'account' missing"},
|
||||||
{"AccountNotString", R"JSON({ "account": 123 })JSON", "actMalformed", "Account malformed."},
|
{.testName="AccountNotString", .testJson=R"JSON({ "account": 123 })JSON", .expectedError="actMalformed", .expectedErrorMessage="Account malformed."},
|
||||||
{"AccountMalformed",
|
{.testName="AccountMalformed",
|
||||||
fmt::format(R"JSON({{ "account": "{}" }})JSON", "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jp"),
|
.testJson=fmt::format(R"JSON({{ "account": "{}" }})JSON", "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jp"),
|
||||||
"actMalformed",
|
.expectedError="actMalformed",
|
||||||
"Account malformed."},
|
.expectedErrorMessage="Account malformed."},
|
||||||
{"LimitNotInteger",
|
{.testName="LimitNotInteger",
|
||||||
fmt::format(R"JSON({{ "account": "{}", "limit": "t" }})JSON", kACCOUNT),
|
.testJson=fmt::format(R"JSON({{ "account": "{}", "limit": "t" }})JSON", kACCOUNT),
|
||||||
"invalidParams",
|
.expectedError="invalidParams",
|
||||||
"Invalid parameters."},
|
.expectedErrorMessage="Invalid parameters."},
|
||||||
{"LimitNegative",
|
{.testName="LimitNegative",
|
||||||
fmt::format(R"JSON({{ "account": "{}", "limit": -1 }})JSON", kACCOUNT),
|
.testJson=fmt::format(R"JSON({{ "account": "{}", "limit": -1 }})JSON", kACCOUNT),
|
||||||
"invalidParams",
|
.expectedError="invalidParams",
|
||||||
"Invalid parameters."},
|
.expectedErrorMessage="Invalid parameters."},
|
||||||
{"LimitZero",
|
{.testName="LimitZero",
|
||||||
fmt::format(R"JSON({{ "account": "{}", "limit": 0 }})JSON", kACCOUNT),
|
.testJson=fmt::format(R"JSON({{ "account": "{}", "limit": 0 }})JSON", kACCOUNT),
|
||||||
"invalidParams",
|
.expectedError="invalidParams",
|
||||||
"Invalid parameters."},
|
.expectedErrorMessage="Invalid parameters."},
|
||||||
{"LimitTypeInvalid",
|
{.testName="LimitTypeInvalid",
|
||||||
fmt::format(R"JSON({{ "account": "{}", "limit": true }})JSON", kACCOUNT),
|
.testJson=fmt::format(R"JSON({{ "account": "{}", "limit": true }})JSON", kACCOUNT),
|
||||||
"invalidParams",
|
.expectedError="invalidParams",
|
||||||
"Invalid parameters."}
|
.expectedErrorMessage="Invalid parameters."}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -388,7 +388,7 @@ TEST_F(RPCAccountMPTokensHandlerTest, DefaultParameters)
|
|||||||
|
|
||||||
TEST_F(RPCAccountMPTokensHandlerTest, UseLimit)
|
TEST_F(RPCAccountMPTokensHandlerTest, UseLimit)
|
||||||
{
|
{
|
||||||
constexpr int limit = 20;
|
constexpr int kLIMIT = 20;
|
||||||
auto ledgerHeader = createLedgerHeader(kLEDGER_HASH, 30);
|
auto ledgerHeader = createLedgerHeader(kLEDGER_HASH, 30);
|
||||||
ON_CALL(*backend_, fetchLedgerBySequence).WillByDefault(Return(ledgerHeader));
|
ON_CALL(*backend_, fetchLedgerBySequence).WillByDefault(Return(ledgerHeader));
|
||||||
|
|
||||||
@@ -401,7 +401,7 @@ TEST_F(RPCAccountMPTokensHandlerTest, UseLimit)
|
|||||||
std::vector<Blob> bbs;
|
std::vector<Blob> bbs;
|
||||||
|
|
||||||
for (int i = 0; i < 50; ++i) {
|
for (int i = 0; i < 50; ++i) {
|
||||||
indexes.emplace_back(ripple::uint256{kTOKEN_INDEX1});
|
indexes.emplace_back(kTOKEN_INDEX1);
|
||||||
auto const token = createMpTokenObject(kACCOUNT, ripple::uint192(kISSUANCE_ID_HEX), i, 0, std::nullopt);
|
auto const token = createMpTokenObject(kACCOUNT, ripple::uint192(kISSUANCE_ID_HEX), i, 0, std::nullopt);
|
||||||
bbs.push_back(token.getSerializer().peekData());
|
bbs.push_back(token.getSerializer().peekData());
|
||||||
}
|
}
|
||||||
@@ -414,7 +414,7 @@ TEST_F(RPCAccountMPTokensHandlerTest, UseLimit)
|
|||||||
ON_CALL(*backend_, doFetchLedgerObjects).WillByDefault(Return(bbs));
|
ON_CALL(*backend_, doFetchLedgerObjects).WillByDefault(Return(bbs));
|
||||||
EXPECT_CALL(*backend_, doFetchLedgerObjects).Times(3);
|
EXPECT_CALL(*backend_, doFetchLedgerObjects).Times(3);
|
||||||
|
|
||||||
runSpawn([this, limit](auto yield) {
|
runSpawn([this, kLIMIT](auto yield) {
|
||||||
auto const input = json::parse(
|
auto const input = json::parse(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
R"JSON({{
|
R"JSON({{
|
||||||
@@ -422,7 +422,7 @@ TEST_F(RPCAccountMPTokensHandlerTest, UseLimit)
|
|||||||
"limit": {}
|
"limit": {}
|
||||||
}})JSON",
|
}})JSON",
|
||||||
kACCOUNT,
|
kACCOUNT,
|
||||||
limit
|
kLIMIT
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -431,7 +431,7 @@ TEST_F(RPCAccountMPTokensHandlerTest, UseLimit)
|
|||||||
ASSERT_TRUE(output);
|
ASSERT_TRUE(output);
|
||||||
|
|
||||||
auto const resultJson = (*output.result).as_object();
|
auto const resultJson = (*output.result).as_object();
|
||||||
EXPECT_EQ(resultJson.at("mptokens").as_array().size(), limit);
|
EXPECT_EQ(resultJson.at("mptokens").as_array().size(), kLIMIT);
|
||||||
ASSERT_TRUE(resultJson.contains("marker"));
|
ASSERT_TRUE(resultJson.contains("marker"));
|
||||||
EXPECT_THAT(boost::json::value_to<std::string>(resultJson.at("marker")), EndsWith(",0"));
|
EXPECT_THAT(boost::json::value_to<std::string>(resultJson.at("marker")), EndsWith(",0"));
|
||||||
});
|
});
|
||||||
@@ -487,6 +487,7 @@ TEST_F(RPCAccountMPTokensHandlerTest, MarkerOutput)
|
|||||||
ON_CALL(*backend_, doFetchLedgerObject(accountKk, _, _)).WillByDefault(Return(Blob{'f', 'a', 'k', 'e'}));
|
ON_CALL(*backend_, doFetchLedgerObject(accountKk, _, _)).WillByDefault(Return(Blob{'f', 'a', 'k', 'e'}));
|
||||||
|
|
||||||
std::vector<Blob> bbs;
|
std::vector<Blob> bbs;
|
||||||
|
bbs.reserve(kLIMIT);
|
||||||
for (int i = 0; i < kLIMIT; ++i) {
|
for (int i = 0; i < kLIMIT; ++i) {
|
||||||
bbs.push_back(createMpTokenObject(kACCOUNT, ripple::uint192(kISSUANCE_ID_HEX), i, 0, std::nullopt)
|
bbs.push_back(createMpTokenObject(kACCOUNT, ripple::uint192(kISSUANCE_ID_HEX), i, 0, std::nullopt)
|
||||||
.getSerializer()
|
.getSerializer()
|
||||||
@@ -495,6 +496,7 @@ TEST_F(RPCAccountMPTokensHandlerTest, MarkerOutput)
|
|||||||
EXPECT_CALL(*backend_, doFetchLedgerObjects).WillOnce(Return(bbs));
|
EXPECT_CALL(*backend_, doFetchLedgerObjects).WillOnce(Return(bbs));
|
||||||
|
|
||||||
std::vector<ripple::uint256> indexes1;
|
std::vector<ripple::uint256> indexes1;
|
||||||
|
indexes1.reserve(10);
|
||||||
for (int i = 0; i < 10; ++i) {
|
for (int i = 0; i < 10; ++i) {
|
||||||
indexes1.emplace_back(kTOKEN_INDEX1);
|
indexes1.emplace_back(kTOKEN_INDEX1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user