mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-07-01 10:22:30 +00:00

* add MintAddress to params.proto * ignite scaffold message update-params params:Params --module dao * add dao get and set params * make dao.MsgUpdateParams.Params non-nullable * use GetMintAddress in ante handler * adjust dao e2e test suit for mint address param * change msg creator to authority and set gov module as default in gov proposal * fix staticcheck error * remove depricated config param * fix linter errors Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
25 lines
658 B
Go
25 lines
658 B
Go
package keeper
|
|
|
|
import (
|
|
"context"
|
|
|
|
"cosmossdk.io/errors"
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
|
"github.com/planetmint/planetmint-go/x/dao/types"
|
|
)
|
|
|
|
func (k msgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) {
|
|
ctx := sdk.UnwrapSDKContext(goCtx)
|
|
|
|
if k.authority != msg.Authority {
|
|
return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.authority, msg.Authority)
|
|
}
|
|
|
|
if err := k.SetParams(ctx, msg.Params); err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &types.MsgUpdateParamsResponse{}, nil
|
|
}
|