Skip to content

Commit 1e216af

Browse files
authored
fix(store/commitment/iavl): honor tree.Remove error firstly (#18651)
1 parent 112f6cb commit 1e216af

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

store/CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ Ref: https://keepachangelog.com/en/1.0.0/
3333

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

36+
### Bug fixes
37+
38+
* [#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.
39+
3640

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

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

5559
### Bug Fixes
5660

57-
* [#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).
61+
* [#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).
5862

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

store/commitment/iavl/tree.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,13 @@ func NewIavlTree(db dbm.DB, logger log.Logger, cfg *Config) *IavlTree {
2929
// Remove removes the given key from the tree.
3030
func (t *IavlTree) Remove(key []byte) error {
3131
_, res, err := t.tree.Remove(key)
32+
if err != nil {
33+
return err
34+
}
3235
if !res {
3336
return fmt.Errorf("key %x not found", key)
3437
}
35-
return err
38+
return nil
3639
}
3740

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

0 commit comments

Comments
 (0)