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>
28 lines
766 B
Go
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
|
|
}
|