Skip to content

Commit

Permalink
rpc: Make sure we internally use uint32 for latestledger in getEvents
Browse files Browse the repository at this point in the history
Followup to #1097
  • Loading branch information
2opremio committed Feb 2, 2024
1 parent 0c77361 commit bd36478
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmd/soroban-rpc/internal/methods/get_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ type PaginationOptions struct {

type GetEventsResponse struct {
Events []EventInfo `json:"events"`
LatestLedger int64 `json:"latestLedger"`
LatestLedger uint32 `json:"latestLedger"`
}

type eventScanner interface {
Expand Down Expand Up @@ -373,7 +373,7 @@ func (h eventsRPCHandler) getEvents(request GetEventsRequest) (GetEventsResponse
results = append(results, info)
}
return GetEventsResponse{
LatestLedger: int64(latestLedger),
LatestLedger: latestLedger,
Events: results,
}, nil
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-rpc/internal/methods/get_events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ func TestGetEvents(t *testing.T) {
},
})
assert.NoError(t, err)
assert.Equal(t, int64(1), results.LatestLedger)
assert.Equal(t, uint32(1), results.LatestLedger)

expectedIds := []string{
events.Cursor{Ledger: 1, Tx: 1, Op: 0, Event: 0}.String(),
Expand Down

0 comments on commit bd36478

Please sign in to comment.