clawchain/x/reputation/keeper/msg_server_update_params.go
caelum0x cc12b2b899 feat: core chain updates — clawchain, governance, marketplace, tokenfactory, IBC, build
Updates across core modules, app wiring, IBC config, governance execution
tests, tokenfactory keeper/module, Makefile build targets, release CI,
and dependency updates.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 22:14:09 +03:00

28 lines
766 B
Go

package keeper
import (
"bytes"
"context"
errorsmod "cosmossdk.io/errors"
"clawchain/x/reputation/types"
)
func (k msgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) {
authority, err := k.addressCodec.StringToBytes(msg.Authority)
if err != nil {
return nil, errorsmod.Wrap(types.ErrInvalidSigner, "invalid authority address")
}
if !bytes.Equal(authority, k.GetAuthority()) {
return nil, errorsmod.Wrapf(types.ErrInvalidSigner, "unauthorized: expected %x, got %x", k.GetAuthority(), authority)
}
if err := msg.Params.Validate(); err != nil {
return nil, err
}
if err := k.Params.Set(ctx, msg.Params); err != nil {
return nil, err
}
return &types.MsgUpdateParamsResponse{}, nil
}