Skip to content

Commit

Permalink
fix(store/v2): iavl/v2 reverse iterator (cosmos#22699)
Browse files Browse the repository at this point in the history
Co-authored-by: Marko <[email protected]>
  • Loading branch information
kocubinski and tac0turtle authored Dec 1, 2024
1 parent 26afbaf commit 40430fe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion store/v2/commitment/iavlv2/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ func (t *Tree) Iterator(version uint64, start, end []byte, ascending bool) (core
if int64(version) != t.tree.Version() {
return nil, fmt.Errorf("loading past version not yet supported")
}
return t.tree.Iterator(start, end, ascending)
if ascending {
return t.tree.Iterator(start, end, false)
} else {
return t.tree.ReverseIterator(start, end)
}
}

func (t *Tree) Export(version uint64) (commitment.Exporter, error) {
Expand Down

0 comments on commit 40430fe

Please sign in to comment.