mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-07-05 20:22:33 +00:00
24 lines
629 B
Go
24 lines
629 B
Go
package keeper
|
|
|
|
import (
|
|
"context"
|
|
|
|
errorsmod "cosmossdk.io/errors"
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
|
|
"github.com/planetmint/planetmint-go/x/machine/types"
|
|
)
|
|
|
|
func (k msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) {
|
|
if k.GetAuthority() != req.Authority {
|
|
return nil, errorsmod.Wrapf(types.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.GetAuthority(), req.Authority)
|
|
}
|
|
|
|
ctx := sdk.UnwrapSDKContext(goCtx)
|
|
if err := k.SetParams(ctx, req.Params); err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &types.MsgUpdateParamsResponse{}, nil
|
|
}
|