Skip to content

Commit

Permalink
fix(store/commitment/iavl): honor tree.Remove error firstly (cosmos#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
odeke-em committed Dec 8, 2023
1 parent 112f6cb commit 1e216af
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion store/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ Ref: https://keepachangelog.com/en/1.0.0/

* [#17158](https://github.com/cosmos/cosmos-sdk/pull/17158) Start the goroutine after need to create a snapshot.

### Bug fixes

* [#18651](https://github.com/cosmos/cosmos-sdk/pull/18651) Propagate iavl.MutableTree.Remove errors firstly to the caller instead of returning a synthesized error firstly.


## [v1.0.0-alpha.1](https://github.com/cosmos/cosmos-sdk/releases/tag/store%2Fv1.0.0-alpha.1) - 2023-07-11

Expand All @@ -54,7 +58,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Bug Fixes

* [#16588](https://github.com/cosmos/cosmos-sdk/pull/16588) Propogate the Snapshotter's failure to the caller, (it will create a empty snapshot silently before).
* [#16588](https://github.com/cosmos/cosmos-sdk/pull/16588) Propagate the Snapshotter's failure to the caller, (it will create a empty snapshot silently before).

## [v0.1.0-alpha.1](https://github.com/cosmos/cosmos-sdk/releases/tag/store%2Fv0.1.0-alpha.1) - 2023-03-17

Expand Down
5 changes: 4 additions & 1 deletion store/commitment/iavl/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ func NewIavlTree(db dbm.DB, logger log.Logger, cfg *Config) *IavlTree {
// Remove removes the given key from the tree.
func (t *IavlTree) Remove(key []byte) error {
_, res, err := t.tree.Remove(key)
if err != nil {
return err
}
if !res {
return fmt.Errorf("key %x not found", key)
}
return err
return nil
}

// Set sets the given key-value pair in the tree.
Expand Down

0 comments on commit 1e216af

Please sign in to comment.