mirror of
https://github.com/XRPLF/clio.git
synced 2025-12-06 17:27:58 +00:00
refactor: Use std::expected instead of std::variant for errors (#2160)
This commit is contained in:
@@ -318,8 +318,7 @@ TEST_F(RPCForwardingProxyTest, ForwardCallsBalancerWithCorrectParams)
|
||||
|
||||
auto const res = proxy_.forward(ctx);
|
||||
|
||||
auto const data = std::get_if<json::object>(&res.response);
|
||||
EXPECT_TRUE(data != nullptr);
|
||||
EXPECT_TRUE(res.response.has_value());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -348,8 +347,7 @@ TEST_F(RPCForwardingProxyTest, ForwardingFailYieldsErrorStatus)
|
||||
|
||||
auto const res = proxy_.forward(ctx);
|
||||
|
||||
auto const status = std::get_if<Status>(&res.response);
|
||||
EXPECT_TRUE(status != nullptr);
|
||||
EXPECT_EQ(*status, rpc::ClioError::EtlInvalidResponse);
|
||||
EXPECT_FALSE(res.response.has_value());
|
||||
EXPECT_EQ(res.response.error(), rpc::ClioError::EtlInvalidResponse);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user