chore: update store iavl with changesets (#15432)

Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Marko <marbar3778@yahoo.com>
This commit is contained in:
cool-developer 2023-03-17 06:28:58 -07:00 committed by GitHub
parent a6bc49afab
commit 44ed13dff7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 3 deletions

View File

@ -11,7 +11,7 @@ require (
github.com/confio/ics23/go v0.9.0
github.com/cosmos/cosmos-db v1.0.0-rc.1
github.com/cosmos/gogoproto v1.4.6
github.com/cosmos/iavl v0.21.0-alpha.1
github.com/cosmos/iavl v0.21.0-beta.1
github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.3 // indirect
github.com/hashicorp/go-hclog v1.4.0

View File

@ -67,8 +67,8 @@ github.com/cosmos/cosmos-db v1.0.0-rc.1 h1:SjnT8B6WKMW9WEIX32qMhnEEKcI7ZP0+G1Sa9
github.com/cosmos/cosmos-db v1.0.0-rc.1/go.mod h1:Dnmk3flSf5lkwCqvvjNpoxjpXzhxnCAFzKHlbaForso=
github.com/cosmos/gogoproto v1.4.6 h1:Ee7z15dWJaGlgM2rWrK8N2IX7PQcuccu8oG68jp5RL4=
github.com/cosmos/gogoproto v1.4.6/go.mod h1:VS/ASYmPgv6zkPKLjR9EB91lwbLHOzaGCirmKKhncfI=
github.com/cosmos/iavl v0.21.0-alpha.1 h1:ul5oRSJgl053YX18XxS9PlPBI9zcdCO/auSxVeyj69Q=
github.com/cosmos/iavl v0.21.0-alpha.1/go.mod h1:25YJYzilTErJ2mKfNB3xyWL9IsCwEQdNzdIutg2mh3U=
github.com/cosmos/iavl v0.21.0-beta.1 h1:fBQeBc8HLZ14plJNcmGfaOXSSMLVEHvEQXiTXSD76m0=
github.com/cosmos/iavl v0.21.0-beta.1/go.mod h1:25YJYzilTErJ2mKfNB3xyWL9IsCwEQdNzdIutg2mh3U=
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

View File

@ -389,6 +389,11 @@ func (st *Store) Query(req abci.RequestQuery) (res abci.ResponseQuery) {
return res
}
// TraverseStateChanges traverses the state changes between two versions and calls the given function.
func (st *Store) TraverseStateChanges(startVersion, endVersion int64, fn func(version int64, changeSet *iavl.ChangeSet) error) error {
return st.tree.TraverseStateChanges(startVersion, endVersion, fn)
}
// Takes a MutableTree, a key, and a flag for creating existence or absence proof and returns the
// appropriate merkle.Proof. Since this must be called after querying for the value, this function should never error
// Thus, it will panic on error rather than returning it

View File

@ -35,6 +35,7 @@ type (
AvailableVersions() []int
LoadVersionForOverwriting(targetVersion int64) (int64, error)
LazyLoadVersionForOverwriting(targetVersion int64) (int64, error)
TraverseStateChanges(startVersion, endVersion int64, fn func(version int64, changeSet *iavl.ChangeSet) error) error
}
// immutableTree is a simple wrapper around a reference to an iavl.ImmutableTree