Skip to content

Commit

Permalink
add admin addr to params update (#784)
Browse files Browse the repository at this point in the history
  • Loading branch information
kruspy authored Mar 11, 2024
1 parent 4d10b64 commit 418be86
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions x/liquidstake/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,13 @@ func (k msgServer) LiquidUnstake(goCtx context.Context, msg *types.MsgLiquidUnst
func (k msgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)

if msg.Authority != k.authority {
if msg.Authority != k.authority && msg.Authority != k.GetParams(ctx).WhitelistAdminAddress {
return nil, errors.Wrapf(sdkerrors.ErrorInvalidSigner, "invalid authority; expected %s, got %s", k.authority, msg.Authority)
}

paramsToSet := k.GetParams(ctx)

// List of all updateable params
//
// List of all updateable param
paramsToSet.UnstakeFeeRate = msg.Params.UnstakeFeeRate
paramsToSet.LsmDisabled = msg.Params.LsmDisabled
paramsToSet.MinLiquidStakeAmount = msg.Params.MinLiquidStakeAmount
Expand All @@ -190,11 +189,6 @@ func (k msgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParam
paramsToSet.AutocompoundFeeRate = msg.Params.AutocompoundFeeRate
paramsToSet.WhitelistAdminAddress = msg.Params.WhitelistAdminAddress

// These to be updated elsewhere
// * LiquidBondDenom
// * WhitelistedValidators
// * ModulePaused

err := k.SetParams(ctx, paramsToSet)
if err != nil {
return nil, err
Expand Down

0 comments on commit 418be86

Please sign in to comment.