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
(cherry picked from commit f79b380)

# Conflicts:
#	x/consensus/keeper/keeper.go
  • Loading branch information
MSalopek authored and mergify[bot] committed Aug 31, 2024
1 parent 8c9152d commit de691a9
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions x/consensus/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,41 @@ func (k Keeper) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) (*
if err != nil {
return nil, err
}
<<<<<<< HEAD

Check failure on line 81 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / dependency-review

expected statement, found '<<'

Check failure on line 81 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / tests (02)

syntax error: unexpected <<, expected }

Check failure on line 81 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / tests (03)

syntax error: unexpected <<, expected }

Check failure on line 81 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / tests (03)

syntax error: unexpected <<, expected }

Check failure on line 81 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / tests (01)

syntax error: unexpected <<, expected }

Check failure on line 81 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / tests (01)

syntax error: unexpected <<, expected }

Check failure on line 81 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: unexpected <<, expected }

Check failure on line 81 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: unexpected <<, expected }

Check failure on line 81 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: unexpected <<, expected }

Check failure on line 81 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: unexpected <<, expected }
params := cmttypes.ConsensusParamsFromProto(paramsProto)
=======

if err := k.ParamsStore.Set(ctx, nextParams.ToProto()); err != nil {

Check failure on line 85 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / dependency-review

undefined: nextParams
return nil, err
}

if err := k.EventService.EventManager(ctx).EmitKV(

Check failure on line 89 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / dependency-review

k.EventService undefined (type Keeper has no field or method EventService)
"update_consensus_params",
event.NewAttribute("authority", msg.Authority),

Check failure on line 91 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / dependency-review

undefined: event.NewAttribute
event.NewAttribute("parameters", consensusParams.String())); err != nil {

Check failure on line 92 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / dependency-review

undefined: event.NewAttribute
return nil, err
}

return &types.MsgUpdateParamsResponse{}, nil
}

// paramCheck validates the consensus params
func (k Keeper) paramCheck(ctx context.Context, consensusParams cmtproto.ConsensusParams) (*cmttypes.ConsensusParams, error) {
var params cmttypes.ConsensusParams

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) {

Check failure on line 110 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / dependency-review

undefined: errors.Is
params = cmttypes.ConsensusParams{}
} else {
return nil, err
}
>>>>>>> f79b3802a (fix(x/consensus)!: update cons params parsing checks (#21484))

Check failure on line 115 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / dependency-review

expected statement, found '>>'

Check failure on line 115 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / dependency-review

illegal character U+0023 '#'

Check failure on line 115 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / tests (02)

syntax error: unexpected >>, expected }

Check failure on line 115 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / tests (02)

invalid character U+0023 '#'

Check failure on line 115 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / tests (03)

syntax error: unexpected >>, expected }

Check failure on line 115 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / tests (03)

invalid character U+0023 '#'

Check failure on line 115 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / tests (03)

syntax error: unexpected >>, expected }

Check failure on line 115 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / tests (03)

invalid character U+0023 '#'

Check failure on line 115 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / tests (01)

syntax error: unexpected >>, expected }

Check failure on line 115 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / tests (01)

invalid character U+0023 '#'

Check failure on line 115 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / tests (01)

syntax error: unexpected >>, expected }

Check failure on line 115 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / tests (01)

invalid character U+0023 '#'

Check failure on line 115 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: unexpected >>, expected }

Check failure on line 115 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / tests (00)

invalid character U+0023 '#'

Check failure on line 115 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: unexpected >>, expected }

Check failure on line 115 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / tests (00)

invalid character U+0023 '#'

Check failure on line 115 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: unexpected >>, expected }

Check failure on line 115 in x/consensus/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / tests (00)

invalid character U+0023 '#'

nextParams := params.Update(&consensusParams)

Expand Down

0 comments on commit de691a9

Please sign in to comment.