Skip to content

Commit 730d631

Browse files
javiersuweijiealexanderbezjulienrbrttac0turtle
authored
fix: remove unnecessary cms typecasting (#14054)
* fix: remove unnecessary cms typecasting * Update baseapp/baseapp.go Co-authored-by: Julien Robert <[email protected]> Co-authored-by: Aleksandr Bezobchuk <[email protected]> Co-authored-by: Julien Robert <[email protected]> Co-authored-by: Marko <[email protected]>
1 parent fffc9d0 commit 730d631

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
9696
* [#13802](https://github.com/cosmos/cosmos-sdk/pull/13802) Add --output-document flag to the export CLI command to allow writing genesis state to a file.
9797
* [#13794](https://github.com/cosmos/cosmos-sdk/pull/13794) `types/module.Manager` now supports the
9898
`cosmossdk.io/core/appmodule.AppModule` API via the new `NewManagerFromMap` constructor.
99+
* [#14019](https://github.com/cosmos/cosmos-sdk/issues/14019) Remove the interface casting to allow other implementations of a `CommitMultiStore`.
99100

100101
### State Machine Breaking
101102

baseapp/baseapp.go

+5-6
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
1818
"github.com/cosmos/cosmos-sdk/snapshots"
1919
"github.com/cosmos/cosmos-sdk/store"
20-
"github.com/cosmos/cosmos-sdk/store/rootmulti"
2120
storetypes "github.com/cosmos/cosmos-sdk/store/types"
2221
sdk "github.com/cosmos/cosmos-sdk/types"
2322
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
@@ -358,11 +357,11 @@ func (app *BaseApp) Init() error {
358357
app.setProcessProposalState(emptyHeader)
359358
app.Seal()
360359

361-
rms, ok := app.cms.(*rootmulti.Store)
362-
if !ok {
363-
return fmt.Errorf("invalid commit multi-store; expected %T, got: %T", &rootmulti.Store{}, app.cms)
364-
}
365-
return rms.GetPruning().Validate()
360+
if app.cms == nil {
361+
return errors.New("commit multi-store must not be nil")
362+
}
363+
364+
return app.cms.GetPruning().Validate()
366365
}
367366

368367
func (app *BaseApp) setMinGasPrices(gasPrices sdk.DecCoins) {

0 commit comments

Comments
 (0)