From 0ad70e1af06c22857627895c8949e437b5716eb0 Mon Sep 17 00:00:00 2001 From: wlmyng <127570466+wlmyng@users.noreply.github.com> Date: Fri, 18 Oct 2024 04:38:50 -0700 Subject: [PATCH] [indexer] quick fix for events in descending order without cursor (#19902) ## Description This PR fixes a bug where events queries in descending order without a cursor return no results ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- crates/sui-indexer/src/indexer_reader.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/sui-indexer/src/indexer_reader.rs b/crates/sui-indexer/src/indexer_reader.rs index a30cde7bb88df..d0eed2ee4a461 100644 --- a/crates/sui-indexer/src/indexer_reader.rs +++ b/crates/sui-indexer/src/indexer_reader.rs @@ -974,10 +974,9 @@ impl IndexerReader { ) .first::(&mut connection) .await?; - (tx_seq, event_seq) + (tx_seq, event_seq as i64) } else if descending_order { - let max_tx_seq = u64::MAX as i64; - (max_tx_seq + 1, 0) + (i64::MAX, i64::MAX) } else { (-1, 0) };