mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-19 19:25:53 +00:00
style: Update pre-commit hooks (#2290)
Update versions of pre-commit hooks to latest version. Co-authored-by: mathbunnyru <12270691+mathbunnyru@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
1fe323190a
commit
cc506fd094
@@ -310,17 +310,19 @@ TEST_F(RPCNFTHistoryHandlerTest, IndexSpecificForwardTrue)
|
||||
|
||||
runSpawn([&, this](auto yield) {
|
||||
auto const handler = AnyHandler{NFTHistoryHandler{backend_}};
|
||||
static auto const kINPUT = json::parse(fmt::format(
|
||||
R"JSON({{
|
||||
static auto const kINPUT = json::parse(
|
||||
fmt::format(
|
||||
R"JSON({{
|
||||
"nft_id": "{}",
|
||||
"ledger_index_min": {},
|
||||
"ledger_index_max": {},
|
||||
"forward": true
|
||||
}})JSON",
|
||||
kNFT_ID,
|
||||
kMIN_SEQ + 1,
|
||||
kMAX_SEQ - 1
|
||||
));
|
||||
kNFT_ID,
|
||||
kMIN_SEQ + 1,
|
||||
kMAX_SEQ - 1
|
||||
)
|
||||
);
|
||||
auto const output = handler.process(kINPUT, Context{yield});
|
||||
ASSERT_TRUE(output);
|
||||
EXPECT_EQ(output.result->at("nft_id").as_string(), kNFT_ID);
|
||||
@@ -454,17 +456,19 @@ TEST_F(RPCNFTHistoryHandlerTest, IndexSpecificForwardFalseV1)
|
||||
|
||||
runSpawn([&, this](auto yield) {
|
||||
auto const handler = AnyHandler{NFTHistoryHandler{backend_}};
|
||||
static auto const kINPUT = json::parse(fmt::format(
|
||||
R"JSON({{
|
||||
static auto const kINPUT = json::parse(
|
||||
fmt::format(
|
||||
R"JSON({{
|
||||
"nft_id": "{}",
|
||||
"ledger_index_min": {},
|
||||
"ledger_index_max": {},
|
||||
"forward": false
|
||||
}})JSON",
|
||||
kNFT_ID,
|
||||
kMIN_SEQ + 1,
|
||||
kMAX_SEQ - 1
|
||||
));
|
||||
kNFT_ID,
|
||||
kMIN_SEQ + 1,
|
||||
kMAX_SEQ - 1
|
||||
)
|
||||
);
|
||||
auto const output = handler.process(kINPUT, Context{yield});
|
||||
ASSERT_TRUE(output);
|
||||
EXPECT_EQ(output.result.value(), boost::json::parse(kOUTPUT));
|
||||
@@ -608,17 +612,19 @@ TEST_F(RPCNFTHistoryHandlerTest, IndexSpecificForwardFalseV2)
|
||||
|
||||
runSpawn([&, this](auto yield) {
|
||||
auto const handler = AnyHandler{NFTHistoryHandler{backend_}};
|
||||
static auto const kINPUT = json::parse(fmt::format(
|
||||
R"JSON({{
|
||||
static auto const kINPUT = json::parse(
|
||||
fmt::format(
|
||||
R"JSON({{
|
||||
"nft_id": "{}",
|
||||
"ledger_index_min": {},
|
||||
"ledger_index_max": {},
|
||||
"forward": false
|
||||
}})JSON",
|
||||
kNFT_ID,
|
||||
kMIN_SEQ + 1,
|
||||
kMAX_SEQ - 1
|
||||
));
|
||||
kNFT_ID,
|
||||
kMIN_SEQ + 1,
|
||||
kMAX_SEQ - 1
|
||||
)
|
||||
);
|
||||
auto const output = handler.process(kINPUT, Context{.yield = yield, .apiVersion = 2u});
|
||||
ASSERT_TRUE(output);
|
||||
EXPECT_EQ(output.result.value(), boost::json::parse(kOUTPUT));
|
||||
@@ -640,17 +646,19 @@ TEST_F(RPCNFTHistoryHandlerTest, IndexNotSpecificForwardTrue)
|
||||
|
||||
runSpawn([&, this](auto yield) {
|
||||
auto const handler = AnyHandler{NFTHistoryHandler{backend_}};
|
||||
static auto const kINPUT = json::parse(fmt::format(
|
||||
R"JSON({{
|
||||
static auto const kINPUT = json::parse(
|
||||
fmt::format(
|
||||
R"JSON({{
|
||||
"nft_id": "{}",
|
||||
"ledger_index_min": {},
|
||||
"ledger_index_max": {},
|
||||
"forward": true
|
||||
}})JSON",
|
||||
kNFT_ID,
|
||||
-1,
|
||||
-1
|
||||
));
|
||||
kNFT_ID,
|
||||
-1,
|
||||
-1
|
||||
)
|
||||
);
|
||||
auto const output = handler.process(kINPUT, Context{yield});
|
||||
ASSERT_TRUE(output);
|
||||
EXPECT_EQ(output.result->at("nft_id").as_string(), kNFT_ID);
|
||||
@@ -681,17 +689,19 @@ TEST_F(RPCNFTHistoryHandlerTest, IndexNotSpecificForwardFalse)
|
||||
|
||||
runSpawn([&, this](auto yield) {
|
||||
auto const handler = AnyHandler{NFTHistoryHandler{backend_}};
|
||||
static auto const kINPUT = json::parse(fmt::format(
|
||||
R"JSON({{
|
||||
static auto const kINPUT = json::parse(
|
||||
fmt::format(
|
||||
R"JSON({{
|
||||
"nft_id": "{}",
|
||||
"ledger_index_min": {},
|
||||
"ledger_index_max": {},
|
||||
"forward": false
|
||||
}})JSON",
|
||||
kNFT_ID,
|
||||
-1,
|
||||
-1
|
||||
));
|
||||
kNFT_ID,
|
||||
-1,
|
||||
-1
|
||||
)
|
||||
);
|
||||
auto const output = handler.process(kINPUT, Context{yield});
|
||||
ASSERT_TRUE(output);
|
||||
EXPECT_EQ(output.result->at("nft_id").as_string(), kNFT_ID);
|
||||
@@ -722,17 +732,19 @@ TEST_F(RPCNFTHistoryHandlerTest, BinaryTrueV1)
|
||||
|
||||
runSpawn([&, this](auto yield) {
|
||||
auto const handler = AnyHandler{NFTHistoryHandler{backend_}};
|
||||
static auto const kINPUT = json::parse(fmt::format(
|
||||
R"JSON({{
|
||||
static auto const kINPUT = json::parse(
|
||||
fmt::format(
|
||||
R"JSON({{
|
||||
"nft_id": "{}",
|
||||
"ledger_index_min": {},
|
||||
"ledger_index_max": {},
|
||||
"binary": true
|
||||
}})JSON",
|
||||
kNFT_ID,
|
||||
-1,
|
||||
-1
|
||||
));
|
||||
kNFT_ID,
|
||||
-1,
|
||||
-1
|
||||
)
|
||||
);
|
||||
auto const output = handler.process(kINPUT, Context{yield});
|
||||
ASSERT_TRUE(output);
|
||||
EXPECT_EQ(output.result->at("nft_id").as_string(), kNFT_ID);
|
||||
@@ -776,17 +788,19 @@ TEST_F(RPCNFTHistoryHandlerTest, BinaryTrueV2)
|
||||
|
||||
runSpawn([&, this](auto yield) {
|
||||
auto const handler = AnyHandler{NFTHistoryHandler{backend_}};
|
||||
static auto const kINPUT = json::parse(fmt::format(
|
||||
R"JSON({{
|
||||
static auto const kINPUT = json::parse(
|
||||
fmt::format(
|
||||
R"JSON({{
|
||||
"nft_id": "{}",
|
||||
"ledger_index_min": {},
|
||||
"ledger_index_max": {},
|
||||
"binary": true
|
||||
}})JSON",
|
||||
kNFT_ID,
|
||||
-1,
|
||||
-1
|
||||
));
|
||||
kNFT_ID,
|
||||
-1,
|
||||
-1
|
||||
)
|
||||
);
|
||||
auto const output = handler.process(kINPUT, Context{.yield = yield, .apiVersion = 2u});
|
||||
ASSERT_TRUE(output);
|
||||
EXPECT_EQ(output.result->at("nft_id").as_string(), kNFT_ID);
|
||||
@@ -827,8 +841,9 @@ TEST_F(RPCNFTHistoryHandlerTest, LimitAndMarker)
|
||||
|
||||
runSpawn([&, this](auto yield) {
|
||||
auto const handler = AnyHandler{NFTHistoryHandler{backend_}};
|
||||
static auto const kINPUT = json::parse(fmt::format(
|
||||
R"JSON({{
|
||||
static auto const kINPUT = json::parse(
|
||||
fmt::format(
|
||||
R"JSON({{
|
||||
"nft_id": "{}",
|
||||
"ledger_index_min": {},
|
||||
"ledger_index_max": {},
|
||||
@@ -836,10 +851,11 @@ TEST_F(RPCNFTHistoryHandlerTest, LimitAndMarker)
|
||||
"forward": false,
|
||||
"marker": {{"ledger": 10, "seq": 11}}
|
||||
}})JSON",
|
||||
kNFT_ID,
|
||||
-1,
|
||||
-1
|
||||
));
|
||||
kNFT_ID,
|
||||
-1,
|
||||
-1
|
||||
)
|
||||
);
|
||||
auto const output = handler.process(kINPUT, Context{yield});
|
||||
ASSERT_TRUE(output);
|
||||
EXPECT_EQ(output.result->at("nft_id").as_string(), kNFT_ID);
|
||||
@@ -875,14 +891,16 @@ TEST_F(RPCNFTHistoryHandlerTest, SpecificLedgerIndex)
|
||||
|
||||
runSpawn([&, this](auto yield) {
|
||||
auto const handler = AnyHandler{NFTHistoryHandler{backend_}};
|
||||
static auto const kINPUT = json::parse(fmt::format(
|
||||
R"JSON({{
|
||||
static auto const kINPUT = json::parse(
|
||||
fmt::format(
|
||||
R"JSON({{
|
||||
"nft_id": "{}",
|
||||
"ledger_index": {}
|
||||
}})JSON",
|
||||
kNFT_ID,
|
||||
kMAX_SEQ - 1
|
||||
));
|
||||
kNFT_ID,
|
||||
kMAX_SEQ - 1
|
||||
)
|
||||
);
|
||||
auto const output = handler.process(kINPUT, Context{yield});
|
||||
ASSERT_TRUE(output);
|
||||
EXPECT_EQ(output.result->at("nft_id").as_string(), kNFT_ID);
|
||||
@@ -901,14 +919,16 @@ TEST_F(RPCNFTHistoryHandlerTest, SpecificNonexistLedgerIntIndex)
|
||||
|
||||
runSpawn([&, this](auto yield) {
|
||||
auto const handler = AnyHandler{NFTHistoryHandler{backend_}};
|
||||
static auto const kINPUT = json::parse(fmt::format(
|
||||
R"JSON({{
|
||||
static auto const kINPUT = json::parse(
|
||||
fmt::format(
|
||||
R"JSON({{
|
||||
"nft_id": "{}",
|
||||
"ledger_index": {}
|
||||
}})JSON",
|
||||
kNFT_ID,
|
||||
kMAX_SEQ - 1
|
||||
));
|
||||
kNFT_ID,
|
||||
kMAX_SEQ - 1
|
||||
)
|
||||
);
|
||||
auto const output = handler.process(kINPUT, Context{yield});
|
||||
ASSERT_FALSE(output);
|
||||
auto const err = rpc::makeError(output.result.error());
|
||||
@@ -924,14 +944,16 @@ TEST_F(RPCNFTHistoryHandlerTest, SpecificNonexistLedgerStringIndex)
|
||||
|
||||
runSpawn([&, this](auto yield) {
|
||||
auto const handler = AnyHandler{NFTHistoryHandler{backend_}};
|
||||
static auto const kINPUT = json::parse(fmt::format(
|
||||
R"JSON({{
|
||||
static auto const kINPUT = json::parse(
|
||||
fmt::format(
|
||||
R"JSON({{
|
||||
"nft_id": "{}",
|
||||
"ledger_index": "{}"
|
||||
}})JSON",
|
||||
kNFT_ID,
|
||||
kMAX_SEQ - 1
|
||||
));
|
||||
kNFT_ID,
|
||||
kMAX_SEQ - 1
|
||||
)
|
||||
);
|
||||
auto const output = handler.process(kINPUT, Context{yield});
|
||||
ASSERT_FALSE(output);
|
||||
auto const err = rpc::makeError(output.result.error());
|
||||
@@ -964,14 +986,16 @@ TEST_F(RPCNFTHistoryHandlerTest, SpecificLedgerHash)
|
||||
|
||||
runSpawn([&, this](auto yield) {
|
||||
auto const handler = AnyHandler{NFTHistoryHandler{backend_}};
|
||||
static auto const kINPUT = json::parse(fmt::format(
|
||||
R"JSON({{
|
||||
static auto const kINPUT = json::parse(
|
||||
fmt::format(
|
||||
R"JSON({{
|
||||
"nft_id": "{}",
|
||||
"ledger_hash": "{}"
|
||||
}})JSON",
|
||||
kNFT_ID,
|
||||
kLEDGER_HASH
|
||||
));
|
||||
kNFT_ID,
|
||||
kLEDGER_HASH
|
||||
)
|
||||
);
|
||||
auto const output = handler.process(kINPUT, Context{yield});
|
||||
ASSERT_TRUE(output);
|
||||
EXPECT_EQ(output.result->at("nft_id").as_string(), kNFT_ID);
|
||||
@@ -1002,17 +1026,19 @@ TEST_F(RPCNFTHistoryHandlerTest, TxLessThanMinSeq)
|
||||
|
||||
runSpawn([&, this](auto yield) {
|
||||
auto const handler = AnyHandler{NFTHistoryHandler{backend_}};
|
||||
static auto const kINPUT = json::parse(fmt::format(
|
||||
R"JSON({{
|
||||
static auto const kINPUT = json::parse(
|
||||
fmt::format(
|
||||
R"JSON({{
|
||||
"nft_id": "{}",
|
||||
"ledger_index_min": {},
|
||||
"ledger_index_max": {},
|
||||
"forward": false
|
||||
}})JSON",
|
||||
kNFT_ID,
|
||||
kMIN_SEQ + 2,
|
||||
kMAX_SEQ - 1
|
||||
));
|
||||
kNFT_ID,
|
||||
kMIN_SEQ + 2,
|
||||
kMAX_SEQ - 1
|
||||
)
|
||||
);
|
||||
auto const output = handler.process(kINPUT, Context{yield});
|
||||
ASSERT_TRUE(output);
|
||||
EXPECT_EQ(output.result->at("nft_id").as_string(), kNFT_ID);
|
||||
@@ -1043,17 +1069,19 @@ TEST_F(RPCNFTHistoryHandlerTest, TxLargerThanMaxSeq)
|
||||
|
||||
runSpawn([&, this](auto yield) {
|
||||
auto const handler = AnyHandler{NFTHistoryHandler{backend_}};
|
||||
static auto const kINPUT = json::parse(fmt::format(
|
||||
R"JSON({{
|
||||
static auto const kINPUT = json::parse(
|
||||
fmt::format(
|
||||
R"JSON({{
|
||||
"nft_id": "{}",
|
||||
"ledger_index_min": {},
|
||||
"ledger_index_max": {},
|
||||
"forward": false
|
||||
}})JSON",
|
||||
kNFT_ID,
|
||||
kMIN_SEQ + 1,
|
||||
kMAX_SEQ - 2
|
||||
));
|
||||
kNFT_ID,
|
||||
kMIN_SEQ + 1,
|
||||
kMAX_SEQ - 2
|
||||
)
|
||||
);
|
||||
auto const output = handler.process(kINPUT, Context{yield});
|
||||
ASSERT_TRUE(output);
|
||||
EXPECT_EQ(output.result->at("nft_id").as_string(), kNFT_ID);
|
||||
@@ -1084,19 +1112,21 @@ TEST_F(RPCNFTHistoryHandlerTest, LimitMoreThanMax)
|
||||
|
||||
runSpawn([&, this](auto yield) {
|
||||
auto const handler = AnyHandler{NFTHistoryHandler{backend_}};
|
||||
static auto const kINPUT = json::parse(fmt::format(
|
||||
R"JSON({{
|
||||
static auto const kINPUT = json::parse(
|
||||
fmt::format(
|
||||
R"JSON({{
|
||||
"nft_id": "{}",
|
||||
"ledger_index_min": {},
|
||||
"ledger_index_max": {},
|
||||
"forward": false,
|
||||
"limit": {}
|
||||
}})JSON",
|
||||
kNFT_ID,
|
||||
kMIN_SEQ + 1,
|
||||
kMAX_SEQ - 1,
|
||||
NFTHistoryHandler::kLIMIT_MAX + 1
|
||||
));
|
||||
kNFT_ID,
|
||||
kMIN_SEQ + 1,
|
||||
kMAX_SEQ - 1,
|
||||
NFTHistoryHandler::kLIMIT_MAX + 1
|
||||
)
|
||||
);
|
||||
auto const output = handler.process(kINPUT, Context{yield});
|
||||
ASSERT_TRUE(output);
|
||||
EXPECT_EQ(output.result->at("nft_id").as_string(), kNFT_ID);
|
||||
|
||||
Reference in New Issue
Block a user