Skip to content

Commit f79b380

Browse files
authored
fix(x/consensus)!: update cons params parsing checks (#21484)
1 parent f42285d commit f79b380

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

x/consensus/keeper/keeper.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ func (k Keeper) paramCheck(ctx context.Context, consensusParams cmtproto.Consens
120120

121121
paramsProto, err := k.ParamsStore.Get(ctx)
122122
if err == nil {
123+
// initialize version params with zero value if not set
124+
if paramsProto.Version == nil {
125+
paramsProto.Version = &cmtproto.VersionParams{}
126+
}
123127
params = cmttypes.ConsensusParamsFromProto(paramsProto)
124128
} else if errors.Is(err, collections.ErrNotFound) {
125129
params = cmttypes.ConsensusParams{}

0 commit comments

Comments
 (0)