Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Return error instead of empty values when pruned height is queried #13896

Merged
merged 6 commits into from
Nov 17, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: return err instead of empty values when pruned height is queried
likhita-809 committed Nov 17, 2022

Verified

This commit was signed with the committer’s verified signature.
Eliulm Elias Wahl
commit 5b62578193ec1d3fe56c46e91aa7b770e12cec24
2 changes: 1 addition & 1 deletion store/iavl/store.go
Original file line number Diff line number Diff line change
@@ -89,7 +89,7 @@ func UnsafeNewStore(tree *iavl.MutableTree) *Store {
// Any mutable operations executed will result in a panic.
func (st *Store) GetImmutable(version int64) (*Store, error) {
if !st.VersionExists(version) {
return &Store{tree: &immutableTree{&iavl.ImmutableTree{}}}, nil
return &Store{tree: &immutableTree{&iavl.ImmutableTree{}}}, fmt.Errorf("version mismatch on immutable IAVL tree; version does not exist. Version has either been pruned, or is for a future block height")
}

iTree, err := st.tree.GetImmutable(version)