2024-07-05 22:20:13 -04:00
|
|
|
package keeper
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
|
2024-09-07 18:12:58 -04:00
|
|
|
"cosmossdk.io/errors"
|
2024-07-05 22:20:13 -04:00
|
|
|
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
|
|
|
|
|
2025-03-27 04:14:38 -04:00
|
|
|
"github.com/sonr-io/snrd/x/did/types"
|
2024-07-05 22:20:13 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type msgServer struct {
|
|
|
|
|
k Keeper
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var _ types.MsgServer = msgServer{}
|
|
|
|
|
|
|
|
|
|
// NewMsgServerImpl returns an implementation of the module MsgServer interface.
|
|
|
|
|
func NewMsgServerImpl(keeper Keeper) types.MsgServer {
|
|
|
|
|
return &msgServer{k: keeper}
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-11 15:10:54 -04:00
|
|
|
// UpdateParams updates the x/did module parameters.
|
2024-09-25 19:45:28 -04:00
|
|
|
func (ms msgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) {
|
2024-09-11 15:10:54 -04:00
|
|
|
if ms.k.authority != msg.Authority {
|
|
|
|
|
return nil, errors.Wrapf(
|
|
|
|
|
govtypes.ErrInvalidSigner,
|
|
|
|
|
"invalid authority; expected %s, got %s",
|
|
|
|
|
ms.k.authority,
|
|
|
|
|
msg.Authority,
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
return nil, ms.k.Params.Set(ctx, msg.Params)
|
2024-08-10 17:08:05 -04:00
|
|
|
}
|
2024-09-24 17:54:33 -04:00
|
|
|
|
|
|
|
|
// ExecuteTx implements types.MsgServer.
|
|
|
|
|
func (ms msgServer) ExecuteTx(ctx context.Context, msg *types.MsgExecuteTx) (*types.MsgExecuteTxResponse, error) {
|
|
|
|
|
// ctx := sdk.UnwrapSDKContext(goCtx)
|
|
|
|
|
return &types.MsgExecuteTxResponse{}, nil
|
|
|
|
|
}
|
2024-10-15 14:31:19 -04:00
|
|
|
|
|
|
|
|
// LinkAssertion implements types.MsgServer.
|
|
|
|
|
func (ms msgServer) LinkAssertion(ctx context.Context, msg *types.MsgLinkAssertion) (*types.MsgLinkAssertionResponse, error) {
|
|
|
|
|
// ctx := sdk.UnwrapSDKContext(goCtx)
|
|
|
|
|
return &types.MsgLinkAssertionResponse{}, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// LinkAuthentication implements types.MsgServer.
|
|
|
|
|
func (ms msgServer) LinkAuthentication(ctx context.Context, msg *types.MsgLinkAuthentication) (*types.MsgLinkAuthenticationResponse, error) {
|
|
|
|
|
// ctx := sdk.UnwrapSDKContext(goCtx)
|
|
|
|
|
return &types.MsgLinkAuthenticationResponse{}, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// UnlinkAssertion implements types.MsgServer.
|
|
|
|
|
func (ms msgServer) UnlinkAssertion(ctx context.Context, msg *types.MsgUnlinkAssertion) (*types.MsgUnlinkAssertionResponse, error) {
|
|
|
|
|
// ctx := sdk.UnwrapSDKContext(goCtx)
|
|
|
|
|
return &types.MsgUnlinkAssertionResponse{}, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// UnlinkAuthentication implements types.MsgServer.
|
|
|
|
|
func (ms msgServer) UnlinkAuthentication(ctx context.Context, msg *types.MsgUnlinkAuthentication) (*types.MsgUnlinkAuthenticationResponse, error) {
|
|
|
|
|
// ctx := sdk.UnwrapSDKContext(goCtx)
|
|
|
|
|
return &types.MsgUnlinkAuthenticationResponse{}, nil
|
|
|
|
|
}
|