fix(store/v2): iavl/v2 reverse iterator (#22699)

Co-authored-by: Marko <marko@baricevic.me>
This commit is contained in:
Matt Kocubinski 2024-12-01 12:49:31 -06:00 committed by GitHub
parent 26afbaf0d1
commit 40430febc5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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) {