Skip to content

Commit

Permalink
fix: remove unnecessary cms typecasting (backport cosmos#14054) (cosm…
Browse files Browse the repository at this point in the history
…os#15669)

Co-authored-by: Javier Su <javier.su.weijie@gmail.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
  • Loading branch information
3 people authored and JeancarloBarrios committed Sep 28, 2024
1 parent 89e85f2 commit 17aff57
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

* (simapp) [#15305](https://github.com/cosmos/cosmos-sdk/pull/15305) Add `AppStateFnWithExtendedCb` with callback function to extend rawState and `AppStateRandomizedFnWithState` with extra genesisState argument which is the genesis state of the app.
* (x/distribution) [#15462](https://github.com/cosmos/cosmos-sdk/pull/15462) Add delegator address to the event for withdrawing delegation rewards
* [#14019](https://github.com/cosmos/cosmos-sdk/issues/14019) Remove the interface casting to allow other implementations of a `CommitMultiStore`.

### Bug Fixes

Expand Down
10 changes: 7 additions & 3 deletions baseapp/baseapp.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package baseapp

import (
"context"
"errors"
"fmt"
"strings"
Expand All @@ -14,8 +13,9 @@ import (
dbm "github.com/tendermint/tm-db"

codectypes "github.com/cosmos/cosmos-sdk/codec/types"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
"github.com/cosmos/cosmos-sdk/telemetry"
"github.com/cosmos/cosmos-sdk/snapshots"
"github.com/cosmos/cosmos-sdk/store"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/types/mempool"
Expand Down Expand Up @@ -408,6 +408,10 @@ func (app *BaseApp) Init() error {
app.setState(execModeCheck, emptyHeader)
app.Seal()

if app.cms == nil {
return errors.New("commit multi-store must not be nil")
}

return app.cms.GetPruning().Validate()
}

Expand Down

0 comments on commit 17aff57

Please sign in to comment.