(goCtx context.Context, msg *types.MsgUpdateParams)
| 305 | } |
| 306 | |
| 307 | func (k msgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { |
| 308 | ctx := sdk.UnwrapSDKContext(goCtx) |
| 309 | signer, err := sdk.AccAddressFromBech32(msg.Signer) |
| 310 | if err != nil { |
| 311 | return nil, err |
| 312 | } |
| 313 | if !k.AdminKeeper().IsAdminAccount(ctx, admintypes.AdminType_MARGIN, signer) { |
| 314 | return nil, sdkerrors.Wrap(admintypes.ErrPermissionDenied, fmt.Sprintf("signer not authorised: %s", msg.Signer)) |
| 315 | } |
| 316 | |
| 317 | params := k.GetParams(ctx) |
| 318 | msg.Params.Pools = params.Pools |
| 319 | k.SetParams(ctx, msg.Params) |
| 320 | |
| 321 | ctx.EventManager().EmitEvent(sdk.NewEvent(types.EventMarginUpdateParams, |
| 322 | sdk.NewAttribute(types.AttributeKeyMarginParams, params.String()), |
| 323 | sdk.NewAttribute(clptypes.AttributeKeyHeight, strconv.FormatInt(ctx.BlockHeight(), 10)), |
| 324 | )) |
| 325 | |
| 326 | return &types.MsgUpdateParamsResponse{}, nil |
| 327 | } |
| 328 | |
| 329 | func (k msgServer) UpdatePools(goCtx context.Context, msg *types.MsgUpdatePools) (*types.MsgUpdatePoolsResponse, error) { |
| 330 | ctx := sdk.UnwrapSDKContext(goCtx) |
nothing calls this directly
no test coverage detected