Skip to content

Commit

Permalink
fix: reverse pagination next key
Browse files Browse the repository at this point in the history
  • Loading branch information
mbreithecker committed Jul 7, 2023
1 parent f6706d6 commit f54b2d2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions x/bundles/keeper/getters_bundles.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,12 @@ func (k Keeper) GetPaginatedFinalizedBundleQuery(ctx sdk.Context, pagination *qu
}
}
// Fetch next key (if there is one)
if iterator.Valid() && !reverse {
pageResponse.NextKey = iterator.Key()
if iterator.Valid() {
if !reverse {
pageResponse.NextKey = iterator.Key()
}
} else {
pageResponse.NextKey = nil
}
_ = iterator.Close()

Expand Down

0 comments on commit f54b2d2

Please sign in to comment.