refactor: remove comet info from consensus as it will be stored in context for v2 (#21120)

This commit is contained in:
Marko
2024-07-31 20:21:23 +00:00
committed by GitHub
parent 98e09a720d
commit 43dd23137e
16 changed files with 151 additions and 3503 deletions
File diff suppressed because it is too large Load Diff
+1 -40
View File
@@ -21,8 +21,7 @@ import (
const _ = grpc.SupportPackageIsVersion7
const (
Query_Params_FullMethodName = "/cosmos.consensus.v1.Query/Params"
Query_GetCometInfo_FullMethodName = "/cosmos.consensus.v1.Query/GetCometInfo"
Query_Params_FullMethodName = "/cosmos.consensus.v1.Query/Params"
)
// QueryClient is the client API for Query service.
@@ -31,8 +30,6 @@ const (
type QueryClient interface {
// Params queries the parameters of x/consensus module.
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
// CometInfo queries the comet info of x/consensus module.
GetCometInfo(ctx context.Context, in *QueryGetCometInfoRequest, opts ...grpc.CallOption) (*QueryGetCometInfoResponse, error)
}
type queryClient struct {
@@ -52,23 +49,12 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts .
return out, nil
}
func (c *queryClient) GetCometInfo(ctx context.Context, in *QueryGetCometInfoRequest, opts ...grpc.CallOption) (*QueryGetCometInfoResponse, error) {
out := new(QueryGetCometInfoResponse)
err := c.cc.Invoke(ctx, Query_GetCometInfo_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// QueryServer is the server API for Query service.
// All implementations must embed UnimplementedQueryServer
// for forward compatibility
type QueryServer interface {
// Params queries the parameters of x/consensus module.
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
// CometInfo queries the comet info of x/consensus module.
GetCometInfo(context.Context, *QueryGetCometInfoRequest) (*QueryGetCometInfoResponse, error)
mustEmbedUnimplementedQueryServer()
}
@@ -79,9 +65,6 @@ type UnimplementedQueryServer struct {
func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
}
func (UnimplementedQueryServer) GetCometInfo(context.Context, *QueryGetCometInfoRequest) (*QueryGetCometInfoResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetCometInfo not implemented")
}
func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {}
// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service.
@@ -113,24 +96,6 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf
return interceptor(ctx, in, info, handler)
}
func _Query_GetCometInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryGetCometInfoRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).GetCometInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_GetCometInfo_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).GetCometInfo(ctx, req.(*QueryGetCometInfoRequest))
}
return interceptor(ctx, in, info, handler)
}
// Query_ServiceDesc is the grpc.ServiceDesc for Query service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@@ -142,10 +107,6 @@ var Query_ServiceDesc = grpc.ServiceDesc{
MethodName: "Params",
Handler: _Query_Params_Handler,
},
{
MethodName: "GetCometInfo",
Handler: _Query_GetCometInfo_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "cosmos/consensus/v1/query.proto",
File diff suppressed because it is too large Load Diff
-39
View File
@@ -22,7 +22,6 @@ const _ = grpc.SupportPackageIsVersion7
const (
Msg_UpdateParams_FullMethodName = "/cosmos.consensus.v1.Msg/UpdateParams"
Msg_SetCometInfo_FullMethodName = "/cosmos.consensus.v1.Msg/SetCometInfo"
)
// MsgClient is the client API for Msg service.
@@ -32,8 +31,6 @@ type MsgClient interface {
// UpdateParams defines a governance operation for updating the x/consensus module parameters.
// The authority is defined in the keeper.
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
// SetCometInfo defines how to set the comet info for the x/consensus module.
SetCometInfo(ctx context.Context, in *MsgSetCometInfo, opts ...grpc.CallOption) (*MsgSetCometInfoResponse, error)
}
type msgClient struct {
@@ -53,15 +50,6 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts
return out, nil
}
func (c *msgClient) SetCometInfo(ctx context.Context, in *MsgSetCometInfo, opts ...grpc.CallOption) (*MsgSetCometInfoResponse, error) {
out := new(MsgSetCometInfoResponse)
err := c.cc.Invoke(ctx, Msg_SetCometInfo_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
@@ -69,8 +57,6 @@ type MsgServer interface {
// UpdateParams defines a governance operation for updating the x/consensus module parameters.
// The authority is defined in the keeper.
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
// SetCometInfo defines how to set the comet info for the x/consensus module.
SetCometInfo(context.Context, *MsgSetCometInfo) (*MsgSetCometInfoResponse, error)
mustEmbedUnimplementedMsgServer()
}
@@ -81,9 +67,6 @@ type UnimplementedMsgServer struct {
func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
}
func (UnimplementedMsgServer) SetCometInfo(context.Context, *MsgSetCometInfo) (*MsgSetCometInfoResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SetCometInfo not implemented")
}
func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {}
// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service.
@@ -115,24 +98,6 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in
return interceptor(ctx, in, info, handler)
}
func _Msg_SetCometInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgSetCometInfo)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).SetCometInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_SetCometInfo_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).SetCometInfo(ctx, req.(*MsgSetCometInfo))
}
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)
@@ -144,10 +109,6 @@ var Msg_ServiceDesc = grpc.ServiceDesc{
MethodName: "UpdateParams",
Handler: _Msg_UpdateParams_Handler,
},
{
MethodName: "SetCometInfo",
Handler: _Msg_SetCometInfo_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "cosmos/consensus/v1/tx.proto",