Skip to content

Commit

Permalink
feat: add get all versions (backport cosmos#11124) (cosmos#11144)
Browse files Browse the repository at this point in the history
* feat: add get all versions (cosmos#11124)

* add get all versions

* add changelog entry

(cherry picked from commit d624a65)

# Conflicts:
#	CHANGELOG.md

* fix conflicts and remove interface break

Co-authored-by: Marko <marbar3778@yahoo.com>
  • Loading branch information
2 people authored and randy75828 committed Aug 10, 2022
1 parent e79a29f commit a4cfb80
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ Ref: https://keepachangelog.com/en/1.0.0/

## [Unreleased]

### Features

* [\#11124](https://github.com/cosmos/cosmos-sdk/pull/11124) Add `GetAllVersions` to application store

### Bug Fixes

* (store) [\#11117](https://github.com/cosmos/cosmos-sdk/pull/11117) Fix data race in store trace component
Expand Down
5 changes: 5 additions & 0 deletions store/iavl/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ func (st *Store) VersionExists(version int64) bool {
return st.tree.VersionExists(version)
}

// GetAllVersions returns all versions in the iavl tree
func (st *Store) GetAllVersions() []int {
return st.tree.(*iavl.MutableTree).AvailableVersions()
}

// Implements Store.
func (st *Store) GetStoreType() types.StoreType {
return types.StoreTypeIAVL
Expand Down

0 comments on commit a4cfb80

Please sign in to comment.