mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-04 11:55:51 +00:00
@@ -528,21 +528,19 @@ public:
|
||||
SELECT hash, seq_idx
|
||||
FROM {}
|
||||
WHERE account = ?
|
||||
AND seq_idx <= ?
|
||||
AND seq_idx < ?
|
||||
LIMIT ?
|
||||
)",
|
||||
qualifiedTableName(settingsProvider_.get(), "account_tx")));
|
||||
}();
|
||||
|
||||
// the smallest transaction idx is 0, we use uint to store the transaction index, so we shall use ">=" to
|
||||
// include it(the transaction with idx 0) in the result
|
||||
PreparedStatement selectAccountTxForward = [this]() {
|
||||
return handle_.get().prepare(fmt::format(
|
||||
R"(
|
||||
SELECT hash, seq_idx
|
||||
FROM {}
|
||||
WHERE account = ?
|
||||
AND seq_idx >= ?
|
||||
AND seq_idx > ?
|
||||
ORDER BY seq_idx ASC
|
||||
LIMIT ?
|
||||
)",
|
||||
|
||||
@@ -73,8 +73,10 @@ AccountTxHandler::process(AccountTxHandler::Input input, Context const& ctx) con
|
||||
}
|
||||
else
|
||||
{
|
||||
// if forward, start at minIndex - 1, because the SQL query is exclusive, we need to include the 0 transaction
|
||||
// index of minIndex
|
||||
if (input.forward)
|
||||
cursor = {minIndex, 0};
|
||||
cursor = {minIndex - 1, INT32_MAX};
|
||||
else
|
||||
cursor = {maxIndex, INT32_MAX};
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@ TEST_F(RPCAccountTxHandlerTest, IndexSpecificForwardTrue)
|
||||
testing::_,
|
||||
testing::_,
|
||||
true,
|
||||
testing::Optional(testing::Eq(TransactionsCursor{MINSEQ + 1, 0})),
|
||||
testing::Optional(testing::Eq(TransactionsCursor{MINSEQ, INT32_MAX})),
|
||||
testing::_))
|
||||
.Times(1);
|
||||
|
||||
@@ -344,7 +344,11 @@ TEST_F(RPCAccountTxHandlerTest, IndexNotSpecificForwardTrue)
|
||||
EXPECT_CALL(
|
||||
*rawBackendPtr,
|
||||
fetchAccountTransactions(
|
||||
testing::_, testing::_, true, testing::Optional(testing::Eq(TransactionsCursor{MINSEQ, 0})), testing::_))
|
||||
testing::_,
|
||||
testing::_,
|
||||
true,
|
||||
testing::Optional(testing::Eq(TransactionsCursor{MINSEQ - 1, INT32_MAX})),
|
||||
testing::_))
|
||||
.Times(1);
|
||||
|
||||
runSpawn([&, this](auto& yield) {
|
||||
|
||||
Reference in New Issue
Block a user