mirror of
https://github.com/XRPLF/clio.git
synced 2025-12-06 17:27:58 +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
@@ -477,8 +477,9 @@ TEST_F(WebRPCServerHandlerTest, HTTPErrorPath)
|
||||
.WillOnce(testing::Return(true));
|
||||
|
||||
EXPECT_CALL(*rpcEngine, buildResponse(testing::_))
|
||||
.WillOnce(testing::Return(rpc::Result{rpc::Status{rpc::RippledError::rpcINVALID_PARAMS, "ledgerIndexMalformed"}}
|
||||
));
|
||||
.WillOnce(
|
||||
testing::Return(rpc::Result{rpc::Status{rpc::RippledError::rpcINVALID_PARAMS, "ledgerIndexMalformed"}})
|
||||
);
|
||||
|
||||
EXPECT_CALL(*etl, lastCloseAgeSeconds()).WillOnce(testing::Return(45));
|
||||
|
||||
@@ -525,8 +526,9 @@ TEST_F(WebRPCServerHandlerTest, WsErrorPath)
|
||||
.WillOnce(testing::Return(true));
|
||||
|
||||
EXPECT_CALL(*rpcEngine, buildResponse(testing::_))
|
||||
.WillOnce(testing::Return(rpc::Result{rpc::Status{rpc::RippledError::rpcINVALID_PARAMS, "ledgerIndexMalformed"}}
|
||||
));
|
||||
.WillOnce(
|
||||
testing::Return(rpc::Result{rpc::Status{rpc::RippledError::rpcINVALID_PARAMS, "ledgerIndexMalformed"}})
|
||||
);
|
||||
|
||||
EXPECT_CALL(*etl, lastCloseAgeSeconds()).WillOnce(testing::Return(45));
|
||||
|
||||
@@ -1026,8 +1028,8 @@ generateInvalidVersions()
|
||||
.wsMessage = fmt::format("Requested API version is lower than minimum supported ({})", rpc::kAPI_VERSION_MIN)},
|
||||
{.testName = "v4",
|
||||
.version = "4",
|
||||
.wsMessage = fmt::format("Requested API version is higher than maximum supported ({})", rpc::kAPI_VERSION_MAX)
|
||||
},
|
||||
.wsMessage =
|
||||
fmt::format("Requested API version is higher than maximum supported ({})", rpc::kAPI_VERSION_MAX)},
|
||||
{.testName = "null", .version = "null", .wsMessage = "API version must be an integer"},
|
||||
{.testName = "str", .version = "\"bogus\"", .wsMessage = "API version must be an integer"},
|
||||
{.testName = "bool", .version = "false", .wsMessage = "API version must be an integer"},
|
||||
|
||||
@@ -73,8 +73,9 @@ using namespace web;
|
||||
static boost::json::value
|
||||
generateJSONWithDynamicPort(std::string_view port)
|
||||
{
|
||||
return boost::json::parse(fmt::format(
|
||||
R"JSON({{
|
||||
return boost::json::parse(
|
||||
fmt::format(
|
||||
R"JSON({{
|
||||
"server": {{
|
||||
"ip": "0.0.0.0",
|
||||
"port": {}
|
||||
@@ -87,15 +88,17 @@ generateJSONWithDynamicPort(std::string_view port)
|
||||
"whitelist": ["127.0.0.1"]
|
||||
}}
|
||||
}})JSON",
|
||||
port
|
||||
));
|
||||
port
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
static boost::json::value
|
||||
generateJSONDataOverload(std::string_view port)
|
||||
{
|
||||
return boost::json::parse(fmt::format(
|
||||
R"JSON({{
|
||||
return boost::json::parse(
|
||||
fmt::format(
|
||||
R"JSON({{
|
||||
"server": {{
|
||||
"ip": "0.0.0.0",
|
||||
"port": {}
|
||||
@@ -107,8 +110,9 @@ generateJSONDataOverload(std::string_view port)
|
||||
"max_requests": 1
|
||||
}}
|
||||
}})JSON",
|
||||
port
|
||||
));
|
||||
port
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
inline static ClioConfigDefinition
|
||||
|
||||
@@ -202,8 +202,8 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
TEST(WeightsMakeTest, CreateFromConfig)
|
||||
{
|
||||
util::config::ClioConfigDefinition mockConfig{
|
||||
{"dos_guard.__ng_default_weight", util::config::ConfigValue{util::config::ConfigType::Integer}.defaultValue(10)
|
||||
},
|
||||
{"dos_guard.__ng_default_weight",
|
||||
util::config::ConfigValue{util::config::ConfigType::Integer}.defaultValue(10)},
|
||||
{"dos_guard.__ng_weights.[].method",
|
||||
util::config::Array{util::config::ConfigValue{util::config::ConfigType::String}}},
|
||||
{"dos_guard.__ng_weights.[].weight",
|
||||
|
||||
@@ -174,8 +174,7 @@ TEST_F(NgRpcServerHandlerTest, CoroutineSleepsUntilRpcEngineFinishes)
|
||||
EXPECT_CALL(dosguard_, add(ip_, testing::_)).WillOnce(Return(true));
|
||||
EXPECT_CALL(*rpcEngine_, post).WillOnce([&](auto&& fn, auto&&) {
|
||||
boost::asio::spawn(
|
||||
ctx_,
|
||||
[this, &rpcEngineDone, fn = std::forward<decltype(fn)>(fn)](boost::asio::yield_context yield) {
|
||||
ctx_, [this, &rpcEngineDone, fn = std::forward<decltype(fn)>(fn)](boost::asio::yield_context yield) {
|
||||
EXPECT_CALL(*rpcEngine_, notifyBadSyntax);
|
||||
fn(yield);
|
||||
rpcEngineDone.Call();
|
||||
@@ -440,9 +439,9 @@ TEST_F(NgRpcServerHandlerTest, HandleRequest_OutdatedWarning)
|
||||
|
||||
std::unordered_set<int64_t> warningCodes;
|
||||
std::ranges::transform(
|
||||
jsonResponse.at("warnings").as_array(),
|
||||
std::inserter(warningCodes, warningCodes.end()),
|
||||
[](auto const& w) { return w.as_object().at("id").as_int64(); }
|
||||
jsonResponse.at("warnings").as_array(), std::inserter(warningCodes, warningCodes.end()), [](auto const& w) {
|
||||
return w.as_object().at("id").as_int64();
|
||||
}
|
||||
);
|
||||
|
||||
EXPECT_EQ(warningCodes.size(), 2);
|
||||
@@ -464,9 +463,11 @@ TEST_F(NgRpcServerHandlerTest, HandleRequest_Successful_HttpRequest_Forwarded)
|
||||
EXPECT_CALL(*rpcEngine_, post).WillOnce([&](auto&& fn, auto&&) {
|
||||
EXPECT_CALL(connectionMetadata_, wasUpgraded).WillRepeatedly(Return(not request.isHttp()));
|
||||
EXPECT_CALL(*rpcEngine_, buildResponse)
|
||||
.WillOnce(Return(rpc::Result{rpc::ReturnType{boost::json::object{
|
||||
{"result", boost::json::object{{"some key", "some value"}}}, {"forwarded", true}
|
||||
}}}));
|
||||
.WillOnce(Return(
|
||||
rpc::Result{rpc::ReturnType{boost::json::object{
|
||||
{"result", boost::json::object{{"some key", "some value"}}}, {"forwarded", true}
|
||||
}}}
|
||||
));
|
||||
EXPECT_CALL(*rpcEngine_, notifyComplete);
|
||||
EXPECT_CALL(*etl_, lastCloseAgeSeconds).WillOnce(Return(1));
|
||||
fn(yield);
|
||||
@@ -500,9 +501,11 @@ TEST_F(NgRpcServerHandlerTest, HandleRequest_Successful_HttpRequest_HasError)
|
||||
EXPECT_CALL(*rpcEngine_, post).WillOnce([&](auto&& fn, auto&&) {
|
||||
EXPECT_CALL(connectionMetadata_, wasUpgraded).WillRepeatedly(Return(not request.isHttp()));
|
||||
EXPECT_CALL(*rpcEngine_, buildResponse)
|
||||
.WillOnce(Return(rpc::Result{
|
||||
rpc::ReturnType{boost::json::object{{"some key", "some value"}, {"error", "some error"}}}
|
||||
}));
|
||||
.WillOnce(Return(
|
||||
rpc::Result{
|
||||
rpc::ReturnType{boost::json::object{{"some key", "some value"}, {"error", "some error"}}}
|
||||
}
|
||||
));
|
||||
EXPECT_CALL(*rpcEngine_, notifyComplete);
|
||||
EXPECT_CALL(*etl_, lastCloseAgeSeconds).WillOnce(Return(1));
|
||||
fn(yield);
|
||||
@@ -587,9 +590,11 @@ TEST_F(NgRpcServerHandlerWsTest, HandleRequest_Successful_WsRequest_HasError)
|
||||
EXPECT_CALL(*rpcEngine_, post).WillOnce([&](auto&& fn, auto&&) {
|
||||
EXPECT_CALL(connectionMetadata_, wasUpgraded).WillRepeatedly(Return(not request.isHttp()));
|
||||
EXPECT_CALL(*rpcEngine_, buildResponse)
|
||||
.WillOnce(Return(rpc::Result{
|
||||
rpc::ReturnType{boost::json::object{{"some key", "some value"}, {"error", "some error"}}}
|
||||
}));
|
||||
.WillOnce(Return(
|
||||
rpc::Result{
|
||||
rpc::ReturnType{boost::json::object{{"some key", "some value"}, {"error", "some error"}}}
|
||||
}
|
||||
));
|
||||
EXPECT_CALL(*rpcEngine_, notifyComplete);
|
||||
EXPECT_CALL(*etl_, lastCloseAgeSeconds).WillOnce(Return(1));
|
||||
fn(yield);
|
||||
|
||||
Reference in New Issue
Block a user