diff --git a/proto/spec/query.proto b/proto/spec/query.proto index 59b82f4200..5ad0b22ca4 100644 --- a/proto/spec/query.proto +++ b/proto/spec/query.proto @@ -69,7 +69,13 @@ message QueryShowAllChainsRequest { } message QueryShowAllChainsResponse { - repeated string chainNames = 1; + reserved 1; + repeated showAllChainsInfoStruct chainInfoList = 2; +} +message showAllChainsInfoStruct { + string chainName = 1; + string chainID = 2; + repeated string enabledApiInterfaces = 3; } message QueryShowChainInfoRequest { diff --git a/x/spec/keeper/grpc_query_show_all_chains.go b/x/spec/keeper/grpc_query_show_all_chains.go index d758bdcebb..7538c4a169 100644 --- a/x/spec/keeper/grpc_query_show_all_chains.go +++ b/x/spec/keeper/grpc_query_show_all_chains.go @@ -10,20 +10,43 @@ import ( ) func (k Keeper) ShowAllChains(goCtx context.Context, req *types.QueryShowAllChainsRequest) (*types.QueryShowAllChainsResponse, error) { + var chainInfoList []*types.ShowAllChainsInfoStruct + ctx := sdk.UnwrapSDKContext(goCtx) + if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } - ctx := sdk.UnwrapSDKContext(goCtx) - var names []string - // get all spec allSpec := k.GetAllSpec(ctx) - // iterate over specs and extract the chain's name + // iterate over specs and extract the chains' info for _, spec := range allSpec { - names = append(names, spec.GetName()) + // get the spec's name and chain ID + chainName := spec.GetName() + chainId := spec.GetIndex() + + // get the spec's expected interfaces + expectedInterfaces := k.GetExpectedInterfacesForSpec(ctx, chainId) + + // copy the expectedInterfaces's keys (which are the interface names) to a string list + apiInterfacesNames := getInterfacesNamesFromMap(expectedInterfaces) + + // create a chainInfoEntry which includes the chain's name, ID and enabled interfaces + chainInfoEntry := types.ShowAllChainsInfoStruct{ChainName: chainName, ChainID: chainId, EnabledApiInterfaces: apiInterfacesNames} + + // add the chainInfoEntry to the chainInfoList + chainInfoList = append(chainInfoList, &chainInfoEntry) + } + + return &types.QueryShowAllChainsResponse{ChainInfoList: chainInfoList}, nil +} + +func getInterfacesNamesFromMap(expectedInterfaces map[string]bool) []string { + var apiInterfacesNames []string + for apiInterfacesName := range expectedInterfaces { + apiInterfacesNames = append(apiInterfacesNames, apiInterfacesName) } - return &types.QueryShowAllChainsResponse{ChainNames: names}, nil + return apiInterfacesNames } diff --git a/x/spec/types/query.pb.go b/x/spec/types/query.pb.go index 722b8bdccf..9f07dabe71 100644 --- a/x/spec/types/query.pb.go +++ b/x/spec/types/query.pb.go @@ -334,7 +334,7 @@ func (m *QueryShowAllChainsRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryShowAllChainsRequest proto.InternalMessageInfo type QueryShowAllChainsResponse struct { - ChainNames []string `protobuf:"bytes,1,rep,name=chainNames,proto3" json:"chainNames,omitempty"` + ChainInfoList []*ShowAllChainsInfoStruct `protobuf:"bytes,2,rep,name=chainInfoList,proto3" json:"chainInfoList,omitempty"` } func (m *QueryShowAllChainsResponse) Reset() { *m = QueryShowAllChainsResponse{} } @@ -370,9 +370,69 @@ func (m *QueryShowAllChainsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryShowAllChainsResponse proto.InternalMessageInfo -func (m *QueryShowAllChainsResponse) GetChainNames() []string { +func (m *QueryShowAllChainsResponse) GetChainInfoList() []*ShowAllChainsInfoStruct { if m != nil { - return m.ChainNames + return m.ChainInfoList + } + return nil +} + +type ShowAllChainsInfoStruct struct { + ChainName string `protobuf:"bytes,1,opt,name=chainName,proto3" json:"chainName,omitempty"` + ChainID string `protobuf:"bytes,2,opt,name=chainID,proto3" json:"chainID,omitempty"` + EnabledApiInterfaces []string `protobuf:"bytes,3,rep,name=enabledApiInterfaces,proto3" json:"enabledApiInterfaces,omitempty"` +} + +func (m *ShowAllChainsInfoStruct) Reset() { *m = ShowAllChainsInfoStruct{} } +func (m *ShowAllChainsInfoStruct) String() string { return proto.CompactTextString(m) } +func (*ShowAllChainsInfoStruct) ProtoMessage() {} +func (*ShowAllChainsInfoStruct) Descriptor() ([]byte, []int) { + return fileDescriptor_6723cd4498ae5af7, []int{8} +} +func (m *ShowAllChainsInfoStruct) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ShowAllChainsInfoStruct) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ShowAllChainsInfoStruct.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 *ShowAllChainsInfoStruct) XXX_Merge(src proto.Message) { + xxx_messageInfo_ShowAllChainsInfoStruct.Merge(m, src) +} +func (m *ShowAllChainsInfoStruct) XXX_Size() int { + return m.Size() +} +func (m *ShowAllChainsInfoStruct) XXX_DiscardUnknown() { + xxx_messageInfo_ShowAllChainsInfoStruct.DiscardUnknown(m) +} + +var xxx_messageInfo_ShowAllChainsInfoStruct proto.InternalMessageInfo + +func (m *ShowAllChainsInfoStruct) GetChainName() string { + if m != nil { + return m.ChainName + } + return "" +} + +func (m *ShowAllChainsInfoStruct) GetChainID() string { + if m != nil { + return m.ChainID + } + return "" +} + +func (m *ShowAllChainsInfoStruct) GetEnabledApiInterfaces() []string { + if m != nil { + return m.EnabledApiInterfaces } return nil } @@ -385,7 +445,7 @@ func (m *QueryShowChainInfoRequest) Reset() { *m = QueryShowChainInfoReq func (m *QueryShowChainInfoRequest) String() string { return proto.CompactTextString(m) } func (*QueryShowChainInfoRequest) ProtoMessage() {} func (*QueryShowChainInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_6723cd4498ae5af7, []int{8} + return fileDescriptor_6723cd4498ae5af7, []int{9} } func (m *QueryShowChainInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -430,7 +490,7 @@ func (m *ApiList) Reset() { *m = ApiList{} } func (m *ApiList) String() string { return proto.CompactTextString(m) } func (*ApiList) ProtoMessage() {} func (*ApiList) Descriptor() ([]byte, []int) { - return fileDescriptor_6723cd4498ae5af7, []int{9} + return fileDescriptor_6723cd4498ae5af7, []int{10} } func (m *ApiList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -483,7 +543,7 @@ func (m *QueryShowChainInfoResponse) Reset() { *m = QueryShowChainInfoRe func (m *QueryShowChainInfoResponse) String() string { return proto.CompactTextString(m) } func (*QueryShowChainInfoResponse) ProtoMessage() {} func (*QueryShowChainInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_6723cd4498ae5af7, []int{10} + return fileDescriptor_6723cd4498ae5af7, []int{11} } func (m *QueryShowChainInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -542,6 +602,7 @@ func init() { proto.RegisterType((*QueryAllSpecResponse)(nil), "lavanet.lava.spec.QueryAllSpecResponse") proto.RegisterType((*QueryShowAllChainsRequest)(nil), "lavanet.lava.spec.QueryShowAllChainsRequest") proto.RegisterType((*QueryShowAllChainsResponse)(nil), "lavanet.lava.spec.QueryShowAllChainsResponse") + proto.RegisterType((*ShowAllChainsInfoStruct)(nil), "lavanet.lava.spec.showAllChainsInfoStruct") proto.RegisterType((*QueryShowChainInfoRequest)(nil), "lavanet.lava.spec.QueryShowChainInfoRequest") proto.RegisterType((*ApiList)(nil), "lavanet.lava.spec.apiList") proto.RegisterType((*QueryShowChainInfoResponse)(nil), "lavanet.lava.spec.QueryShowChainInfoResponse") @@ -550,51 +611,55 @@ func init() { func init() { proto.RegisterFile("spec/query.proto", fileDescriptor_6723cd4498ae5af7) } var fileDescriptor_6723cd4498ae5af7 = []byte{ - // 700 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x95, 0xdf, 0x4e, 0xd4, 0x4e, - 0x14, 0xc7, 0xb7, 0xfc, 0xdb, 0x30, 0xbf, 0x90, 0x9f, 0x8c, 0x24, 0x74, 0x0b, 0x29, 0x32, 0x22, - 0x28, 0xd1, 0x56, 0x30, 0xd1, 0x98, 0x18, 0x93, 0x45, 0x23, 0x21, 0x51, 0x82, 0xe5,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c, 0x44, 0x45, 0x3c, 0x4d, 0xba, 0xbf, 0x8d, 0xa3, 0x68, 0xdb, 0x57, 0x20, 0xdf, 0x34, 0x5a, - 0x7a, 0xa5, 0xaf, 0x46, 0xbb, 0x3c, 0x84, 0x57, 0xa3, 0xf5, 0xcc, 0x09, 0x7a, 0x2c, 0xd1, 0x1e, - 0x42, 0xa7, 0x0c, 0x4d, 0x62, 0x6d, 0x87, 0xf1, 0x0e, 0x75, 0x0f, 0xd3, 0x61, 0x3e, 0x5a, 0x79, - 0x7e, 0x72, 0x66, 0x1b, 0xa7, 0x67, 0xb6, 0xf1, 0xe7, 0xcc, 0x36, 0x3e, 0x9d, 0xdb, 0x95, 0xd3, - 0x73, 0xbb, 0xf2, 0xeb, 0xdc, 0xae, 0x6c, 0xcd, 0x05, 0x61, 0xd2, 0xec, 0x34, 0x1c, 0x9f, 0xb6, - 0xf2, 0x9e, 0x1f, 0x94, 0x6b, 0x72, 0xc0, 0x08, 0x6f, 0x8c, 0xc8, 0x1f, 0xa0, 0x47, 0xff, 0x02, - 0x00, 0x00, 0xff, 0xff, 0x5e, 0x52, 0x59, 0x67, 0x2b, 0x07, 0x00, 0x00, + // 762 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x95, 0xd1, 0x4e, 0x13, 0x4d, + 0x14, 0xc7, 0xbb, 0x6d, 0x81, 0x8f, 0xf9, 0x42, 0x84, 0xb1, 0x09, 0xed, 0x42, 0x0a, 0x8c, 0x08, + 0x48, 0x74, 0x57, 0x30, 0xd1, 0x78, 0x63, 0x52, 0x30, 0x12, 0x8c, 0x12, 0x2c, 0x77, 0x24, 0x86, + 0x4c, 0xd7, 0xa1, 0xdd, 0x64, 0xbb, 0xb3, 0x74, 0xa6, 0x20, 0x12, 0x6e, 0x48, 0xbc, 0x37, 0x7a, + 0xe3, 0x03, 0xf8, 0x04, 0xbe, 0x84, 0x5c, 0x92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93, 0x8e, 0x71, 0x65, 0x78, + 0x90, 0x29, 0xc0, 0x28, 0xe1, 0xf1, 0x14, 0x0c, 0xfc, 0xd5, 0x40, 0x23, 0xb1, 0x0b, 0x8c, 0xef, + 0xa7, 0x69, 0x27, 0x0d, 0x01, 0xf3, 0xc1, 0x0d, 0xbd, 0x35, 0xcf, 0x22, 0xf0, 0xcc, 0x62, 0x92, + 0xc4, 0xd3, 0xe0, 0x07, 0x3b, 0xd4, 0xf3, 0x76, 0x1c, 0x05, 0xf2, 0x4d, 0xa3, 0x75, 0x8f, 0x74, + 0x7f, 0xb4, 0xab, 0x97, 0xb0, 0x3f, 0x5a, 0xcf, 0x3d, 0x21, 0x8f, 0x01, 0xed, 0x21, 0xb6, 0xd2, + 0xd0, 0x00, 0x6b, 0xc7, 0xf5, 0x77, 0xb9, 0x7d, 0xd4, 0xbd, 0xcc, 0xc7, 0x2b, 0xcf, 0x4e, 0xcf, + 0xcb, 0xc6, 0xd9, 0x79, 0xd9, 0xf8, 0x73, 0x5e, 0x36, 0x3e, 0x5d, 0x94, 0x33, 0x67, 0x17, 0xe5, + 0xcc, 0xaf, 0x8b, 0x72, 0x66, 0x7b, 0xb6, 0xee, 0xca, 0x46, 0xbb, 0x66, 0x39, 0xbc, 0x19, 0xd7, + 0x7c, 0xaf, 0x54, 0xe5, 0x61, 0xc0, 0x44, 0x6d, 0x10, 0xfe, 0x40, 0x1f, 0xfd, 0x0b, 0x00, 0x00, + 0xff, 0xff, 0x2c, 0xe5, 0x9f, 0x3d, 0xeb, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1077,18 +1142,69 @@ func (m *QueryShowAllChainsResponse) MarshalToSizedBuffer(dAtA []byte) (int, err _ = i var l int _ = l - if len(m.ChainNames) > 0 { - for iNdEx := len(m.ChainNames) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ChainNames[iNdEx]) - copy(dAtA[i:], m.ChainNames[iNdEx]) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainNames[iNdEx]))) + if len(m.ChainInfoList) > 0 { + for iNdEx := len(m.ChainInfoList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ChainInfoList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 } } return len(dAtA) - i, nil } +func (m *ShowAllChainsInfoStruct) 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 *ShowAllChainsInfoStruct) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ShowAllChainsInfoStruct) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.EnabledApiInterfaces) > 0 { + for iNdEx := len(m.EnabledApiInterfaces) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.EnabledApiInterfaces[iNdEx]) + copy(dAtA[i:], m.EnabledApiInterfaces[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.EnabledApiInterfaces[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + 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] = 0x12 + } + if len(m.ChainName) > 0 { + i -= len(m.ChainName) + copy(dAtA[i:], m.ChainName) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *QueryShowChainInfoRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1313,8 +1429,31 @@ func (m *QueryShowAllChainsResponse) Size() (n int) { } var l int _ = l - if len(m.ChainNames) > 0 { - for _, s := range m.ChainNames { + if len(m.ChainInfoList) > 0 { + for _, e := range m.ChainInfoList { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *ShowAllChainsInfoStruct) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChainName) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.ChainID) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if len(m.EnabledApiInterfaces) > 0 { + for _, s := range m.EnabledApiInterfaces { l = len(s) n += 1 + l + sovQuery(uint64(l)) } @@ -1968,9 +2107,157 @@ func (m *QueryShowAllChainsResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: QueryShowAllChainsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainInfoList", 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 + } + m.ChainInfoList = append(m.ChainInfoList, &ShowAllChainsInfoStruct{}) + if err := m.ChainInfoList[len(m.ChainInfoList)-1].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 *ShowAllChainsInfoStruct) 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: showAllChainsInfoStruct: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: showAllChainsInfoStruct: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainNames", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainName", 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.ChainName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EnabledApiInterfaces", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1998,7 +2285,7 @@ func (m *QueryShowAllChainsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainNames = append(m.ChainNames, string(dAtA[iNdEx:postIndex])) + m.EnabledApiInterfaces = append(m.EnabledApiInterfaces, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex