Skip to content

Commit a4cfb80

Browse files
mergify[bot]tac0turtle
authored andcommitted
feat: add get all versions (backport cosmos#11124) (cosmos#11144)
* 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>
1 parent e79a29f commit a4cfb80

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ Ref: https://keepachangelog.com/en/1.0.0/
3737

3838
## [Unreleased]
3939

40+
### Features
41+
42+
* [\#11124](https://github.com/cosmos/cosmos-sdk/pull/11124) Add `GetAllVersions` to application store
43+
4044
### Bug Fixes
4145

4246
* (store) [\#11117](https://github.com/cosmos/cosmos-sdk/pull/11117) Fix data race in store trace component

store/iavl/store.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ func (st *Store) VersionExists(version int64) bool {
143143
return st.tree.VersionExists(version)
144144
}
145145

146+
// GetAllVersions returns all versions in the iavl tree
147+
func (st *Store) GetAllVersions() []int {
148+
return st.tree.(*iavl.MutableTree).AvailableVersions()
149+
}
150+
146151
// Implements Store.
147152
func (st *Store) GetStoreType() types.StoreType {
148153
return types.StoreTypeIAVL

0 commit comments

Comments
 (0)