Return error when limit<=0 (#804)

Fix #806
This commit is contained in:
cyan317
2023-08-02 15:34:42 +01:00
committed by GitHub
parent 1804e3e9c0
commit c90bc15959
45 changed files with 832 additions and 562 deletions

View File

@@ -40,7 +40,7 @@ TEST_F(RPCLedgerRangeTest, LedgerRangeMinMaxSame)
mockBackendPtr->updateRange(RANGEMIN);
auto const handler = AnyHandler{LedgerRangeHandler{mockBackendPtr}};
auto const req = json::parse("{}");
auto const output = handler.process(req, Context{std::ref(yield)});
auto const output = handler.process(req, Context{yield});
ASSERT_TRUE(output);
auto const json = output.value();
EXPECT_EQ(json.at("ledger_index_min").as_uint64(), RANGEMIN);
@@ -55,7 +55,7 @@ TEST_F(RPCLedgerRangeTest, LedgerRangeFullySet)
mockBackendPtr->updateRange(RANGEMAX);
auto const handler = AnyHandler{LedgerRangeHandler{mockBackendPtr}};
auto const req = json::parse("{}");
auto const output = handler.process(req, Context{std::ref(yield)});
auto const output = handler.process(req, Context{yield});
ASSERT_TRUE(output);
auto const json = output.value();
EXPECT_EQ(json.at("ledger_index_min").as_uint64(), RANGEMIN);