feat: add proto for cons pubkey rotation (#18140)

This commit is contained in:
atheeshp
2023-10-17 12:42:16 +00:00
committed by GitHub
parent 93770f59d9
commit 8f8e242e78
11 changed files with 4439 additions and 1067 deletions
+4
View File
@@ -2723,6 +2723,8 @@ func (*MsgRevokeAllowanceResponse) Descriptor() ([]byte, []int) {
}
// MsgPruneAllowances prunes expired fee allowances.
//
// Since cosmos-sdk 0.50
type MsgPruneAllowances struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -2760,6 +2762,8 @@ func (x *MsgPruneAllowances) GetPruner() string {
}
// MsgPruneAllowancesResponse defines the Msg/PruneAllowancesResponse response type.
//
// Since cosmos-sdk 0.50
type MsgPruneAllowancesResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
+6 -2
View File
@@ -36,7 +36,9 @@ type MsgClient interface {
// RevokeAllowance revokes any fee allowance of granter's account that
// has been granted to the grantee.
RevokeAllowance(ctx context.Context, in *MsgRevokeAllowance, opts ...grpc.CallOption) (*MsgRevokeAllowanceResponse, error)
// PruneAllowances prunes expired fee allowances.
// PruneAllowances prunes expired fee allowances, currently up to 75 at a time.
//
// Since cosmos-sdk 0.50
PruneAllowances(ctx context.Context, in *MsgPruneAllowances, opts ...grpc.CallOption) (*MsgPruneAllowancesResponse, error)
}
@@ -85,7 +87,9 @@ type MsgServer interface {
// RevokeAllowance revokes any fee allowance of granter's account that
// has been granted to the grantee.
RevokeAllowance(context.Context, *MsgRevokeAllowance) (*MsgRevokeAllowanceResponse, error)
// PruneAllowances prunes expired fee allowances.
// PruneAllowances prunes expired fee allowances, currently up to 75 at a time.
//
// Since cosmos-sdk 0.50
PruneAllowances(context.Context, *MsgPruneAllowances) (*MsgPruneAllowancesResponse, error)
mustEmbedUnimplementedMsgServer()
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+43
View File
@@ -26,6 +26,7 @@ const (
Msg_Undelegate_FullMethodName = "/cosmos.staking.v1beta1.Msg/Undelegate"
Msg_CancelUnbondingDelegation_FullMethodName = "/cosmos.staking.v1beta1.Msg/CancelUnbondingDelegation"
Msg_UpdateParams_FullMethodName = "/cosmos.staking.v1beta1.Msg/UpdateParams"
Msg_RotateConsPubKey_FullMethodName = "/cosmos.staking.v1beta1.Msg/RotateConsPubKey"
)
// MsgClient is the client API for Msg service.
@@ -54,6 +55,10 @@ type MsgClient interface {
// parameters.
// Since: cosmos-sdk 0.47
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
// RotateConsPubKey defines an operation for rotating the consensus keys
// of a validator.
// Since: cosmos-sdk 0.48
RotateConsPubKey(ctx context.Context, in *MsgRotateConsPubKey, opts ...grpc.CallOption) (*MsgRotateConsPubKeyResponse, error)
}
type msgClient struct {
@@ -127,6 +132,15 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts
return out, nil
}
func (c *msgClient) RotateConsPubKey(ctx context.Context, in *MsgRotateConsPubKey, opts ...grpc.CallOption) (*MsgRotateConsPubKeyResponse, error) {
out := new(MsgRotateConsPubKeyResponse)
err := c.cc.Invoke(ctx, Msg_RotateConsPubKey_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// MsgServer is the server API for Msg service.
// All implementations must embed UnimplementedMsgServer
// for forward compatibility
@@ -153,6 +167,10 @@ type MsgServer interface {
// parameters.
// Since: cosmos-sdk 0.47
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
// RotateConsPubKey defines an operation for rotating the consensus keys
// of a validator.
// Since: cosmos-sdk 0.48
RotateConsPubKey(context.Context, *MsgRotateConsPubKey) (*MsgRotateConsPubKeyResponse, error)
mustEmbedUnimplementedMsgServer()
}
@@ -181,6 +199,9 @@ func (UnimplementedMsgServer) CancelUnbondingDelegation(context.Context, *MsgCan
func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
}
func (UnimplementedMsgServer) RotateConsPubKey(context.Context, *MsgRotateConsPubKey) (*MsgRotateConsPubKeyResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RotateConsPubKey not implemented")
}
func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {}
// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service.
@@ -320,6 +341,24 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in
return interceptor(ctx, in, info, handler)
}
func _Msg_RotateConsPubKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgRotateConsPubKey)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).RotateConsPubKey(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_RotateConsPubKey_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).RotateConsPubKey(ctx, req.(*MsgRotateConsPubKey))
}
return interceptor(ctx, in, info, handler)
}
// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@@ -355,6 +394,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{
MethodName: "UpdateParams",
Handler: _Msg_UpdateParams_Handler,
},
{
MethodName: "RotateConsPubKey",
Handler: _Msg_RotateConsPubKey_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "cosmos/staking/v1beta1/tx.proto",