mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-29 08:05:50 +00:00
@@ -1085,3 +1085,29 @@ TEST_F(RPCLedgerEntryTest, LedgerNotExistViaHash)
|
||||
EXPECT_EQ(err.at("error_message").as_string(), "ledgerNotFound");
|
||||
});
|
||||
}
|
||||
|
||||
TEST_F(RPCLedgerEntryTest, InvalidEntryTypeVersion2)
|
||||
{
|
||||
runSpawn([&, this](auto yield) {
|
||||
auto const handler = AnyHandler{LedgerEntryHandler{mockBackendPtr}};
|
||||
auto const req = json::parse(R"({})");
|
||||
auto const output = handler.process(req, Context{.yield = yield, .apiVersion = 2});
|
||||
ASSERT_FALSE(output);
|
||||
auto const err = rpc::makeError(output.error());
|
||||
EXPECT_EQ(err.at("error").as_string(), "unknownOption");
|
||||
EXPECT_EQ(err.at("error_message").as_string(), "Unknown option.");
|
||||
});
|
||||
}
|
||||
|
||||
TEST_F(RPCLedgerEntryTest, InvalidEntryTypeVersion1)
|
||||
{
|
||||
runSpawn([&, this](auto yield) {
|
||||
auto const handler = AnyHandler{LedgerEntryHandler{mockBackendPtr}};
|
||||
auto const req = json::parse(R"({})");
|
||||
auto const output = handler.process(req, Context{.yield = yield, .apiVersion = 1});
|
||||
ASSERT_FALSE(output);
|
||||
auto const err = rpc::makeError(output.error());
|
||||
EXPECT_EQ(err.at("error").as_string(), "invalidParams");
|
||||
EXPECT_EQ(err.at("error_message").as_string(), "Invalid parameters.");
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user