Skip to content

Commit

Permalink
[indexer] quick fix for events in descending order without cursor (#1…
Browse files Browse the repository at this point in the history
…9902)

## 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:
  • Loading branch information
wlmyng authored Oct 18, 2024
1 parent db54dac commit 0ad70e1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions crates/sui-indexer/src/indexer_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -974,10 +974,9 @@ impl IndexerReader {
)
.first::<i64>(&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)
};
Expand Down

0 comments on commit 0ad70e1

Please sign in to comment.