Skip to content

Commit

Permalink
fix(x/consensus)!: update cons params parsing checks (#21484)
Browse files Browse the repository at this point in the history
  • Loading branch information
MSalopek authored Aug 31, 2024
1 parent f42285d commit f79b380
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions x/consensus/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ func (k Keeper) paramCheck(ctx context.Context, consensusParams cmtproto.Consens

paramsProto, err := k.ParamsStore.Get(ctx)
if err == nil {
// initialize version params with zero value if not set
if paramsProto.Version == nil {
paramsProto.Version = &cmtproto.VersionParams{}
}
params = cmttypes.ConsensusParamsFromProto(paramsProto)
} else if errors.Is(err, collections.ErrNotFound) {
params = cmttypes.ConsensusParams{}
Expand Down

0 comments on commit f79b380

Please sign in to comment.