fix(x/consensus)!: update cons params parsing checks (#21484)

This commit is contained in:
MSalopek
2024-08-31 16:18:31 +00:00
committed by GitHub
parent f42285dd46
commit f79b3802ac
+4
View File
@@ -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{}