diff --git a/proto/sedachain/staking/v1/tx.proto b/proto/sedachain/staking/v1/tx.proto index 92920639..c8979cd0 100644 --- a/proto/sedachain/staking/v1/tx.proto +++ b/proto/sedachain/staking/v1/tx.proto @@ -14,44 +14,10 @@ import "sedachain/pubkey/v1/pubkey.proto"; option go_package = "github.com/sedaprotocol/seda-chain/x/staking/types"; -// Msg defines the staking Msg service. service Msg { // CreateSEDAValidator defines a method for creating a new validator. rpc CreateSEDAValidator(MsgCreateSEDAValidator) returns (MsgCreateSEDAValidatorResponse); - - // EditValidator defines a method for editing an existing validator. - rpc EditValidator(cosmos.staking.v1beta1.MsgEditValidator) - returns (cosmos.staking.v1beta1.MsgEditValidatorResponse); - - // Delegate defines a method for performing a delegation of coins - // from a delegator to a validator. - rpc Delegate(cosmos.staking.v1beta1.MsgDelegate) - returns (cosmos.staking.v1beta1.MsgDelegateResponse); - - // BeginRedelegate defines a method for performing a redelegation - // of coins from a delegator and source validator to a destination validator. - rpc BeginRedelegate(cosmos.staking.v1beta1.MsgBeginRedelegate) - returns (cosmos.staking.v1beta1.MsgBeginRedelegateResponse); - - // Undelegate defines a method for performing an undelegation from a - // delegate and a validator. - rpc Undelegate(cosmos.staking.v1beta1.MsgUndelegate) - returns (cosmos.staking.v1beta1.MsgUndelegateResponse); - - // CancelUnbondingDelegation defines a method for performing canceling the - // unbonding delegation and delegate back to previous validator. - // - // Since: cosmos-sdk 0.46 - rpc CancelUnbondingDelegation( - cosmos.staking.v1beta1.MsgCancelUnbondingDelegation) - returns (cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse); - - // UpdateParams defines an operation for updating the x/staking module - // parameters. - // Since: cosmos-sdk 0.47 - rpc UpdateParams(cosmos.staking.v1beta1.MsgUpdateParams) - returns (cosmos.staking.v1beta1.MsgUpdateParamsResponse); } // MsgCreateSEDAValidator defines a message for creating a new SEDA diff --git a/x/pubkey/keeper/endblock_test.go b/x/pubkey/keeper/endblock_test.go index dcd4d7f8..64cea041 100644 --- a/x/pubkey/keeper/endblock_test.go +++ b/x/pubkey/keeper/endblock_test.go @@ -167,8 +167,10 @@ func initFixture(tb testing.TB) *fixture { }) types.RegisterMsgServer(integrationApp.MsgServiceRouter(), keeper.NewMsgServerImpl(pubKeyKeeper)) + sdkStakingMsgServer := sdkstakingkeeper.NewMsgServerImpl(sdkStakingKeeper) stakingMsgServer := stakingkeeper.NewMsgServerImpl(sdkStakingMsgServer, stakingKeeper) + sdkstakingtypes.RegisterMsgServer(integrationApp.MsgServiceRouter(), stakingMsgServer) stakingtypes.RegisterMsgServer(integrationApp.MsgServiceRouter(), stakingMsgServer) return &fixture{ diff --git a/x/staking/client/cli/tx.go b/x/staking/client/cli/tx.go index 2b7ccc4c..a852fb58 100644 --- a/x/staking/client/cli/tx.go +++ b/x/staking/client/cli/tx.go @@ -59,7 +59,7 @@ func NewTxCmd(valAddrCodec, ac address.Codec) *cobra.Command { func NewCreateValidatorCmd(ac address.Codec) *cobra.Command { cmd := &cobra.Command{ Use: "create-validator [path/to/validator.json]", - Short: "create new validator initialized with a self-delegation to it", + Short: "Create new validator initialized with a self-delegation to it", Args: cobra.ExactArgs(1), Long: `Create a new validator initialized with a self-delegation by submitting a JSON file with the new validator details.`, Example: strings.TrimSpace( diff --git a/x/staking/keeper/msg_server.go b/x/staking/keeper/msg_server.go index f2f0802e..14c49546 100644 --- a/x/staking/keeper/msg_server.go +++ b/x/staking/keeper/msg_server.go @@ -3,6 +3,8 @@ package keeper import ( "context" + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -18,7 +20,7 @@ type msgServer struct { *Keeper } -func NewMsgServerImpl(sdkMsgServer stakingtypes.MsgServer, keeper *Keeper) types.MsgServer { +func NewMsgServerImpl(sdkMsgServer stakingtypes.MsgServer, keeper *Keeper) types.CombinedMsgServer { ms := &msgServer{ MsgServer: sdkMsgServer, Keeper: keeper, @@ -26,6 +28,13 @@ func NewMsgServerImpl(sdkMsgServer stakingtypes.MsgServer, keeper *Keeper) types return ms } +// CreateValidator overrides the default CreateValidator method. +func (m msgServer) CreateValidator(ctx context.Context, msg *stakingtypes.MsgCreateValidator) (*stakingtypes.MsgCreateValidatorResponse, error) { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "not implemented") +} + +// CreateSEDAValidator stores given SEDA public keys, if provided, and +// creates a validator. func (m msgServer) CreateSEDAValidator(ctx context.Context, msg *types.MsgCreateSEDAValidator) (*types.MsgCreateSEDAValidatorResponse, error) { sdkCtx := sdk.UnwrapSDKContext(ctx) @@ -71,27 +80,3 @@ func (m msgServer) CreateSEDAValidator(ctx context.Context, msg *types.MsgCreate } return &types.MsgCreateSEDAValidatorResponse{}, nil } - -func (m msgServer) EditValidator(ctx context.Context, msg *stakingtypes.MsgEditValidator) (*stakingtypes.MsgEditValidatorResponse, error) { - return m.MsgServer.EditValidator(ctx, msg) -} - -func (m msgServer) Delegate(ctx context.Context, msg *stakingtypes.MsgDelegate) (*stakingtypes.MsgDelegateResponse, error) { - return m.MsgServer.Delegate(ctx, msg) -} - -func (m msgServer) BeginRedelegate(ctx context.Context, msg *stakingtypes.MsgBeginRedelegate) (*stakingtypes.MsgBeginRedelegateResponse, error) { - return m.MsgServer.BeginRedelegate(ctx, msg) -} - -func (m msgServer) Undelegate(ctx context.Context, msg *stakingtypes.MsgUndelegate) (*stakingtypes.MsgUndelegateResponse, error) { - return m.MsgServer.Undelegate(ctx, msg) -} - -func (m msgServer) CancelUnbondingDelegation(ctx context.Context, msg *stakingtypes.MsgCancelUnbondingDelegation) (*stakingtypes.MsgCancelUnbondingDelegationResponse, error) { - return m.MsgServer.CancelUnbondingDelegation(ctx, msg) -} - -func (m msgServer) UpdateParams(ctx context.Context, msg *stakingtypes.MsgUpdateParams) (*stakingtypes.MsgUpdateParamsResponse, error) { - return m.MsgServer.UpdateParams(ctx, msg) -} diff --git a/x/staking/module.go b/x/staking/module.go index 80255751..bf63387e 100644 --- a/x/staking/module.go +++ b/x/staking/module.go @@ -122,6 +122,8 @@ func NewAppModule( func (am AppModule) RegisterServices(cfg module.Configurator) { sdkMsgServer := sdkkeeper.NewMsgServerImpl(am.keeper.Keeper) msgServer := keeper.NewMsgServerImpl(sdkMsgServer, am.keeper) + + sdktypes.RegisterMsgServer(cfg.MsgServer(), msgServer) types.RegisterMsgServer(cfg.MsgServer(), msgServer) querier := sdkkeeper.Querier{Keeper: am.keeper.Keeper} diff --git a/x/staking/types/codec.go b/x/staking/types/codec.go index 40d46907..1e0ee36f 100644 --- a/x/staking/types/codec.go +++ b/x/staking/types/codec.go @@ -13,6 +13,7 @@ import ( func RegisterInterfaces(registry codectypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgCreateSEDAValidator{}, + &types.MsgCreateValidator{}, &types.MsgEditValidator{}, &types.MsgDelegate{}, &types.MsgUndelegate{}, diff --git a/x/staking/types/tx.pb.go b/x/staking/types/tx.pb.go index 833aab28..474fb013 100644 --- a/x/staking/types/tx.pb.go +++ b/x/staking/types/tx.pb.go @@ -131,57 +131,49 @@ func init() { func init() { proto.RegisterFile("sedachain/staking/v1/tx.proto", fileDescriptor_670d278351a2d088) } var fileDescriptor_670d278351a2d088 = []byte{ - // 799 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x95, 0x4f, 0x6f, 0xe3, 0x44, - 0x18, 0xc6, 0x63, 0xba, 0x0d, 0xbb, 0x53, 0xfe, 0x34, 0xde, 0x00, 0x89, 0xa5, 0x75, 0x42, 0x17, - 0xb4, 0x51, 0x21, 0xe3, 0x4d, 0xd8, 0xd3, 0x8a, 0x4b, 0xd3, 0x2e, 0xa8, 0x82, 0xa2, 0xca, 0x55, - 0x39, 0x20, 0xa4, 0x30, 0xb6, 0xa7, 0xce, 0x28, 0xf6, 0x8c, 0xf1, 0x4c, 0xa2, 0xfa, 0xca, 0x89, - 0x1b, 0x7c, 0x02, 0xd4, 0x23, 0xc7, 0x22, 0xf5, 0x43, 0x54, 0x9c, 0xaa, 0x9e, 0x10, 0x87, 0x0a, - 0xb5, 0x87, 0xf2, 0x31, 0x50, 0x3c, 0x63, 0x3b, 0x2d, 0x49, 0x14, 0xb8, 0x58, 0x33, 0xf3, 0x3e, - 0xcf, 0xef, 0x7d, 0x67, 0xe6, 0xb5, 0x0d, 0x9e, 0x70, 0xec, 0x21, 0x77, 0x80, 0x08, 0xb5, 0xb8, - 0x40, 0x43, 0x42, 0x7d, 0x6b, 0xdc, 0xb1, 0xc4, 0x31, 0x8c, 0x62, 0x26, 0x98, 0x5e, 0xcd, 0xc3, - 0x50, 0x85, 0xe1, 0xb8, 0x63, 0xd4, 0x7d, 0xc6, 0xfc, 0x00, 0x5b, 0xa9, 0xc6, 0x19, 0x1d, 0x59, - 0x88, 0x26, 0xd2, 0x60, 0x54, 0x7d, 0xe6, 0xb3, 0x74, 0x68, 0x4d, 0x46, 0x6a, 0xb5, 0xee, 0x32, - 0x1e, 0x32, 0xde, 0x97, 0x01, 0x39, 0x51, 0x21, 0x53, 0xce, 0x2c, 0x07, 0x71, 0x6c, 0x8d, 0x3b, - 0x0e, 0x16, 0xa8, 0x63, 0xb9, 0x8c, 0x50, 0x15, 0xff, 0x40, 0xc5, 0x8b, 0xea, 0xa4, 0x24, 0x2b, - 0x47, 0xaa, 0x1a, 0x73, 0x54, 0xd9, 0x46, 0x8c, 0xf7, 0x94, 0x20, 0xe4, 0xe9, 0x06, 0x43, 0x9e, - 0x39, 0x2b, 0x28, 0x24, 0x94, 0x59, 0xe9, 0x53, 0x2d, 0x35, 0x8b, 0x33, 0x89, 0x46, 0xce, 0x10, - 0x27, 0x13, 0x87, 0x1c, 0x49, 0xc5, 0xc6, 0x6f, 0xab, 0xe0, 0xdd, 0x3d, 0xee, 0x6f, 0xc7, 0x18, - 0x09, 0x7c, 0xf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 0xff, 0xff, 0xce, 0x4a, 0xdf, 0x0b, 0x83, 0x07, 0x00, 0x00, + // 661 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0xcf, 0x6e, 0xd3, 0x4a, + 0x14, 0xc6, 0xe3, 0xdb, 0x3f, 0xf7, 0x76, 0x2a, 0x5d, 0x35, 0x6e, 0xee, 0x25, 0x8d, 0x54, 0x27, + 0x14, 0x24, 0xaa, 0x8a, 0x8c, 0x49, 0x60, 0xd5, 0x5d, 0xd3, 0x02, 0xaa, 0xa0, 0xa8, 0x72, 0x25, + 0x16, 0x6c, 0xc2, 0xd8, 0x9e, 0xba, 0xa3, 0xd8, 0x33, 0x96, 0x67, 0x62, 0xd5, 0x3b, 0xc4, 0x8a, + 0x25, 0x8f, 0xd0, 0x25, 0xcb, 0x22, 0xf5, 0x21, 0x2a, 0x56, 0x55, 0x57, 0x88, 0x45, 0x85, 0xda, + 0x45, 0x79, 0x0c, 0xe4, 0x99, 0xb1, 0x93, 0x42, 0xba, 0x60, 0x13, 0xcd, 0xcc, 0xf7, 0x9d, 0x9f, + 0xcf, 0x9c, 0x73, 0x26, 0x60, 0x99, 0x63, 0x1f, 0x79, 0x07, 0x88, 0x50, 0x9b, 0x0b, 0x34, 0x20, + 0x34, 0xb0, 0xd3, 0x8e, 0x2d, 0x0e, 0x61, 0x9c, 0x30, 0xc1, 0xcc, 0x5a, 0x29, 0x43, 0x2d, 0xc3, + 0xb4, 0xd3, 0x58, 0x0a, 0x18, 0x0b, 0x42, 0x6c, 0x4b, 0x8f, 0x3b, 0xdc, 0xb7, 0x11, 0xcd, 0x54, + 0x40, 0xa3, 0x16, 0xb0, 0x80, 0xc9, 0xa5, 0x9d, 0xaf, 0xf4, 0xe9, 0x92, 0xc7, 0x78, 0xc4, 0x78, + 0x5f, 0x09, 0x6a, 0xa3, 0x25, 0x4b, 0xed, 0x6c, 0x17, 0x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 0x8c, 0x1f, 0xf2, 0x75, 0xeb, 0xc3, 0x51, 0xb3, 0xf2, + 0xe3, 0xa8, 0x59, 0x79, 0x7f, 0x7d, 0xbc, 0xf6, 0x7b, 0xc9, 0x56, 0x5a, 0xc0, 0x9a, 0x3c, 0xb2, + 0x0e, 0xe6, 0x31, 0xa3, 0x1c, 0x77, 0xdf, 0x19, 0x60, 0x6a, 0x87, 0x07, 0x66, 0x06, 0x16, 0x27, + 0x4d, 0xf6, 0x43, 0x38, 0xe9, 0xcf, 0x00, 0x4e, 0x86, 0x36, 0x9e, 0xfc, 0x89, 0xbb, 0x48, 0xa1, + 0xf7, 0xf2, 0xf4, 0xd2, 0x32, 0xce, 0x2e, 0x2d, 0xe3, 0xfb, 0xa5, 0x65, 0x7c, 0xbc, 0xb2, 0x2a, + 0x67, 0x57, 0x56, 0xe5, 0xeb, 0x95, 0x55, 0x79, 0xd3, 0x0d, 0x88, 0x38, 0x18, 0xba, 0xd0, 0x63, + 0x91, 0x9d, 0x93, 0x65, 0xb7, 0x3c, 0x16, 0xca, 0x4d, 0x5b, 0xbd, 0xd6, 0xc3, 0xf2, 0xfd, 0x8b, + 0x2c, 0xc6, 0xdc, 0x9d, 0x95, 0xa6, 0xc7, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x58, 0x76, 0x35, + 0xef, 0xe5, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -198,26 +190,6 @@ const _ = grpc.SupportPackageIsVersion4 type MsgClient interface { // CreateSEDAValidator defines a method for creating a new validator. CreateSEDAValidator(ctx context.Context, in *MsgCreateSEDAValidator, opts ...grpc.CallOption) (*MsgCreateSEDAValidatorResponse, error) - // EditValidator defines a method for editing an existing validator. - EditValidator(ctx context.Context, in *types.MsgEditValidator, opts ...grpc.CallOption) (*types.MsgEditValidatorResponse, error) - // Delegate defines a method for performing a delegation of coins - // from a delegator to a validator. - Delegate(ctx context.Context, in *types.MsgDelegate, opts ...grpc.CallOption) (*types.MsgDelegateResponse, error) - // BeginRedelegate defines a method for performing a redelegation - // of coins from a delegator and source validator to a destination validator. - BeginRedelegate(ctx context.Context, in *types.MsgBeginRedelegate, opts ...grpc.CallOption) (*types.MsgBeginRedelegateResponse, error) - // Undelegate defines a method for performing an undelegation from a - // delegate and a validator. - Undelegate(ctx context.Context, in *types.MsgUndelegate, opts ...grpc.CallOption) (*types.MsgUndelegateResponse, error) - // CancelUnbondingDelegation defines a method for performing canceling the unbonding delegation - // and delegate back to previous validator. - // - // Since: cosmos-sdk 0.46 - CancelUnbondingDelegation(ctx context.Context, in *types.MsgCancelUnbondingDelegation, opts ...grpc.CallOption) (*types.MsgCancelUnbondingDelegationResponse, error) - // UpdateParams defines an operation for updating the x/staking module - // parameters. - // Since: cosmos-sdk 0.47 - UpdateParams(ctx context.Context, in *types.MsgUpdateParams, opts ...grpc.CallOption) (*types.MsgUpdateParamsResponse, error) } type msgClient struct { @@ -237,84 +209,10 @@ func (c *msgClient) CreateSEDAValidator(ctx context.Context, in *MsgCreateSEDAVa return out, nil } -func (c *msgClient) EditValidator(ctx context.Context, in *types.MsgEditValidator, opts ...grpc.CallOption) (*types.MsgEditValidatorResponse, error) { - out := new(types.MsgEditValidatorResponse) - err := c.cc.Invoke(ctx, "/sedachain.staking.v1.Msg/EditValidator", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) Delegate(ctx context.Context, in *types.MsgDelegate, opts ...grpc.CallOption) (*types.MsgDelegateResponse, error) { - out := new(types.MsgDelegateResponse) - err := c.cc.Invoke(ctx, "/sedachain.staking.v1.Msg/Delegate", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) BeginRedelegate(ctx context.Context, in *types.MsgBeginRedelegate, opts ...grpc.CallOption) (*types.MsgBeginRedelegateResponse, error) { - out := new(types.MsgBeginRedelegateResponse) - err := c.cc.Invoke(ctx, "/sedachain.staking.v1.Msg/BeginRedelegate", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) Undelegate(ctx context.Context, in *types.MsgUndelegate, opts ...grpc.CallOption) (*types.MsgUndelegateResponse, error) { - out := new(types.MsgUndelegateResponse) - err := c.cc.Invoke(ctx, "/sedachain.staking.v1.Msg/Undelegate", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) CancelUnbondingDelegation(ctx context.Context, in *types.MsgCancelUnbondingDelegation, opts ...grpc.CallOption) (*types.MsgCancelUnbondingDelegationResponse, error) { - out := new(types.MsgCancelUnbondingDelegationResponse) - err := c.cc.Invoke(ctx, "/sedachain.staking.v1.Msg/CancelUnbondingDelegation", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) UpdateParams(ctx context.Context, in *types.MsgUpdateParams, opts ...grpc.CallOption) (*types.MsgUpdateParamsResponse, error) { - out := new(types.MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, "/sedachain.staking.v1.Msg/UpdateParams", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // MsgServer is the server API for Msg service. type MsgServer interface { // CreateSEDAValidator defines a method for creating a new validator. CreateSEDAValidator(context.Context, *MsgCreateSEDAValidator) (*MsgCreateSEDAValidatorResponse, error) - // EditValidator defines a method for editing an existing validator. - EditValidator(context.Context, *types.MsgEditValidator) (*types.MsgEditValidatorResponse, error) - // Delegate defines a method for performing a delegation of coins - // from a delegator to a validator. - Delegate(context.Context, *types.MsgDelegate) (*types.MsgDelegateResponse, error) - // BeginRedelegate defines a method for performing a redelegation - // of coins from a delegator and source validator to a destination validator. - BeginRedelegate(context.Context, *types.MsgBeginRedelegate) (*types.MsgBeginRedelegateResponse, error) - // Undelegate defines a method for performing an undelegation from a - // delegate and a validator. - Undelegate(context.Context, *types.MsgUndelegate) (*types.MsgUndelegateResponse, error) - // CancelUnbondingDelegation defines a method for performing canceling the unbonding delegation - // and delegate back to previous validator. - // - // Since: cosmos-sdk 0.46 - CancelUnbondingDelegation(context.Context, *types.MsgCancelUnbondingDelegation) (*types.MsgCancelUnbondingDelegationResponse, error) - // UpdateParams defines an operation for updating the x/staking module - // parameters. - // Since: cosmos-sdk 0.47 - UpdateParams(context.Context, *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -324,24 +222,6 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) CreateSEDAValidator(ctx context.Context, req *MsgCreateSEDAValidator) (*MsgCreateSEDAValidatorResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateSEDAValidator not implemented") } -func (*UnimplementedMsgServer) EditValidator(ctx context.Context, req *types.MsgEditValidator) (*types.MsgEditValidatorResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method EditValidator not implemented") -} -func (*UnimplementedMsgServer) Delegate(ctx context.Context, req *types.MsgDelegate) (*types.MsgDelegateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Delegate not implemented") -} -func (*UnimplementedMsgServer) BeginRedelegate(ctx context.Context, req *types.MsgBeginRedelegate) (*types.MsgBeginRedelegateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method BeginRedelegate not implemented") -} -func (*UnimplementedMsgServer) Undelegate(ctx context.Context, req *types.MsgUndelegate) (*types.MsgUndelegateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Undelegate not implemented") -} -func (*UnimplementedMsgServer) CancelUnbondingDelegation(ctx context.Context, req *types.MsgCancelUnbondingDelegation) (*types.MsgCancelUnbondingDelegationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CancelUnbondingDelegation not implemented") -} -func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") -} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -365,114 +245,6 @@ func _Msg_CreateSEDAValidator_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } -func _Msg_EditValidator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(types.MsgEditValidator) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).EditValidator(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/sedachain.staking.v1.Msg/EditValidator", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).EditValidator(ctx, req.(*types.MsgEditValidator)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_Delegate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(types.MsgDelegate) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).Delegate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/sedachain.staking.v1.Msg/Delegate", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).Delegate(ctx, req.(*types.MsgDelegate)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_BeginRedelegate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(types.MsgBeginRedelegate) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).BeginRedelegate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/sedachain.staking.v1.Msg/BeginRedelegate", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).BeginRedelegate(ctx, req.(*types.MsgBeginRedelegate)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_Undelegate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(types.MsgUndelegate) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).Undelegate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/sedachain.staking.v1.Msg/Undelegate", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).Undelegate(ctx, req.(*types.MsgUndelegate)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_CancelUnbondingDelegation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(types.MsgCancelUnbondingDelegation) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).CancelUnbondingDelegation(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/sedachain.staking.v1.Msg/CancelUnbondingDelegation", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).CancelUnbondingDelegation(ctx, req.(*types.MsgCancelUnbondingDelegation)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(types.MsgUpdateParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/sedachain.staking.v1.Msg/UpdateParams", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParams(ctx, req.(*types.MsgUpdateParams)) - } - return interceptor(ctx, in, info, handler) -} - var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "sedachain.staking.v1.Msg", @@ -482,30 +254,6 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "CreateSEDAValidator", Handler: _Msg_CreateSEDAValidator_Handler, }, - { - MethodName: "EditValidator", - Handler: _Msg_EditValidator_Handler, - }, - { - MethodName: "Delegate", - Handler: _Msg_Delegate_Handler, - }, - { - MethodName: "BeginRedelegate", - Handler: _Msg_BeginRedelegate_Handler, - }, - { - MethodName: "Undelegate", - Handler: _Msg_Undelegate_Handler, - }, - { - MethodName: "CancelUnbondingDelegation", - Handler: _Msg_CancelUnbondingDelegation_Handler, - }, - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "sedachain/staking/v1/tx.proto", diff --git a/x/vesting/keeper/integration_test.go b/x/vesting/keeper/integration_test.go index ad033906..ae7e4b7d 100644 --- a/x/vesting/keeper/integration_test.go +++ b/x/vesting/keeper/integration_test.go @@ -160,8 +160,10 @@ func initFixture(tb testing.TB) *fixture { }) types.RegisterMsgServer(integrationApp.MsgServiceRouter(), keeper.NewMsgServerImpl(accountKeeper, bankKeeper, stakingKeeper)) + sdkStakingMsgServer := sdkstakingkeeper.NewMsgServerImpl(sdkStakingKeeper) stakingMsgServer := stakingkeeper.NewMsgServerImpl(sdkStakingMsgServer, stakingKeeper) + sdkstakingtypes.RegisterMsgServer(integrationApp.MsgServiceRouter(), stakingMsgServer) stakingtypes.RegisterMsgServer(integrationApp.MsgServiceRouter(), stakingMsgServer) return &fixture{