diff --git a/proto/babylon/zoneconcierge/query.proto b/proto/babylon/zoneconcierge/query.proto index 508751081..ab7e0bb5e 100644 --- a/proto/babylon/zoneconcierge/query.proto +++ b/proto/babylon/zoneconcierge/query.proto @@ -20,9 +20,15 @@ service Query { rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/babylonchain/babylon/zoneconcierge/params"; } + // ChainList queries the list of chains that checkpoint to Babylon rpc ChainList(QueryChainListRequest) returns (QueryChainListResponse) { option (google.api.http).get = "/babylonchain/babylon/zoneconcierge/chains"; } + // ChainInfo queries the latest info of a chain in Babylon's view + rpc ChainInfo(QueryChainInfoRequest) returns (QueryChainInfoResponse) { + option (google.api.http).get = "/babylonchain/babylon/zoneconcierge/chain_info/{chain_id}"; + } + // FinalizedChainInfo queries the BTC-finalised info of a chain, with proofs rpc FinalizedChainInfo(QueryFinalizedChainInfoRequest) returns (QueryFinalizedChainInfoResponse) { option (google.api.http).get = "/babylonchain/babylon/zoneconcierge/finalized_chain_info/{chain_id}"; } @@ -45,6 +51,17 @@ message QueryChainListResponse { repeated string chain_ids = 1; } +// QueryChainInfoRequest is request type for the Query/ChainInfo RPC method. +message QueryChainInfoRequest { + string chain_id = 1; +} + +// QueryChainInfoResponse is response type for the Query/ChainInfo RPC method. +message QueryChainInfoResponse { + // chain_info is the info of the CZ + babylon.zoneconcierge.v1.ChainInfo chain_info = 1; +} + // QueryFinalizedChainInfoRequest is request type for the Query/FinalizedChainInfo RPC method. message QueryFinalizedChainInfoRequest { string chain_id = 1; diff --git a/x/zoneconcierge/keeper/grpc_query.go b/x/zoneconcierge/keeper/grpc_query.go index b57337d96..735f54f20 100644 --- a/x/zoneconcierge/keeper/grpc_query.go +++ b/x/zoneconcierge/keeper/grpc_query.go @@ -25,6 +25,24 @@ func (k Keeper) ChainList(c context.Context, req *types.QueryChainListRequest) ( return resp, nil } +// ChainInfo returns the latest info of a chain with given ID +func (k Keeper) ChainInfo(c context.Context, req *types.QueryChainInfoRequest) (*types.QueryChainInfoResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + if len(req.ChainId) == 0 { + return nil, status.Error(codes.InvalidArgument, "chain ID cannot be empty") + } + + ctx := sdk.UnwrapSDKContext(c) + + // find the chain info of this epoch + chainInfo := k.GetChainInfo(ctx, req.ChainId) + resp := &types.QueryChainInfoResponse{ChainInfo: chainInfo} + return resp, nil +} + func (k Keeper) FinalizedChainInfo(c context.Context, req *types.QueryFinalizedChainInfoRequest) (*types.QueryFinalizedChainInfoResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") diff --git a/x/zoneconcierge/keeper/grpc_query_test.go b/x/zoneconcierge/keeper/grpc_query_test.go index 1c7ff7648..29988a15e 100644 --- a/x/zoneconcierge/keeper/grpc_query_test.go +++ b/x/zoneconcierge/keeper/grpc_query_test.go @@ -56,6 +56,31 @@ func FuzzChainList(f *testing.F) { }) } +func FuzzChainInfo(f *testing.F) { + datagen.AddRandomSeedsToFuzzer(f, 10) + + f.Fuzz(func(t *testing.T, seed int64) { + rand.Seed(seed) + + _, babylonChain, czChain, zcKeeper := SetupTest(t) + + ctx := babylonChain.GetContext() + hooks := zcKeeper.Hooks() + + // invoke the hook a random number of times to simulate a random number of blocks + numHeaders := datagen.RandomInt(100) + 1 + numForkHeaders := datagen.RandomInt(10) + 1 + SimulateHeadersAndForksViaHook(ctx, hooks, czChain.ChainID, numHeaders, numForkHeaders) + + // check if the chain info of is recorded or not + resp, err := zcKeeper.ChainInfo(ctx, &zctypes.QueryChainInfoRequest{ChainId: czChain.ChainID}) + require.NoError(t, err) + chainInfo := resp.ChainInfo + require.Equal(t, numHeaders-1, chainInfo.LatestHeader.Height) + require.Equal(t, numForkHeaders, uint64(len(chainInfo.LatestForks.Headers))) + }) +} + func FuzzFinalizedChainInfo(f *testing.F) { datagen.AddRandomSeedsToFuzzer(f, 10) diff --git a/x/zoneconcierge/types/query.pb.go b/x/zoneconcierge/types/query.pb.go index 25bf4b9cb..98e3fe232 100644 --- a/x/zoneconcierge/types/query.pb.go +++ b/x/zoneconcierge/types/query.pb.go @@ -199,6 +199,97 @@ func (m *QueryChainListResponse) GetChainIds() []string { return nil } +// QueryChainInfoRequest is request type for the Query/ChainInfo RPC method. +type QueryChainInfoRequest struct { + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` +} + +func (m *QueryChainInfoRequest) Reset() { *m = QueryChainInfoRequest{} } +func (m *QueryChainInfoRequest) String() string { return proto.CompactTextString(m) } +func (*QueryChainInfoRequest) ProtoMessage() {} +func (*QueryChainInfoRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2caab7ee15063236, []int{4} +} +func (m *QueryChainInfoRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryChainInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryChainInfoRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryChainInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryChainInfoRequest.Merge(m, src) +} +func (m *QueryChainInfoRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryChainInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryChainInfoRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryChainInfoRequest proto.InternalMessageInfo + +func (m *QueryChainInfoRequest) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" +} + +// QueryChainInfoResponse is response type for the Query/ChainInfo RPC method. +type QueryChainInfoResponse struct { + // chain_info is the info of the CZ + ChainInfo *ChainInfo `protobuf:"bytes,1,opt,name=chain_info,json=chainInfo,proto3" json:"chain_info,omitempty"` +} + +func (m *QueryChainInfoResponse) Reset() { *m = QueryChainInfoResponse{} } +func (m *QueryChainInfoResponse) String() string { return proto.CompactTextString(m) } +func (*QueryChainInfoResponse) ProtoMessage() {} +func (*QueryChainInfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2caab7ee15063236, []int{5} +} +func (m *QueryChainInfoResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryChainInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryChainInfoResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryChainInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryChainInfoResponse.Merge(m, src) +} +func (m *QueryChainInfoResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryChainInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryChainInfoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryChainInfoResponse proto.InternalMessageInfo + +func (m *QueryChainInfoResponse) GetChainInfo() *ChainInfo { + if m != nil { + return m.ChainInfo + } + return nil +} + // QueryFinalizedChainInfoRequest is request type for the Query/FinalizedChainInfo RPC method. type QueryFinalizedChainInfoRequest struct { ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` @@ -208,7 +299,7 @@ func (m *QueryFinalizedChainInfoRequest) Reset() { *m = QueryFinalizedCh func (m *QueryFinalizedChainInfoRequest) String() string { return proto.CompactTextString(m) } func (*QueryFinalizedChainInfoRequest) ProtoMessage() {} func (*QueryFinalizedChainInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2caab7ee15063236, []int{4} + return fileDescriptor_2caab7ee15063236, []int{6} } func (m *QueryFinalizedChainInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -266,7 +357,7 @@ func (m *QueryFinalizedChainInfoResponse) Reset() { *m = QueryFinalizedC func (m *QueryFinalizedChainInfoResponse) String() string { return proto.CompactTextString(m) } func (*QueryFinalizedChainInfoResponse) ProtoMessage() {} func (*QueryFinalizedChainInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2caab7ee15063236, []int{5} + return fileDescriptor_2caab7ee15063236, []int{7} } func (m *QueryFinalizedChainInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -349,6 +440,8 @@ func init() { proto.RegisterType((*QueryParamsResponse)(nil), "babylon.zoneconcierge.v1.QueryParamsResponse") proto.RegisterType((*QueryChainListRequest)(nil), "babylon.zoneconcierge.v1.QueryChainListRequest") proto.RegisterType((*QueryChainListResponse)(nil), "babylon.zoneconcierge.v1.QueryChainListResponse") + proto.RegisterType((*QueryChainInfoRequest)(nil), "babylon.zoneconcierge.v1.QueryChainInfoRequest") + proto.RegisterType((*QueryChainInfoResponse)(nil), "babylon.zoneconcierge.v1.QueryChainInfoResponse") proto.RegisterType((*QueryFinalizedChainInfoRequest)(nil), "babylon.zoneconcierge.v1.QueryFinalizedChainInfoRequest") proto.RegisterType((*QueryFinalizedChainInfoResponse)(nil), "babylon.zoneconcierge.v1.QueryFinalizedChainInfoResponse") } @@ -356,54 +449,58 @@ func init() { func init() { proto.RegisterFile("babylon/zoneconcierge/query.proto", fileDescriptor_2caab7ee15063236) } var fileDescriptor_2caab7ee15063236 = []byte{ - // 744 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0x41, 0x4f, 0x13, 0x41, - 0x14, 0xc7, 0xbb, 0x50, 0x0a, 0x1d, 0x13, 0x0d, 0x43, 0xd1, 0x52, 0x74, 0xc1, 0x1a, 0x23, 0x12, - 0xdc, 0xb5, 0x18, 0x12, 0x89, 0x89, 0x87, 0x56, 0x34, 0x0d, 0x24, 0xe0, 0x02, 0x31, 0x7a, 0x69, - 0x76, 0xb7, 0xd3, 0xed, 0x84, 0x76, 0x66, 0xe9, 0x4c, 0x9b, 0x16, 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, 0xf3, 0xe8, 0x92, 0xd9, - 0x61, 0x53, 0x66, 0x97, 0x3f, 0xfe, 0xf8, 0xfb, 0x79, 0x64, 0x09, 0x2f, 0x9a, 0x4a, 0x06, 0x8d, - 0x69, 0xfe, 0xef, 0x5d, 0xc0, 0xdf, 0x34, 0x94, 0xec, 0x0e, 0x17, 0x36, 0x2f, 0x30, 0x1c, 0x9c, - 0xcf, 0xcc, 0xe3, 0xcb, 0x0b, 0xae, 0x52, 0x24, 0xc4, 0x04, 0xfe, 0xa9, 0x21, 0x7c, 0x76, 0x18, - 0xf1, 0xd3, 0x0b, 0xcc, 0x87, 0x4e, 0x7f, 0x66, 0xf5, 0x0a, 0x4a, 0x55, 0xff, 0x3a, 0xd4, 0xbf, - 0x86, 0x0b, 0x97, 0xa9, 0xff, 0xbc, 0x37, 0xc2, 0x7c, 0x1f, 0x3d, 0x3c, 0x1f, 0xf2, 0x9b, 0x87, - 0xc7, 0xba, 0x76, 0x74, 0xac, 0x6b, 0x7f, 0x8e, 0x75, 0xed, 0xd3, 0x89, 0x1e, 0x3b, 0x3a, 0xd1, - 0x63, 0xbf, 0x4e, 0xf4, 0xd8, 0xbb, 0x15, 0x8f, 0xca, 0x6a, 0xd3, 0x31, 0x5c, 0x5e, 0x3f, 0xdf, - 0xa8, 0x3d, 0x60, 0x05, 0xe3, 0xe7, 0x24, 0xe0, 0xf1, 0x7e, 0xf2, 0x2f, 0x00, 0x00, 0xff, 0xff, - 0x2d, 0x51, 0xdb, 0x88, 0x56, 0x07, 0x00, 0x00, + // 802 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0x5f, 0x4b, 0x2b, 0x47, + 0x14, 0xcf, 0xfa, 0x27, 0x9a, 0x29, 0xb4, 0x38, 0xc6, 0x36, 0xc6, 0x76, 0xb5, 0x5b, 0x4a, 0xad, + 0xd8, 0xdd, 0x26, 0x45, 0xa8, 0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, 0xc7, + 0x0f, 0x44, 0xa3, 0xe3, 0x9a, 0x1e, 0x6b, 0xdd, 0x2f, 0xd4, 0x1b, 0x93, 0x82, 0x95, 0xe1, 0xa6, + 0xe1, 0x2f, 0xf0, 0x9b, 0x37, 0x01, 0x00, 0x00, 0xff, 0xff, 0xaa, 0x4c, 0x87, 0xfe, 0x9c, 0x08, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -420,7 +517,11 @@ const _ = grpc.SupportPackageIsVersion4 type QueryClient interface { // Parameters queries the parameters of the module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // ChainList queries the list of chains that checkpoint to Babylon ChainList(ctx context.Context, in *QueryChainListRequest, opts ...grpc.CallOption) (*QueryChainListResponse, error) + // ChainInfo queries the latest info of a chain in Babylon's view + ChainInfo(ctx context.Context, in *QueryChainInfoRequest, opts ...grpc.CallOption) (*QueryChainInfoResponse, error) + // FinalizedChainInfo queries the BTC-finalised info of a chain, with proofs FinalizedChainInfo(ctx context.Context, in *QueryFinalizedChainInfoRequest, opts ...grpc.CallOption) (*QueryFinalizedChainInfoResponse, error) } @@ -450,6 +551,15 @@ func (c *queryClient) ChainList(ctx context.Context, in *QueryChainListRequest, return out, nil } +func (c *queryClient) ChainInfo(ctx context.Context, in *QueryChainInfoRequest, opts ...grpc.CallOption) (*QueryChainInfoResponse, error) { + out := new(QueryChainInfoResponse) + err := c.cc.Invoke(ctx, "/babylon.zoneconcierge.v1.Query/ChainInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) FinalizedChainInfo(ctx context.Context, in *QueryFinalizedChainInfoRequest, opts ...grpc.CallOption) (*QueryFinalizedChainInfoResponse, error) { out := new(QueryFinalizedChainInfoResponse) err := c.cc.Invoke(ctx, "/babylon.zoneconcierge.v1.Query/FinalizedChainInfo", in, out, opts...) @@ -463,7 +573,11 @@ func (c *queryClient) FinalizedChainInfo(ctx context.Context, in *QueryFinalized type QueryServer interface { // Parameters queries the parameters of the module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // ChainList queries the list of chains that checkpoint to Babylon ChainList(context.Context, *QueryChainListRequest) (*QueryChainListResponse, error) + // ChainInfo queries the latest info of a chain in Babylon's view + ChainInfo(context.Context, *QueryChainInfoRequest) (*QueryChainInfoResponse, error) + // FinalizedChainInfo queries the BTC-finalised info of a chain, with proofs FinalizedChainInfo(context.Context, *QueryFinalizedChainInfoRequest) (*QueryFinalizedChainInfoResponse, error) } @@ -477,6 +591,9 @@ func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsReq func (*UnimplementedQueryServer) ChainList(ctx context.Context, req *QueryChainListRequest) (*QueryChainListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ChainList not implemented") } +func (*UnimplementedQueryServer) ChainInfo(ctx context.Context, req *QueryChainInfoRequest) (*QueryChainInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChainInfo not implemented") +} func (*UnimplementedQueryServer) FinalizedChainInfo(ctx context.Context, req *QueryFinalizedChainInfoRequest) (*QueryFinalizedChainInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method FinalizedChainInfo not implemented") } @@ -521,6 +638,24 @@ func _Query_ChainList_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } +func _Query_ChainInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryChainInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ChainInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/babylon.zoneconcierge.v1.Query/ChainInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ChainInfo(ctx, req.(*QueryChainInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_FinalizedChainInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryFinalizedChainInfoRequest) if err := dec(in); err != nil { @@ -551,6 +686,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "ChainList", Handler: _Query_ChainList_Handler, }, + { + MethodName: "ChainInfo", + Handler: _Query_ChainInfo_Handler, + }, { MethodName: "FinalizedChainInfo", Handler: _Query_FinalizedChainInfo_Handler, @@ -671,6 +810,71 @@ func (m *QueryChainListResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *QueryChainInfoRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryChainInfoRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryChainInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryChainInfoResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryChainInfoResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryChainInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ChainInfo != nil { + { + size, err := m.ChainInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *QueryFinalizedChainInfoRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -863,6 +1067,32 @@ func (m *QueryChainListResponse) Size() (n int) { return n } +func (m *QueryChainInfoRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryChainInfoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ChainInfo != nil { + l = m.ChainInfo.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func (m *QueryFinalizedChainInfoRequest) Size() (n int) { if m == nil { return 0 @@ -1184,6 +1414,174 @@ func (m *QueryChainListResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryChainInfoRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryChainInfoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryChainInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryChainInfoResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryChainInfoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryChainInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ChainInfo == nil { + m.ChainInfo = &ChainInfo{} + } + if err := m.ChainInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *QueryFinalizedChainInfoRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/zoneconcierge/types/query.pb.gw.go b/x/zoneconcierge/types/query.pb.gw.go index 6e4e998fa..78732b2fd 100644 --- a/x/zoneconcierge/types/query.pb.gw.go +++ b/x/zoneconcierge/types/query.pb.gw.go @@ -69,6 +69,60 @@ func local_request_Query_ChainList_0(ctx context.Context, marshaler runtime.Mars } +func request_Query_ChainInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryChainInfoRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["chain_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") + } + + protoReq.ChainId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) + } + + msg, err := client.ChainInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ChainInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryChainInfoRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["chain_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") + } + + protoReq.ChainId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) + } + + msg, err := server.ChainInfo(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_FinalizedChainInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryFinalizedChainInfoRequest var metadata runtime.ServerMetadata @@ -175,6 +229,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_ChainInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_ChainInfo_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ChainInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_FinalizedChainInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -279,6 +356,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_ChainInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_ChainInfo_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ChainInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_FinalizedChainInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -307,6 +404,8 @@ var ( pattern_Query_ChainList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"babylonchain", "babylon", "zoneconcierge", "chains"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ChainInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"babylonchain", "babylon", "zoneconcierge", "chain_info", "chain_id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_FinalizedChainInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"babylonchain", "babylon", "zoneconcierge", "finalized_chain_info", "chain_id"}, "", runtime.AssumeColonVerbOpt(false))) ) @@ -315,5 +414,7 @@ var ( forward_Query_ChainList_0 = runtime.ForwardResponseMessage + forward_Query_ChainInfo_0 = runtime.ForwardResponseMessage + forward_Query_FinalizedChainInfo_0 = runtime.ForwardResponseMessage )