diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md new file mode 100644 index 0000000000..30e15e1650 --- /dev/null +++ b/core/CHANGELOG.md @@ -0,0 +1,41 @@ + + +# Changelog + +## [Unreleased] + +### API-Breaking Changes + +- (store)[14635](https://github.com/cosmos/cosmos-sdk/pull/14635) Add error handling to all methods on the `KVStore` interface diff --git a/core/store/store.go b/core/store/store.go index 5f083968b6..a82d72f6d3 100644 --- a/core/store/store.go +++ b/core/store/store.go @@ -22,14 +22,14 @@ type KVStore interface { // To iterate over entire domain, use store.Iterator(nil, nil) // CONTRACT: No writes may happen within a domain while an iterator exists over it. // Exceptionally allowed for cachekv.Store, safe to write in the modules. - Iterator(start, end []byte) Iterator + Iterator(start, end []byte) (Iterator, error) // ReverseIterator iterates over a domain of keys in descending order. End is exclusive. // Start must be less than end, or the Iterator is invalid. // Iterator must be closed by caller. // CONTRACT: No writes may happen within a domain while an iterator exists over it. // Exceptionally allowed for cachekv.Store, safe to write in the modules. - ReverseIterator(start, end []byte) Iterator + ReverseIterator(start, end []byte) (Iterator, error) } // Iterator is an alias db's Iterator for convenience.