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

Method UpdatePools

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

Source from the content-addressed store, hash-verified

327}
328
329func (k msgServer) UpdatePools(goCtx context.Context, msg *types.MsgUpdatePools) (*types.MsgUpdatePoolsResponse, error) {
330 ctx := sdk.UnwrapSDKContext(goCtx)
331 signer, err := sdk.AccAddressFromBech32(msg.Signer)
332 if err != nil {
333 return nil, err
334 }
335 if !k.AdminKeeper().IsAdminAccount(ctx, admintypes.AdminType_MARGIN, signer) {
336 return nil, sdkerrors.Wrap(admintypes.ErrPermissionDenied, fmt.Sprintf("signer not authorised: %s", msg.Signer))
337 }
338
339 params := k.GetParams(ctx)
340 params.Pools = msg.Pools
341 params.ClosedPools = msg.ClosedPools
342 k.SetParams(ctx, &params)
343
344 return &types.MsgUpdatePoolsResponse{}, nil
345}
346
347func (k msgServer) UpdateRowanCollateral(goCtx context.Context, msg *types.MsgUpdateRowanCollateral) (*types.MsgUpdateRowanCollateralResponse, error) {
348 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