From e82f809ee3fb5752d98161ca39e79c4fca5ecee3 Mon Sep 17 00:00:00 2001 From: Federico Kunze Date: Thu, 18 Jun 2020 12:27:53 +0200 Subject: [PATCH] x/ibc: gRPC query service --- x/bank/types/query.pb.go | 7 +- x/ibc/03-connection/keeper/grpc_query.go | 99 ++ x/ibc/03-connection/module.go | 8 + x/ibc/03-connection/types/querier.go | 47 +- x/ibc/03-connection/types/types.pb.go | 1353 ++++++++++++++++++++-- x/ibc/03-connection/types/types.proto | 51 +- x/ibc/module.go | 10 +- 7 files changed, 1439 insertions(+), 136 deletions(-) create mode 100644 x/ibc/03-connection/keeper/grpc_query.go diff --git a/x/bank/types/query.pb.go b/x/bank/types/query.pb.go index bd25ff3fb91a..149e2cdb1173 100644 --- a/x/bank/types/query.pb.go +++ b/x/bank/types/query.pb.go @@ -9,7 +9,6 @@ import ( github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -461,10 +460,10 @@ type QueryClient interface { } type queryClient struct { - cc grpc1.ClientConn + cc *grpc.ClientConn } -func NewQueryClient(cc grpc1.ClientConn) QueryClient { +func NewQueryClient(cc *grpc.ClientConn) QueryClient { return &queryClient{cc} } @@ -533,7 +532,7 @@ func (*UnimplementedQueryServer) SupplyOf(ctx context.Context, req *QuerySupplyO return nil, status.Errorf(codes.Unimplemented, "method SupplyOf not implemented") } -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { +func RegisterQueryServer(s *grpc.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) } diff --git a/x/ibc/03-connection/keeper/grpc_query.go b/x/ibc/03-connection/keeper/grpc_query.go new file mode 100644 index 000000000000..a315fa6a4f1a --- /dev/null +++ b/x/ibc/03-connection/keeper/grpc_query.go @@ -0,0 +1,99 @@ +package keeper + +import ( + "context" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/x/ibc/03-connection/types" + host "github.com/cosmos/cosmos-sdk/x/ibc/24-host" +) + +var _ types.QueryServer = Keeper{} + +// Connection implements the Query/Connection gRPC method +func (q Keeper) Connection(c context.Context, req *types.QueryConnectionRequest) (*types.QueryConnectionResponse, error) { + if req == nil { + return nil, status.Errorf(codes.InvalidArgument, "empty request") + } + + if err := host.ConnectionIdentifierValidator(req.ConnectionID); err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + ctx := sdk.UnwrapSDKContext(c) + connection, found := q.GetConnection(ctx, req.Address, req.ConnectionID) + if !found { + return nil, status.Error( + codes.NotFound, + sdkerrors.Wrap(types.ErrConnectionNotFound, req.ConnectionID).Error(), + ) + } + + return &types.QueryConnectionResponse{Connection: &balance}, nil +} + +// ClientConnections implements the Query/ClientConnections gRPC method +func (q Keeper) ClientConnections(c context.Context, req *types.QueryClientConnectionsRequest) (*types.QueryClientConnectionsResponse, error) { + if req == nil { + return nil, status.Errorf(codes.InvalidArgument, "empty request") + } + + if err := host.ClientIdentifierValidator(req.ClientID); err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + ctx := sdk.UnwrapSDKContext(c) + clientConnectionPaths, found := q.GetClientConnectionPaths(ctx, req.ClientID) + if !found { + return nil, status.Error( + codes.NotFound, + sdkerrors.Wrap(types.ErrClientConnectionPathsNotFound, req.ClientID).Error(), + ) + } + + return &types.QueryConnectionResponse{Connection: &balance}, nil +} + +// // AllBalances implements the Query/AllBalances gRPC method +// func (q Keeper) AllBalances(c context.Context, req *types.QueryAllBalancesRequest) (*types.QueryAllBalancesResponse, error) { +// if req == nil { +// return nil, status.Errorf(codes.InvalidArgument, "empty request") +// } + +// if len(req.Address) == 0 { +// return nil, status.Errorf(codes.InvalidArgument, "invalid address") +// } + +// ctx := sdk.UnwrapSDKContext(c) +// balances := q.GetAllBalances(ctx, req.Address) + +// return &types.QueryAllBalancesResponse{Balances: balances}, nil +// } + +// // TotalSupply implements the Query/TotalSupply gRPC method +// func (q Keeper) TotalSupply(c context.Context, _ *types.QueryTotalSupplyRequest) (*types.QueryTotalSupplyResponse, error) { +// ctx := sdk.UnwrapSDKContext(c) +// totalSupply := q.GetSupply(ctx).GetTotal() + +// return &types.QueryTotalSupplyResponse{Supply: totalSupply}, nil +// } + +// // SupplyOf implements the Query/SupplyOf gRPC method +// func (q Keeper) SupplyOf(c context.Context, req *types.QuerySupplyOfRequest) (*types.QuerySupplyOfResponse, error) { +// if req == nil { +// return nil, status.Errorf(codes.InvalidArgument, "empty request") +// } + +// if req.Denom == "" { +// return nil, status.Errorf(codes.InvalidArgument, "invalid denom") +// } + +// ctx := sdk.UnwrapSDKContext(c) +// supply := q.GetSupply(ctx).GetTotal().AmountOf(req.Denom) + +// return &types.QuerySupplyOfResponse{Amount: supply}, nil +// } diff --git a/x/ibc/03-connection/module.go b/x/ibc/03-connection/module.go index 8275ad9572cd..c44896db050f 100644 --- a/x/ibc/03-connection/module.go +++ b/x/ibc/03-connection/module.go @@ -3,10 +3,13 @@ package connection import ( "github.com/gorilla/mux" "github.com/spf13/cobra" + "google.golang.org/grpc" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/x/ibc/03-connection/client/cli" "github.com/cosmos/cosmos-sdk/x/ibc/03-connection/client/rest" + "github.com/cosmos/cosmos-sdk/x/ibc/03-connection/keeper" + "github.com/cosmos/cosmos-sdk/x/ibc/03-connection/types" ) // Name returns the IBC connection ICS name @@ -28,3 +31,8 @@ func GetQueryCmd(clientCtx client.Context) *cobra.Command { func RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) { rest.RegisterRoutes(clientCtx, rtr) } + +// RegisterQueryService registers the gRPC query service for IBC connections. +func RegisterQueryService(server grpc.Server, k keeper.Keeper) { + types.RegisterQueryServer(server, k) +} diff --git a/x/ibc/03-connection/types/querier.go b/x/ibc/03-connection/types/querier.go index 7b52eef12edb..7070f0b8b0db 100644 --- a/x/ibc/03-connection/types/querier.go +++ b/x/ibc/03-connection/types/querier.go @@ -16,20 +16,11 @@ const ( QueryAllClientConnections = "all_client_connections" ) -// ConnectionResponse defines the client query response for a connection which -// also includes a proof and the height from which the proof was retrieved. -type ConnectionResponse struct { - Connection ConnectionEnd `json:"connection" yaml:"connection"` - Proof commitmenttypes.MerkleProof `json:"proof,omitempty" yaml:"proof,omitempty"` - ProofPath commitmenttypes.MerklePath `json:"proof_path,omitempty" yaml:"proof_path,omitempty"` - ProofHeight uint64 `json:"proof_height,omitempty" yaml:"proof_height,omitempty"` -} - -// NewConnectionResponse creates a new ConnectionResponse instance -func NewConnectionResponse( +// NewQueryConnectionResponse creates a new QueryConnectionResponse instance +func NewQueryConnectionResponse( connectionID string, connection ConnectionEnd, proof *merkle.Proof, height int64, -) ConnectionResponse { - return ConnectionResponse{ +) *QueryConnectionResponse { + return &QueryConnectionResponse{ Connection: connection, Proof: commitmenttypes.MerkleProof{Proof: proof}, ProofPath: commitmenttypes.NewMerklePath(strings.Split(host.ConnectionPath(connectionID), "/")), @@ -52,21 +43,11 @@ func NewQueryAllConnectionsParams(page, limit int) QueryAllConnectionsParams { } } -// ClientConnectionsResponse defines the client query response for a client -// connection paths which also includes a proof and the height from which the -// proof was retrieved. -type ClientConnectionsResponse struct { - ConnectionPaths []string `json:"connection_paths" yaml:"connection_paths"` - Proof commitmenttypes.MerkleProof `json:"proof,omitempty" yaml:"proof,omitempty"` - ProofPath commitmenttypes.MerklePath `json:"proof_path,omitempty" yaml:"proof_path,omitempty"` - ProofHeight uint64 `json:"proof_height,omitempty" yaml:"proof_height,omitempty"` -} - -// NewClientConnectionsResponse creates a new ConnectionPaths instance -func NewClientConnectionsResponse( +// NewQueryClientConnectionsResponse creates a new ConnectionPaths instance +func NewQueryClientConnectionsResponse( clientID string, connectionPaths []string, proof *merkle.Proof, height int64, -) ClientConnectionsResponse { - return ClientConnectionsResponse{ +) *QueryClientConnectionsResponse { + return &QueryClientConnectionsResponse{ ConnectionPaths: connectionPaths, Proof: commitmenttypes.MerkleProof{Proof: proof}, ProofPath: commitmenttypes.NewMerklePath(strings.Split(host.ClientConnectionsPath(clientID), "/")), @@ -74,15 +55,9 @@ func NewClientConnectionsResponse( } } -// QueryClientConnectionsParams defines the params for the following queries: -// - 'custom/ibc/client//connections' -type QueryClientConnectionsParams struct { - ClientID string -} - -// NewQueryClientConnectionsParams creates a new QueryClientConnectionsParams instance -func NewQueryClientConnectionsParams(clientID string) QueryClientConnectionsParams { - return QueryClientConnectionsParams{ +// NewQueryClientConnectionsRequest creates a new QueryClientConnectionsRequest instance +func NewQueryClientConnectionsRequest(clientID string) QueryClientConnectionsRequest { + return QueryClientConnectionsRequest{ ClientID: clientID, } } diff --git a/x/ibc/03-connection/types/types.pb.go b/x/ibc/03-connection/types/types.pb.go index 8e9982d560d8..29ac93cdac3e 100644 --- a/x/ibc/03-connection/types/types.pb.go +++ b/x/ibc/03-connection/types/types.pb.go @@ -4,11 +4,15 @@ package types import ( + context "context" fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/x/ibc/23-commitment/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" @@ -550,6 +554,248 @@ func (m *ClientPaths) GetPaths() []string { return nil } +// QueryConnectionRequest is the request type for the Query/Connection RPC method +type QueryConnectionRequest struct { + // connection unique identifier + ConnectionID string `protobuf:"bytes,1,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty"` +} + +func (m *QueryConnectionRequest) Reset() { *m = QueryConnectionRequest{} } +func (m *QueryConnectionRequest) String() string { return proto.CompactTextString(m) } +func (*QueryConnectionRequest) ProtoMessage() {} +func (*QueryConnectionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_30ee50c03d1fbe43, []int{7} +} +func (m *QueryConnectionRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryConnectionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryConnectionRequest.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 *QueryConnectionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryConnectionRequest.Merge(m, src) +} +func (m *QueryConnectionRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryConnectionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryConnectionRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryConnectionRequest proto.InternalMessageInfo + +func (m *QueryConnectionRequest) GetConnectionID() string { + if m != nil { + return m.ConnectionID + } + return "" +} + +// QueryConnectionResponse is the response type for the Query/Connection RPC method. +// Besides the connection end, it includes a proof and the height from which the +// proof was retrieved. +type QueryConnectionResponse struct { + // connection associated with the request identifier + Connection *ConnectionEnd `protobuf:"bytes,1,opt,name=connection,proto3" json:"connection,omitempty"` + // merkle proof of existence + Proof *types.MerkleProof `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` + // merkle proof path + ProofPath *types.MerklePath `protobuf:"bytes,3,opt,name=proof_path,json=proofPath,proto3" json:"proof_path,omitempty"` + // height at which the proof was retrieved + ProofHeight uint64 `protobuf:"varint,4,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height,omitempty"` +} + +func (m *QueryConnectionResponse) Reset() { *m = QueryConnectionResponse{} } +func (m *QueryConnectionResponse) String() string { return proto.CompactTextString(m) } +func (*QueryConnectionResponse) ProtoMessage() {} +func (*QueryConnectionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_30ee50c03d1fbe43, []int{8} +} +func (m *QueryConnectionResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryConnectionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryConnectionResponse.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 *QueryConnectionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryConnectionResponse.Merge(m, src) +} +func (m *QueryConnectionResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryConnectionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryConnectionResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryConnectionResponse proto.InternalMessageInfo + +func (m *QueryConnectionResponse) GetConnection() *ConnectionEnd { + if m != nil { + return m.Connection + } + return nil +} + +func (m *QueryConnectionResponse) GetProof() *types.MerkleProof { + if m != nil { + return m.Proof + } + return nil +} + +func (m *QueryConnectionResponse) GetProofPath() *types.MerklePath { + if m != nil { + return m.ProofPath + } + return nil +} + +func (m *QueryConnectionResponse) GetProofHeight() uint64 { + if m != nil { + return m.ProofHeight + } + return 0 +} + +// QueryClientConnectionsRequest is the request type for the Query/ClientConnections +// RPC method +type QueryClientConnectionsRequest struct { + // client identifier associated with a connection + ClientID string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` +} + +func (m *QueryClientConnectionsRequest) Reset() { *m = QueryClientConnectionsRequest{} } +func (m *QueryClientConnectionsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryClientConnectionsRequest) ProtoMessage() {} +func (*QueryClientConnectionsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_30ee50c03d1fbe43, []int{9} +} +func (m *QueryClientConnectionsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryClientConnectionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryClientConnectionsRequest.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 *QueryClientConnectionsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryClientConnectionsRequest.Merge(m, src) +} +func (m *QueryClientConnectionsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryClientConnectionsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryClientConnectionsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryClientConnectionsRequest proto.InternalMessageInfo + +func (m *QueryClientConnectionsRequest) GetClientID() string { + if m != nil { + return m.ClientID + } + return "" +} + +// QueryClientConnectionsResponse is the response type for the Query/ClientConnections +// RPC method +type QueryClientConnectionsResponse struct { + // slice of all the connection paths associated with a client. + ConnectionPaths []string `protobuf:"bytes,1,rep,name=connection_paths,json=connectionPaths,proto3" json:"connection_paths,omitempty"` + // merkle proof of existence + Proof *types.MerkleProof `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` + // merkle proof path + ProofPath *types.MerklePath `protobuf:"bytes,3,opt,name=proof_path,json=proofPath,proto3" json:"proof_path,omitempty"` + // height at which the proof was generated + ProofHeight uint64 `protobuf:"varint,4,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height,omitempty"` +} + +func (m *QueryClientConnectionsResponse) Reset() { *m = QueryClientConnectionsResponse{} } +func (m *QueryClientConnectionsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryClientConnectionsResponse) ProtoMessage() {} +func (*QueryClientConnectionsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_30ee50c03d1fbe43, []int{10} +} +func (m *QueryClientConnectionsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryClientConnectionsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryClientConnectionsResponse.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 *QueryClientConnectionsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryClientConnectionsResponse.Merge(m, src) +} +func (m *QueryClientConnectionsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryClientConnectionsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryClientConnectionsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryClientConnectionsResponse proto.InternalMessageInfo + +func (m *QueryClientConnectionsResponse) GetConnectionPaths() []string { + if m != nil { + return m.ConnectionPaths + } + return nil +} + +func (m *QueryClientConnectionsResponse) GetProof() *types.MerkleProof { + if m != nil { + return m.Proof + } + return nil +} + +func (m *QueryClientConnectionsResponse) GetProofPath() *types.MerklePath { + if m != nil { + return m.ProofPath + } + return nil +} + +func (m *QueryClientConnectionsResponse) GetProofHeight() uint64 { + if m != nil { + return m.ProofHeight + } + return 0 +} + func init() { proto.RegisterEnum("cosmos_sdk.x.ibc.connection.v1.State", State_name, State_value) proto.RegisterType((*MsgConnectionOpenInit)(nil), "cosmos_sdk.x.ibc.connection.v1.MsgConnectionOpenInit") @@ -559,6 +805,10 @@ func init() { proto.RegisterType((*ConnectionEnd)(nil), "cosmos_sdk.x.ibc.connection.v1.ConnectionEnd") proto.RegisterType((*Counterparty)(nil), "cosmos_sdk.x.ibc.connection.v1.Counterparty") proto.RegisterType((*ClientPaths)(nil), "cosmos_sdk.x.ibc.connection.v1.ClientPaths") + proto.RegisterType((*QueryConnectionRequest)(nil), "cosmos_sdk.x.ibc.connection.v1.QueryConnectionRequest") + proto.RegisterType((*QueryConnectionResponse)(nil), "cosmos_sdk.x.ibc.connection.v1.QueryConnectionResponse") + proto.RegisterType((*QueryClientConnectionsRequest)(nil), "cosmos_sdk.x.ibc.connection.v1.QueryClientConnectionsRequest") + proto.RegisterType((*QueryClientConnectionsResponse)(nil), "cosmos_sdk.x.ibc.connection.v1.QueryClientConnectionsResponse") } func init() { @@ -566,63 +816,195 @@ func init() { } var fileDescriptor_30ee50c03d1fbe43 = []byte{ - // 889 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x56, 0xbf, 0x6f, 0xdb, 0x46, - 0x14, 0x16, 0x29, 0x4a, 0x96, 0xce, 0x72, 0xa2, 0x30, 0x72, 0x43, 0xb0, 0x05, 0xc9, 0x32, 0x48, - 0x21, 0x14, 0x35, 0x55, 0x3b, 0x45, 0x06, 0x17, 0x1d, 0x24, 0x59, 0x41, 0x59, 0xd4, 0x8a, 0x40, - 0xcb, 0x01, 0x9a, 0x85, 0x90, 0x48, 0x5a, 0x3a, 0xc8, 0x22, 0x05, 0xde, 0x39, 0xb0, 0xf6, 0x0e, - 0x81, 0xa7, 0xae, 0x1d, 0x0c, 0x14, 0xc8, 0xd6, 0x3f, 0xa4, 0xf0, 0x98, 0xb1, 0x13, 0x51, 0xc8, - 0x7b, 0x07, 0x8d, 0x9d, 0x0a, 0xde, 0x51, 0xa4, 0x14, 0xb9, 0x0e, 0x0c, 0x69, 0x28, 0x90, 0x45, - 0xba, 0xf7, 0xeb, 0x7b, 0xf7, 0xde, 0xf7, 0xf8, 0x48, 0xf0, 0xe4, 0xbc, 0x02, 0xbb, 0x56, 0xe5, - 0xeb, 0xa7, 0x3b, 0x96, 0xe7, 0xba, 0x8e, 0x85, 0xa1, 0xe7, 0x56, 0xf0, 0x78, 0xe4, 0x20, 0xfa, - 0xab, 0x8d, 0x7c, 0x0f, 0x7b, 0xbc, 0x64, 0x79, 0x68, 0xe8, 0x21, 0x13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0xf9, 0xb1, 0xd9, 0xcd, 0x92, 0x0f, 0xbf, 0xa7, 0xff, 0x06, 0x00, 0x00, 0xff, - 0xff, 0x9f, 0x6b, 0x1d, 0x24, 0x90, 0x0a, 0x00, 0x00, + // 1086 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x57, 0xcd, 0x6f, 0xe3, 0x44, + 0x14, 0x8f, 0x9d, 0xa4, 0x4d, 0x5f, 0xd2, 0x6d, 0x3a, 0xdb, 0x6e, 0x2d, 0x03, 0x76, 0xf0, 0x6a, + 0x51, 0x77, 0xa1, 0x09, 0xcd, 0x42, 0x91, 0x8a, 0x16, 0x29, 0x49, 0xb3, 0xc2, 0x2b, 0xfa, 0x81, + 0xdb, 0xae, 0xc4, 0x5e, 0xa2, 0xd4, 0x76, 0x13, 0x2b, 0x8d, 0x1d, 0x6c, 0x77, 0xd5, 0x9e, 0xb8, + 0x70, 0x58, 0xf5, 0xc4, 0x81, 0xcb, 0x1e, 0x2a, 0x90, 0xf6, 0xc6, 0x1f, 0x82, 0x7a, 0xdc, 0x23, + 0x27, 0x0b, 0xa5, 0x77, 0x0e, 0x39, 0x22, 0x0e, 0xc8, 0x33, 0xfe, 0x4a, 0x9d, 0x7e, 0xd1, 0x1e, + 0x40, 0x5c, 0xda, 0x99, 0x37, 0xef, 0xfd, 0x66, 0xde, 0xfb, 0xfd, 0xe6, 0x4d, 0x0c, 0x0f, 0x0e, + 0x4a, 0xda, 0x8e, 0x5c, 0xfa, 0xf8, 0xf1, 0x82, 0x6c, 0xe8, 0xba, 0x2a, 0xdb, 0x9a, 0xa1, 0x97, + 0xec, 0xc3, 0x9e, 0x6a, 0x91, 0xbf, 0xc5, 0x9e, 0x69, 0xd8, 0x06, 0xe2, 0x64, 0xc3, 0xea, 0x1a, + 0x56, 0xc3, 0x52, 0x3a, 0xc5, 0x83, 0xa2, 0xb6, 0x23, 0x17, 0x43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0xce, 0x18, 0xfe, 0xa4, 0x7b, 0xfc, + 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x12, 0x22, 0x6f, 0x92, 0x6a, 0x0e, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // Connection queries an IBC connection end. + Connection(ctx context.Context, in *QueryConnectionRequest, opts ...grpc.CallOption) (*QueryConnectionResponse, error) + // ClientConnections queries the connection paths associated with a client state. + ClientConnections(ctx context.Context, in *QueryClientConnectionsRequest, opts ...grpc.CallOption) (*QueryClientConnectionsResponse, error) +} + +type queryClient struct { + cc *grpc.ClientConn +} + +func NewQueryClient(cc *grpc.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Connection(ctx context.Context, in *QueryConnectionRequest, opts ...grpc.CallOption) (*QueryConnectionResponse, error) { + out := new(QueryConnectionResponse) + err := c.cc.Invoke(ctx, "/cosmos_sdk.x.ibc.connection.v1.Query/Connection", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ClientConnections(ctx context.Context, in *QueryClientConnectionsRequest, opts ...grpc.CallOption) (*QueryClientConnectionsResponse, error) { + out := new(QueryClientConnectionsResponse) + err := c.cc.Invoke(ctx, "/cosmos_sdk.x.ibc.connection.v1.Query/ClientConnections", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Connection queries an IBC connection end. + Connection(context.Context, *QueryConnectionRequest) (*QueryConnectionResponse, error) + // ClientConnections queries the connection paths associated with a client state. + ClientConnections(context.Context, *QueryClientConnectionsRequest) (*QueryClientConnectionsResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Connection(ctx context.Context, req *QueryConnectionRequest) (*QueryConnectionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Connection not implemented") +} +func (*UnimplementedQueryServer) ClientConnections(ctx context.Context, req *QueryClientConnectionsRequest) (*QueryClientConnectionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClientConnections not implemented") +} + +func RegisterQueryServer(s *grpc.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Connection_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryConnectionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Connection(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos_sdk.x.ibc.connection.v1.Query/Connection", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Connection(ctx, req.(*QueryConnectionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ClientConnections_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryClientConnectionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ClientConnections(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos_sdk.x.ibc.connection.v1.Query/ClientConnections", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ClientConnections(ctx, req.(*QueryClientConnectionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos_sdk.x.ibc.connection.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Connection", + Handler: _Query_Connection_Handler, + }, + { + MethodName: "ClientConnections", + Handler: _Query_ClientConnections_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "x/ibc/03-connection/types/types.proto", } func (m *MsgConnectionOpenInit) Marshal() (dAtA []byte, err error) { @@ -1023,52 +1405,237 @@ func (m *ClientPaths) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *QueryConnectionRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *MsgConnectionOpenInit) Size() (n int) { - if m == nil { - return 0 - } + +func (m *QueryConnectionRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryConnectionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.ClientID) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.ConnectionID) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = m.Counterparty.Size() - n += 1 + l + sovTypes(uint64(l)) - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) + if len(m.ConnectionID) > 0 { + i -= len(m.ConnectionID) + copy(dAtA[i:], m.ConnectionID) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ConnectionID))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *MsgConnectionOpenTry) Size() (n int) { - if m == nil { - return 0 +func (m *QueryConnectionResponse) 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 *QueryConnectionResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryConnectionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.ClientID) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) + if m.ProofHeight != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.ProofHeight)) + i-- + dAtA[i] = 0x20 } - l = len(m.ConnectionID) - if l > 0 { + if m.ProofPath != nil { + { + size, err := m.ProofPath.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Proof != nil { + { + size, err := m.Proof.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Connection != nil { + { + size, err := m.Connection.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryClientConnectionsRequest) 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 *QueryClientConnectionsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryClientConnectionsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ClientID) > 0 { + i -= len(m.ClientID) + copy(dAtA[i:], m.ClientID) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ClientID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryClientConnectionsResponse) 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 *QueryClientConnectionsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryClientConnectionsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProofHeight != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.ProofHeight)) + i-- + dAtA[i] = 0x20 + } + if m.ProofPath != nil { + { + size, err := m.ProofPath.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Proof != nil { + { + size, err := m.Proof.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.ConnectionPaths) > 0 { + for iNdEx := len(m.ConnectionPaths) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ConnectionPaths[iNdEx]) + copy(dAtA[i:], m.ConnectionPaths[iNdEx]) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ConnectionPaths[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { + offset -= sovTypes(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgConnectionOpenInit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClientID) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.ConnectionID) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = m.Counterparty.Size() + n += 1 + l + sovTypes(uint64(l)) + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *MsgConnectionOpenTry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClientID) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.ConnectionID) + if l > 0 { n += 1 + l + sovTypes(uint64(l)) } l = m.Counterparty.Size() @@ -1221,6 +1788,82 @@ func (m *ClientPaths) Size() (n int) { return n } +func (m *QueryConnectionRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ConnectionID) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *QueryConnectionResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Connection != nil { + l = m.Connection.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.Proof != nil { + l = m.Proof.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.ProofPath != nil { + l = m.ProofPath.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.ProofHeight != 0 { + n += 1 + sovTypes(uint64(m.ProofHeight)) + } + return n +} + +func (m *QueryClientConnectionsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClientID) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *QueryClientConnectionsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ConnectionPaths) > 0 { + for _, s := range m.ConnectionPaths { + l = len(s) + n += 1 + l + sovTypes(uint64(l)) + } + } + if m.Proof != nil { + l = m.Proof.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.ProofPath != nil { + l = m.ProofPath.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.ProofHeight != 0 { + n += 1 + sovTypes(uint64(m.ProofHeight)) + } + return n +} + func sovTypes(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2598,6 +3241,532 @@ func (m *ClientPaths) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryConnectionRequest) 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 ErrIntOverflowTypes + } + 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: QueryConnectionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryConnectionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConnectionID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryConnectionResponse) 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 ErrIntOverflowTypes + } + 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: QueryConnectionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryConnectionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Connection", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Connection == nil { + m.Connection = &ConnectionEnd{} + } + if err := m.Connection.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Proof == nil { + m.Proof = &types.MerkleProof{} + } + if err := m.Proof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofPath", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ProofPath == nil { + m.ProofPath = &types.MerklePath{} + } + if err := m.ProofPath.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) + } + m.ProofHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProofHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryClientConnectionsRequest) 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 ErrIntOverflowTypes + } + 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: QueryClientConnectionsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryClientConnectionsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryClientConnectionsResponse) 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 ErrIntOverflowTypes + } + 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: QueryClientConnectionsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryClientConnectionsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionPaths", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConnectionPaths = append(m.ConnectionPaths, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Proof == nil { + m.Proof = &types.MerkleProof{} + } + if err := m.Proof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofPath", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ProofPath == nil { + m.ProofPath = &types.MerklePath{} + } + if err := m.ProofPath.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) + } + m.ProofHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProofHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTypes(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/ibc/03-connection/types/types.proto b/x/ibc/03-connection/types/types.proto index 278846f1d4d6..fe3e96dd5392 100644 --- a/x/ibc/03-connection/types/types.proto +++ b/x/ibc/03-connection/types/types.proto @@ -23,7 +23,7 @@ message MsgConnectionOpenTry { Counterparty counterparty = 3 [(gogoproto.nullable) = false]; repeated string counterparty_versions = 4 [(gogoproto.moretags) = "yaml:\"counterparty_versions\""]; // proof of the initialization the connection on Chain A: `UNITIALIZED -> INIT` - bytes proof_init = 5 [(gogoproto.moretags) = "yaml:\"proof_init\""]; + bytes proof_init = 5 [(gogoproto.moretags) = "yaml:\"proof_init\""]; uint64 proof_height = 6; // proof of client consensus state bytes proof_consensus = 7 @@ -112,3 +112,52 @@ message Counterparty { message ClientPaths { repeated string paths = 1; } + +// Query provides defines the gRPC querier service +service Query { + // Connection queries an IBC connection end. + rpc Connection(QueryConnectionRequest) returns (QueryConnectionResponse) {} + + // ClientConnections queries the connection paths associated with a client state. + rpc ClientConnections(QueryClientConnectionsRequest) returns (QueryClientConnectionsResponse) {} +} + +// QueryConnectionRequest is the request type for the Query/Connection RPC method +message QueryConnectionRequest { + // connection unique identifier + string connection_id = 1 [(gogoproto.customname) = "ConnectionID"]; +} + +// QueryConnectionResponse is the response type for the Query/Connection RPC method. +// Besides the connection end, it includes a proof and the height from which the +// proof was retrieved. +message QueryConnectionResponse { + // connection associated with the request identifier + ConnectionEnd connection = 1; + // merkle proof of existence + cosmos_sdk.x.ibc.commitment.v1.MerkleProof proof = 2; + // merkle proof path + cosmos_sdk.x.ibc.commitment.v1.MerklePath proof_path = 3; + // height at which the proof was retrieved + uint64 proof_height = 4; +} + +// QueryClientConnectionsRequest is the request type for the Query/ClientConnections +// RPC method +message QueryClientConnectionsRequest { + // client identifier associated with a connection + string client_id = 1 [(gogoproto.customname) = "ClientID"]; +} + +// QueryClientConnectionsResponse is the response type for the Query/ClientConnections +// RPC method +message QueryClientConnectionsResponse { + // slice of all the connection paths associated with a client. + repeated string connection_paths = 1; + // merkle proof of existence + cosmos_sdk.x.ibc.commitment.v1.MerkleProof proof = 2; + // merkle proof path + cosmos_sdk.x.ibc.commitment.v1.MerklePath proof_path = 3; + // height at which the proof was generated + uint64 proof_height = 4; +} \ No newline at end of file diff --git a/x/ibc/module.go b/x/ibc/module.go index c5e584c8f5e1..3718f4c03bf2 100644 --- a/x/ibc/module.go +++ b/x/ibc/module.go @@ -17,7 +17,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - client2 "github.com/cosmos/cosmos-sdk/x/ibc/02-client" + ibcclient "github.com/cosmos/cosmos-sdk/x/ibc/02-client" + connection "github.com/cosmos/cosmos-sdk/x/ibc/03-connection" host "github.com/cosmos/cosmos-sdk/x/ibc/24-host" "github.com/cosmos/cosmos-sdk/x/ibc/client/cli" "github.com/cosmos/cosmos-sdk/x/ibc/client/rest" @@ -124,7 +125,10 @@ func (am AppModule) NewQuerierHandler() sdk.Querier { return keeper.NewQuerier(*am.keeper) } -func (am AppModule) RegisterQueryService(grpc.Server) {} +// RegisterQueryService registers the gRPC query service for the ibc module. +func (am AppModule) RegisterQueryService(server grpc.Server) { + connection.RegisterQueryService(server, am.keeper.ConnectionKeeper) +} // InitGenesis performs genesis initialization for the ibc module. It returns // no validator updates. @@ -146,7 +150,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONMarshaler) json // BeginBlock returns the begin blocker for the ibc module. func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { - client2.BeginBlocker(ctx, am.keeper.ClientKeeper) + ibcclient.BeginBlocker(ctx, am.keeper.ClientKeeper) } // EndBlock returns the end blocker for the ibc module. It returns no validator