MCPcopy Create free account
hub / github.com/Sifchain/sifnode / UpdateRowanCollateral

Method UpdateRowanCollateral

x/margin/keeper/msg_server.go:347–362  ·  view source on GitHub ↗
(goCtx context.Context, msg *types.MsgUpdateRowanCollateral)

Source from the content-addressed store, hash-verified

345}
346
347func (k msgServer) UpdateRowanCollateral(goCtx context.Context, msg *types.MsgUpdateRowanCollateral) (*types.MsgUpdateRowanCollateralResponse, error) {
348 ctx := sdk.UnwrapSDKContext(goCtx)
349 signer, err := sdk.AccAddressFromBech32(msg.Signer)
350 if err != nil {
351 return nil, err
352 }
353 if !k.AdminKeeper().IsAdminAccount(ctx, admintypes.AdminType_MARGIN, signer) {
354 return nil, sdkerrors.Wrap(admintypes.ErrPermissionDenied, fmt.Sprintf("signer not authorised: %s", msg.Signer))
355 }
356
357 params := k.GetParams(ctx)
358 params.RowanCollateralEnabled = msg.RowanCollateralEnabled
359 k.SetParams(ctx, &params)
360
361 return &types.MsgUpdateRowanCollateralResponse{}, nil
362}
363
364func (k msgServer) Whitelist(goCtx context.Context, msg *types.MsgWhitelist) (*types.MsgWhitelistResponse, error) {
365 ctx := sdk.UnwrapSDKContext(goCtx)

Callers

nothing calls this directly

Calls 4

SetParamsMethod · 0.95
IsAdminAccountMethod · 0.65
AdminKeeperMethod · 0.65
GetParamsMethod · 0.65

Tested by

no test coverage detected