mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-05-21 22:36:37 +00:00

* added signing authority (dao) to the keeper to enable dao signing checks * added UpdateParam message for the machine module --------- Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
25 lines
662 B
Go
25 lines
662 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/machine/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
|
|
}
|