From 3a7106c32025d3a636607fb52838b42039a98a0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=E1=BA=B7c?= <67097720+expertdicer@users.noreply.github.com> Date: Wed, 12 Apr 2023 14:36:56 +0700 Subject: [PATCH] fix: add missing query for next sequence send (#3417) Co-authored-by: Jim Fasarakis-Hilliard --- modules/core/04-channel/client/cli/cli.go | 2 +- modules/core/04-channel/client/cli/query.go | 35 + modules/core/04-channel/client/utils/utils.go | 36 + modules/core/04-channel/keeper/grpc_query.go | 36 + .../core/04-channel/keeper/grpc_query_test.go | 101 +++ modules/core/04-channel/types/query.go | 11 + modules/core/04-channel/types/query.pb.go | 721 +++++++++++++++--- modules/core/04-channel/types/query.pb.gw.go | 123 +++ modules/core/keeper/grpc_query.go | 5 + proto/ibc/core/channel/v1/query.proto | 26 + 10 files changed, 1000 insertions(+), 96 deletions(-) diff --git a/modules/core/04-channel/client/cli/cli.go b/modules/core/04-channel/client/cli/cli.go index 7d74011db41..f8c8afd4d39 100644 --- a/modules/core/04-channel/client/cli/cli.go +++ b/modules/core/04-channel/client/cli/cli.go @@ -29,7 +29,7 @@ func GetQueryCmd() *cobra.Command { GetCmdQueryUnreceivedPackets(), GetCmdQueryUnreceivedAcks(), GetCmdQueryNextSequenceReceive(), - // TODO: next sequence Send ? + GetCmdQueryNextSequenceSend(), ) return queryCmd diff --git a/modules/core/04-channel/client/cli/query.go b/modules/core/04-channel/client/cli/query.go index b06b9655eb3..bac6660ed4e 100644 --- a/modules/core/04-channel/client/cli/query.go +++ b/modules/core/04-channel/client/cli/query.go @@ -455,3 +455,38 @@ func GetCmdQueryNextSequenceReceive() *cobra.Command { return cmd } + +// GetCmdQueryNextSequenceSend defines the command to query a next send sequence for a given channel +func GetCmdQueryNextSequenceSend() *cobra.Command { + cmd := &cobra.Command{ + Use: "next-sequence-send [port-id] [channel-id]", + Short: "Query a next send sequence", + Long: "Query the next sequence send for a given channel", + Example: fmt.Sprintf( + "%s query %s %s next-sequence-send [port-id] [channel-id]", version.AppName, ibcexported.ModuleName, types.SubModuleName, + ), + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + portID := args[0] + channelID := args[1] + prove, _ := cmd.Flags().GetBool(flags.FlagProve) + + sequenceRes, err := utils.QueryNextSequenceSend(clientCtx, portID, channelID, prove) + if err != nil { + return err + } + + clientCtx = clientCtx.WithHeight(int64(sequenceRes.ProofHeight.RevisionHeight)) + return clientCtx.PrintProto(sequenceRes) + }, + } + + cmd.Flags().Bool(flags.FlagProve, true, "show proofs for the query results") + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/modules/core/04-channel/client/utils/utils.go b/modules/core/04-channel/client/utils/utils.go index be06badf011..c9033eb5bbf 100644 --- a/modules/core/04-channel/client/utils/utils.go +++ b/modules/core/04-channel/client/utils/utils.go @@ -194,6 +194,42 @@ func queryNextSequenceRecvABCI(clientCtx client.Context, portID, channelID strin return types.NewQueryNextSequenceReceiveResponse(sequence, proofBz, proofHeight), nil } +// QueryNextSequenceSend returns the next sequence send. +// If prove is true, it performs an ABCI store query in order to retrieve the merkle proof. Otherwise, +// it uses the gRPC query client. +func QueryNextSequenceSend( + clientCtx client.Context, portID, channelID string, prove bool, +) (*types.QueryNextSequenceSendResponse, error) { + if prove { + return queryNextSequenceSendABCI(clientCtx, portID, channelID) + } + + queryClient := types.NewQueryClient(clientCtx) + req := &types.QueryNextSequenceSendRequest{ + PortId: portID, + ChannelId: channelID, + } + return queryClient.NextSequenceSend(context.Background(), req) +} + +func queryNextSequenceSendABCI(clientCtx client.Context, portID, channelID string) (*types.QueryNextSequenceSendResponse, error) { + key := host.NextSequenceSendKey(portID, channelID) + + value, proofBz, proofHeight, err := ibcclient.QueryTendermintProof(clientCtx, key) + if err != nil { + return nil, err + } + + // check if next sequence send exists + if len(value) == 0 { + return nil, errorsmod.Wrapf(types.ErrChannelNotFound, "portID (%s), channelID (%s)", portID, channelID) + } + + sequence := binary.BigEndian.Uint64(value) + + return types.NewQueryNextSequenceSendResponse(sequence, proofBz, proofHeight), nil +} + // QueryPacketCommitment returns a packet commitment. // If prove is true, it performs an ABCI store query in order to retrieve the merkle proof. Otherwise, // it uses the gRPC query client. diff --git a/modules/core/04-channel/keeper/grpc_query.go b/modules/core/04-channel/keeper/grpc_query.go index 14989a7f5e8..333f4e15aae 100644 --- a/modules/core/04-channel/keeper/grpc_query.go +++ b/modules/core/04-channel/keeper/grpc_query.go @@ -541,6 +541,42 @@ func (q Keeper) NextSequenceReceive(c context.Context, req *types.QueryNextSeque return types.NewQueryNextSequenceReceiveResponse(sequence, nil, selfHeight), nil } +// NextSequenceSend implements the Query/NextSequenceSend gRPC method +func (q Keeper) NextSequenceSend(c context.Context, req *types.QueryNextSequenceSendRequest) (*types.QueryNextSequenceSendResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + if err := validategRPCRequest(req.PortId, req.ChannelId); err != nil { + return nil, err + } + + ctx := sdk.UnwrapSDKContext(c) + + channel, found := q.GetChannel(ctx, req.PortId, req.ChannelId) + if !found { + return nil, status.Error( + codes.NotFound, + errorsmod.Wrapf(types.ErrChannelNotFound, "port-id: %s, channel-id %s", req.PortId, req.ChannelId).Error(), + ) + } + + // Return the next sequence send for ordered channels. Unordered channels + // do not make use of the next sequence send. + var sequence uint64 + if channel.Ordering != types.UNORDERED { + sequence, found = q.GetNextSequenceSend(ctx, req.PortId, req.ChannelId) + if !found { + return nil, status.Error( + codes.NotFound, + errorsmod.Wrapf(types.ErrSequenceSendNotFound, "port-id: %s, channel-id %s", req.PortId, req.ChannelId).Error(), + ) + } + } + selfHeight := clienttypes.GetSelfHeight(ctx) + return types.NewQueryNextSequenceSendResponse(sequence, nil, selfHeight), nil +} + func validategRPCRequest(portID, channelID string) error { if err := host.PortIdentifierValidator(portID); err != nil { return status.Error(codes.InvalidArgument, err.Error()) diff --git a/modules/core/04-channel/keeper/grpc_query_test.go b/modules/core/04-channel/keeper/grpc_query_test.go index 4a0b60809f6..09523896110 100644 --- a/modules/core/04-channel/keeper/grpc_query_test.go +++ b/modules/core/04-channel/keeper/grpc_query_test.go @@ -1565,3 +1565,104 @@ func (suite *KeeperTestSuite) TestQueryNextSequenceReceive() { }) } } + +func (suite *KeeperTestSuite) TestQueryNextSequenceSend() { + var ( + req *types.QueryNextSequenceSendRequest + expSeq uint64 + ) + + testCases := []struct { + msg string + malleate func() + expPass bool + }{ + { + "empty request", + func() { + req = nil + }, + false, + }, + { + "invalid port ID", + func() { + req = &types.QueryNextSequenceSendRequest{ + PortId: "", + ChannelId: "test-channel-id", + } + }, + false, + }, + { + "invalid channel ID", + func() { + req = &types.QueryNextSequenceSendRequest{ + PortId: "test-port-id", + ChannelId: "", + } + }, + false, + }, + { + "channel not found", + func() { + req = &types.QueryNextSequenceSendRequest{ + PortId: "test-port-id", + ChannelId: "test-channel-id", + } + }, + false, + }, + { + "basic success on unordered channel returns zero", + func() { + path := ibctesting.NewPath(suite.chainA, suite.chainB) + suite.coordinator.Setup(path) + + expSeq = 0 + req = &types.QueryNextSequenceSendRequest{ + PortId: path.EndpointA.ChannelConfig.PortID, + ChannelId: path.EndpointA.ChannelID, + } + }, + true, + }, + { + "basic success on ordered channel returns the set send sequence", + func() { + path := ibctesting.NewPath(suite.chainA, suite.chainB) + path.SetChannelOrdered() + suite.coordinator.Setup(path) + + expSeq = 3 + seq := uint64(3) + suite.chainA.App.GetIBCKeeper().ChannelKeeper.SetNextSequenceSend(suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, seq) + + req = &types.QueryNextSequenceSendRequest{ + PortId: path.EndpointA.ChannelConfig.PortID, + ChannelId: path.EndpointA.ChannelID, + } + }, + true, + }, + } + + for _, tc := range testCases { + suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { + suite.SetupTest() // reset + + tc.malleate() + ctx := sdk.WrapSDKContext(suite.chainA.GetContext()) + res, err := suite.chainA.QueryServer.NextSequenceSend(ctx, req) + + if tc.expPass { + suite.Require().NoError(err) + suite.Require().NotNil(res) + suite.Require().Equal(expSeq, res.NextSequenceSend) + } else { + suite.Require().Error(err) + } + }) + } +} diff --git a/modules/core/04-channel/types/query.go b/modules/core/04-channel/types/query.go index 84c6fac61f2..51651ec23eb 100644 --- a/modules/core/04-channel/types/query.go +++ b/modules/core/04-channel/types/query.go @@ -93,3 +93,14 @@ func NewQueryNextSequenceReceiveResponse( ProofHeight: height, } } + +// NewQueryNextSequenceSendResponse creates a new QueryNextSequenceSendResponse instance +func NewQueryNextSequenceSendResponse( + sequence uint64, proof []byte, height clienttypes.Height, +) *QueryNextSequenceSendResponse { + return &QueryNextSequenceSendResponse{ + NextSequenceSend: sequence, + Proof: proof, + ProofHeight: height, + } +} diff --git a/modules/core/04-channel/types/query.pb.go b/modules/core/04-channel/types/query.pb.go index ec6746d002c..f47cfb1c0f5 100644 --- a/modules/core/04-channel/types/query.pb.go +++ b/modules/core/04-channel/types/query.pb.go @@ -1676,6 +1676,127 @@ func (m *QueryNextSequenceReceiveResponse) GetProofHeight() types.Height { return types.Height{} } +// QueryNextSequenceSendRequest is the request type for the +// Query/QueryNextSequenceSend RPC method +type QueryNextSequenceSendRequest struct { + // port unique identifier + PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty"` + // channel unique identifier + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` +} + +func (m *QueryNextSequenceSendRequest) Reset() { *m = QueryNextSequenceSendRequest{} } +func (m *QueryNextSequenceSendRequest) String() string { return proto.CompactTextString(m) } +func (*QueryNextSequenceSendRequest) ProtoMessage() {} +func (*QueryNextSequenceSendRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_1034a1e9abc4cca1, []int{26} +} +func (m *QueryNextSequenceSendRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryNextSequenceSendRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryNextSequenceSendRequest.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 *QueryNextSequenceSendRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryNextSequenceSendRequest.Merge(m, src) +} +func (m *QueryNextSequenceSendRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryNextSequenceSendRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryNextSequenceSendRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryNextSequenceSendRequest proto.InternalMessageInfo + +func (m *QueryNextSequenceSendRequest) GetPortId() string { + if m != nil { + return m.PortId + } + return "" +} + +func (m *QueryNextSequenceSendRequest) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + +// QueryNextSequenceSendResponse is the request type for the +// Query/QueryNextSequenceSend RPC method +type QueryNextSequenceSendResponse struct { + // next sequence send number + NextSequenceSend uint64 `protobuf:"varint,1,opt,name=next_sequence_send,json=nextSequenceSend,proto3" json:"next_sequence_send,omitempty"` + // merkle proof of existence + Proof []byte `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` + // height at which the proof was retrieved + ProofHeight types.Height `protobuf:"bytes,3,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height"` +} + +func (m *QueryNextSequenceSendResponse) Reset() { *m = QueryNextSequenceSendResponse{} } +func (m *QueryNextSequenceSendResponse) String() string { return proto.CompactTextString(m) } +func (*QueryNextSequenceSendResponse) ProtoMessage() {} +func (*QueryNextSequenceSendResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1034a1e9abc4cca1, []int{27} +} +func (m *QueryNextSequenceSendResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryNextSequenceSendResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryNextSequenceSendResponse.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 *QueryNextSequenceSendResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryNextSequenceSendResponse.Merge(m, src) +} +func (m *QueryNextSequenceSendResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryNextSequenceSendResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryNextSequenceSendResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryNextSequenceSendResponse proto.InternalMessageInfo + +func (m *QueryNextSequenceSendResponse) GetNextSequenceSend() uint64 { + if m != nil { + return m.NextSequenceSend + } + return 0 +} + +func (m *QueryNextSequenceSendResponse) GetProof() []byte { + if m != nil { + return m.Proof + } + return nil +} + +func (m *QueryNextSequenceSendResponse) GetProofHeight() types.Height { + if m != nil { + return m.ProofHeight + } + return types.Height{} +} + func init() { proto.RegisterType((*QueryChannelRequest)(nil), "ibc.core.channel.v1.QueryChannelRequest") proto.RegisterType((*QueryChannelResponse)(nil), "ibc.core.channel.v1.QueryChannelResponse") @@ -1703,106 +1824,111 @@ func init() { proto.RegisterType((*QueryUnreceivedAcksResponse)(nil), "ibc.core.channel.v1.QueryUnreceivedAcksResponse") proto.RegisterType((*QueryNextSequenceReceiveRequest)(nil), "ibc.core.channel.v1.QueryNextSequenceReceiveRequest") proto.RegisterType((*QueryNextSequenceReceiveResponse)(nil), "ibc.core.channel.v1.QueryNextSequenceReceiveResponse") + proto.RegisterType((*QueryNextSequenceSendRequest)(nil), "ibc.core.channel.v1.QueryNextSequenceSendRequest") + proto.RegisterType((*QueryNextSequenceSendResponse)(nil), "ibc.core.channel.v1.QueryNextSequenceSendResponse") } func init() { proto.RegisterFile("ibc/core/channel/v1/query.proto", fileDescriptor_1034a1e9abc4cca1) } var fileDescriptor_1034a1e9abc4cca1 = []byte{ - // 1489 bytes of a gzipped FileDescriptor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 0xed, 0xcc, 0x8a, 0x2f, 0xe5, 0x3f, 0x8d, - 0x42, 0x75, 0x25, 0xf7, 0xf7, 0x01, 0x9a, 0x81, 0x11, 0x68, 0xdf, 0x54, 0x79, 0x14, 0x55, 0x3f, - 0x8a, 0x2a, 0xbf, 0x14, 0x22, 0x8a, 0xea, 0x15, 0xbd, 0x4c, 0x85, 0xad, 0x16, 0xb2, 0xcc, 0x3f, - 0x47, 0x30, 0xd2, 0x72, 0x80, 0x10, 0x63, 0x06, 0x06, 0x04, 0x3f, 0x77, 0x14, 0x4d, 0xf4, 0x33, - 0xff, 0x71, 0x6a, 0xcc, 0x95, 0xa8, 0xe5, 0x99, 0xb7, 0x4c, 0x5a, 0x92, 0xba, 0x04, 0x76, 0xf8, - 0x7c, 0x04, 0x65, 0x86, 0xa1, 0x3c, 0xbc, 0x2a, 0x4a, 0x0e, 0x20, 0x0c, 0x13, 0x9f, 0x81, 0xad, - 0x1d, 0xaa, 0x28, 0xf6, 0xe7, 0x1f, 0x20, 0xc8, 0x71, 0x82, 0xb6, 0x65, 0x51, 0xc3, 0xf7, 0xd6, - 0xaa, 0x65, 0x0e, 0xc0, 0x08, 0x3e, 0x8a, 0xab, 0x14, 0x5a, 0x69, 0xd1, 0x3a, 0xb3, 0x6e, 0xad, - 0xff, 0x46, 0x30, 0x9e, 0x08, 0xe5, 0xff, 0xa5, 0xfa, 0x75, 0x29, 0x3a, 0xc7, 0x34, 0xcb, 0x76, - 0xcf, 0x7b, 0xba, 0x47, 0xbb, 0x4d, 0xde, 0x3f, 0x03, 0x11, 0x63, 0x5c, 0x0b, 0x11, 0x75, 0xd8, - 0x67, 0x06, 0xfa, 0x14, 0x38, 0xd4, 0x82, 0xeb, 0x6f, 0x11, 0x99, 0x72, 0x24, 0x8e, 0x48, 0x48, - 0xd2, 0x90, 0xcf, 0x11, 0x33, 0x6e, 0xb9, 0x97, 0x29, 0xff, 0x33, 0x82, 0x43, 0x11, 0x86, 0x3e, - 0x27, 0xcb,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0x1f, 0x22, 0xaa, 0x51, 0x83, 0x9a, 0x4e, 0x4f, - 0x6f, 0xe6, 0x43, 0x04, 0x4a, 0xdc, 0x89, 0x42, 0x56, 0x05, 0x06, 0xaa, 0xfe, 0x52, 0x9d, 0x72, - 0xbf, 0x03, 0x5a, 0xf0, 0xde, 0xcb, 0x1c, 0xbd, 0x23, 0x0a, 0x26, 0x07, 0x75, 0xce, 0x58, 0xb4, - 0xec, 0x3b, 0x4b, 0xb4, 0x54, 0xa6, 0xbd, 0x4e, 0xd4, 0x47, 0xb2, 0xf4, 0x25, 0x9c, 0x2c, 0x64, - 0x99, 0x84, 0x5d, 0x7a, 0xf4, 0x93, 0x48, 0xd9, 0xd6, 0xe5, 0x5e, 0xe6, 0xed, 0xcb, 0x54, 0xac, - 0x9b, 0x25, 0x79, 0xf1, 0x59, 0x38, 0xe0, 0x30, 0x80, 0x85, 0x66, 0xae, 0x15, 0xa4, 0xe0, 0xee, - 0x68, 0x76, 0xa2, 0x7f, 0x32, 0xab, 0xed, 0x77, 0x5a, 0x32, 0x7b, 0x5e, 0x6e, 0xc8, 0xff, 0x8b, - 0xe0, 0xf5, 0x54, 0x9a, 0x22, 0x26, 0x1f, 0xc2, 0xee, 0x16, 0xf1, 0xd7, 0x5e, 0x06, 0xda, 0x2c, - 0x37, 0x43, 0x2d, 0xf8, 0x5e, 0xd6, 0xe5, 0x6b, 0x96, 0xcc, 0x39, 0x8e, 0xb9, 0xeb, 0xd0, 0xae, - 0x12, 0x92, 0xfe, 0xd5, 0x42, 0x72, 0x57, 0x94, 0xe3, 0x18, 0x60, 0x22, 0x18, 0x63, 0x30, 0xd8, - 0xf4, 0x87, 0x98, 0xbf, 0xe6, 0x42, 0x48, 0x93, 0x4c, 0x87, 0x9a, 0xdc, 0x97, 0xe5, 0xaa, 0x79, - 0xf4, 0x39, 0x63, 0xb1, 0x6b, 0x41, 0x8e, 0xc3, 0xb0, 0x10, 0x44, 0x37, 0x16, 0xdb, 0x94, 0xc0, -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0xb6, - 0x44, 0x5d, 0x0e, 0xe1, 0xf8, 0xc9, 0x63, 0x12, 0x85, 0x77, 0xcf, 0xa1, 0x6e, 0x71, 0x2b, 0xfb, - 0x11, 0xf7, 0xc4, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x67, 0x58, 0x5b, 0xa1, 0xa8, 0x1c, 0x00, - 0x00, + // 1548 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0xcf, 0x6f, 0x13, 0xc7, + 0x17, 0xcf, 0x38, 0x06, 0x92, 0x07, 0x5f, 0x08, 0x93, 0xe4, 0x4b, 0x58, 0x82, 0x13, 0x5c, 0xb5, + 0x04, 0x54, 0x76, 0x48, 0xa0, 0x40, 0xab, 0x16, 0x89, 0x44, 0x2a, 0xa4, 0x2a, 0xbf, 0x36, 0xa5, + 0x05, 0xa4, 0xd6, 0x5d, 0xaf, 0x07, 0x67, 0x95, 0x78, 0xd7, 0x78, 0xd7, 0x06, 0x94, 0xba, 0xaa, + 0x7a, 0xa0, 0x1c, 0xab, 0x72, 0xa8, 0xd4, 0x4b, 0xa5, 0x9e, 0xca, 0xa1, 0x87, 0xfe, 0x05, 0xbd, + 0x72, 0x2b, 0x12, 0x3d, 0x54, 0x42, 0xa2, 0x15, 0x41, 0xa2, 0xd7, 0x5e, 0x7a, 0xae, 0x76, 0x7e, + 0xac, 0x77, 0xed, 0xdd, 0x4d, 0x9c, 0x8d, 0x25, 0xd4, 0x9b, 0x77, 0x66, 0xde, 0x9b, 0xcf, 0xe7, + 0xf3, 0xe6, 0xbd, 0x9d, 0xb7, 0x86, 0x09, 0xb3, 0x68, 0x10, 0xc3, 0xae, 0x51, 0x62, 0x2c, 0xea, + 0x96, 0x45, 0x97, 0x49, 0x63, 0x9a, 0xdc, 0xac, 0xd3, 0xda, 0x1d, 0xb5, 0x5a, 0xb3, 0x5d, 0x1b, + 0x0f, 0x9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0x82, 0x31, 0x0e, 0x83, + 0x2d, 0x7f, 0x88, 0xf9, 0x6b, 0x0d, 0x04, 0x34, 0xc9, 0x74, 0xa9, 0xc9, 0x5d, 0x59, 0xae, 0x5a, + 0x5b, 0x9f, 0x31, 0x96, 0x52, 0x0b, 0x72, 0x14, 0x46, 0x84, 0x20, 0xba, 0xb1, 0xd4, 0xa1, 0x04, + 0xae, 0xca, 0x93, 0xd7, 0x92, 0xa0, 0x0e, 0xfb, 0x22, 0x71, 0xf4, 0x98, 0xff, 0x35, 0x71, 0x57, + 0xbe, 0x40, 0x6f, 0xfb, 0xf1, 0xd0, 0x38, 0x80, 0xb4, 0xf7, 0xf0, 0x9f, 0x11, 0x4c, 0xc6, 0xfb, + 0x16, 0xbc, 0x66, 0x60, 0xd4, 0xa2, 0xb7, 0x5b, 0x87, 0xa5, 0x20, 0xd8, 0xb3, 0xad, 0xb2, 0xda, + 0xb0, 0xd5, 0x69, 0xdb, 0xcb, 0x12, 0xf8, 0xa1, 0xb8, 0xcb, 0x05, 0x21, 0x2f, 0x50, 0xab, 0x94, + 0x56, 0x8b, 0x1f, 0x65, 0xea, 0x75, 0x3a, 0x16, 0x42, 0xbc, 0x0e, 0x38, 0x2c, 0x84, 0x43, 0xad, + 0x92, 0x50, 0x61, 0xc8, 0x6a, 0xb3, 0xea, 0xa1, 0x04, 0x33, 0x4f, 0xf7, 0xc0, 0x16, 0x06, 0x15, + 0xff, 0x80, 0x60, 0x9b, 0xb8, 0xb1, 0xe3, 0xa9, 0xc8, 0x92, 0x17, 0xf1, 0xcd, 0x45, 0x39, 0xb4, + 0x8e, 0x95, 0x9c, 0x73, 0x7e, 0xf6, 0xcb, 0xc7, 0xcf, 0xef, 0x67, 0xde, 0xc6, 0x6f, 0x91, 0x84, + 0x0f, 0x46, 0x0e, 0x59, 0x69, 0x29, 0xdb, 0x24, 0x9e, 0xde, 0x0e, 0x59, 0x11, 0x51, 0x68, 0xe2, + 0x7b, 0x08, 0x06, 0x64, 0x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 0x5d, 0x5a, 0x09, 0x09, 0x2e, 0x31, 0x09, 0xde, 0xc3, 0xe7, 0x52, 0x48, 0x10, 0xba, 0x85, 0x7b, + 0x37, 0xa2, 0xa1, 0xf6, 0x3b, 0x7b, 0xd2, 0x9b, 0x32, 0xa6, 0x71, 0x48, 0x7a, 0x53, 0xc6, 0xb5, + 0x04, 0x9b, 0xf2, 0x22, 0xe9, 0xec, 0x29, 0x66, 0x17, 0x1e, 0x3e, 0xcb, 0xa1, 0x47, 0xcf, 0x72, + 0xe8, 0xcf, 0x67, 0x39, 0xf4, 0xf5, 0x6a, 0xae, 0xef, 0xd1, 0x6a, 0xae, 0xef, 0xf7, 0xd5, 0x5c, + 0xdf, 0xf5, 0x37, 0xcb, 0xa6, 0xbb, 0x58, 0x2f, 0xaa, 0x86, 0x5d, 0x21, 0xe2, 0xef, 0x5e, 0xb3, + 0x68, 0x1c, 0x29, 0xdb, 0xa4, 0x71, 0x92, 0x54, 0xec, 0x52, 0x7d, 0x99, 0x3a, 0x1c, 0xc7, 0xd1, + 0xe3, 0x47, 0x24, 0x14, 0xf7, 0x4e, 0x95, 0x3a, 0xc5, 0xad, 0xec, 0xd3, 0xfc, 0xb1, 0x7f, 0x03, + 0x00, 0x00, 0xff, 0xff, 0x6f, 0x02, 0xd9, 0x0b, 0x7e, 0x1e, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1851,6 +1977,8 @@ type QueryClient interface { UnreceivedAcks(ctx context.Context, in *QueryUnreceivedAcksRequest, opts ...grpc.CallOption) (*QueryUnreceivedAcksResponse, error) // NextSequenceReceive returns the next receive sequence for a given channel. NextSequenceReceive(ctx context.Context, in *QueryNextSequenceReceiveRequest, opts ...grpc.CallOption) (*QueryNextSequenceReceiveResponse, error) + // NextSequenceSend returns the next send sequence for a given channel. + NextSequenceSend(ctx context.Context, in *QueryNextSequenceSendRequest, opts ...grpc.CallOption) (*QueryNextSequenceSendResponse, error) } type queryClient struct { @@ -1978,6 +2106,15 @@ func (c *queryClient) NextSequenceReceive(ctx context.Context, in *QueryNextSequ return out, nil } +func (c *queryClient) NextSequenceSend(ctx context.Context, in *QueryNextSequenceSendRequest, opts ...grpc.CallOption) (*QueryNextSequenceSendResponse, error) { + out := new(QueryNextSequenceSendResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Query/NextSequenceSend", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Channel queries an IBC Channel. @@ -2014,6 +2151,8 @@ type QueryServer interface { UnreceivedAcks(context.Context, *QueryUnreceivedAcksRequest) (*QueryUnreceivedAcksResponse, error) // NextSequenceReceive returns the next receive sequence for a given channel. NextSequenceReceive(context.Context, *QueryNextSequenceReceiveRequest) (*QueryNextSequenceReceiveResponse, error) + // NextSequenceSend returns the next send sequence for a given channel. + NextSequenceSend(context.Context, *QueryNextSequenceSendRequest) (*QueryNextSequenceSendResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -2059,6 +2198,9 @@ func (*UnimplementedQueryServer) UnreceivedAcks(ctx context.Context, req *QueryU func (*UnimplementedQueryServer) NextSequenceReceive(ctx context.Context, req *QueryNextSequenceReceiveRequest) (*QueryNextSequenceReceiveResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method NextSequenceReceive not implemented") } +func (*UnimplementedQueryServer) NextSequenceSend(ctx context.Context, req *QueryNextSequenceSendRequest) (*QueryNextSequenceSendResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NextSequenceSend not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -2298,6 +2440,24 @@ func _Query_NextSequenceReceive_Handler(srv interface{}, ctx context.Context, de return interceptor(ctx, in, info, handler) } +func _Query_NextSequenceSend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryNextSequenceSendRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).NextSequenceSend(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Query/NextSequenceSend", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).NextSequenceSend(ctx, req.(*QueryNextSequenceSendRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "ibc.core.channel.v1.Query", HandlerType: (*QueryServer)(nil), @@ -2354,6 +2514,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "NextSequenceReceive", Handler: _Query_NextSequenceReceive_Handler, }, + { + MethodName: "NextSequenceSend", + Handler: _Query_NextSequenceSend_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "ibc/core/channel/v1/query.proto", @@ -3636,6 +3800,88 @@ func (m *QueryNextSequenceReceiveResponse) MarshalToSizedBuffer(dAtA []byte) (in return len(dAtA) - i, nil } +func (m *QueryNextSequenceSendRequest) 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 *QueryNextSequenceSendRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryNextSequenceSendRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0x12 + } + if len(m.PortId) > 0 { + i -= len(m.PortId) + copy(dAtA[i:], m.PortId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.PortId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryNextSequenceSendResponse) 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 *QueryNextSequenceSendResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryNextSequenceSendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Proof) > 0 { + i -= len(m.Proof) + copy(dAtA[i:], m.Proof) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Proof))) + i-- + dAtA[i] = 0x12 + } + if m.NextSequenceSend != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.NextSequenceSend)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -4163,6 +4409,41 @@ func (m *QueryNextSequenceReceiveResponse) Size() (n int) { return n } +func (m *QueryNextSequenceSendRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PortId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryNextSequenceSendResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NextSequenceSend != 0 { + n += 1 + sovQuery(uint64(m.NextSequenceSend)) + } + l = len(m.Proof) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = m.ProofHeight.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -8018,6 +8299,256 @@ func (m *QueryNextSequenceReceiveResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryNextSequenceSendRequest) 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: QueryNextSequenceSendRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryNextSequenceSendRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortId", 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.PortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", 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.ChannelId = 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 *QueryNextSequenceSendResponse) 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: QueryNextSequenceSendResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryNextSequenceSendResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NextSequenceSend", wireType) + } + m.NextSequenceSend = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NextSequenceSend |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proof = append(m.Proof[:0], dAtA[iNdEx:postIndex]...) + if m.Proof == nil { + m.Proof = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", 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 err := m.ProofHeight.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 skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/modules/core/04-channel/types/query.pb.gw.go b/modules/core/04-channel/types/query.pb.gw.go index 0f9ed6eaab3..2f9c58f146d 100644 --- a/modules/core/04-channel/types/query.pb.gw.go +++ b/modules/core/04-channel/types/query.pb.gw.go @@ -1167,6 +1167,82 @@ func local_request_Query_NextSequenceReceive_0(ctx context.Context, marshaler ru } +func request_Query_NextSequenceSend_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryNextSequenceSendRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["channel_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "channel_id") + } + + protoReq.ChannelId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "channel_id", err) + } + + val, ok = pathParams["port_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "port_id") + } + + protoReq.PortId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "port_id", err) + } + + msg, err := client.NextSequenceSend(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_NextSequenceSend_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryNextSequenceSendRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["channel_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "channel_id") + } + + protoReq.ChannelId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "channel_id", err) + } + + val, ok = pathParams["port_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "port_id") + } + + protoReq.PortId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "port_id", err) + } + + msg, err := server.NextSequenceSend(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -1472,6 +1548,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_NextSequenceSend_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_NextSequenceSend_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_NextSequenceSend_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1773,6 +1872,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_NextSequenceSend_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_NextSequenceSend_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_NextSequenceSend_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1802,6 +1921,8 @@ var ( pattern_Query_UnreceivedAcks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7, 2, 8, 1, 0, 4, 1, 5, 9, 2, 10}, []string{"ibc", "core", "channel", "v1", "channels", "channel_id", "ports", "port_id", "packet_commitments", "packet_ack_sequences", "unreceived_acks"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_NextSequenceReceive_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7, 2, 8}, []string{"ibc", "core", "channel", "v1", "channels", "channel_id", "ports", "port_id", "next_sequence"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_NextSequenceSend_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7, 2, 8}, []string{"ibc", "core", "channel", "v1", "channels", "channel_id", "ports", "port_id", "next_sequence_send"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -1830,4 +1951,6 @@ var ( forward_Query_UnreceivedAcks_0 = runtime.ForwardResponseMessage forward_Query_NextSequenceReceive_0 = runtime.ForwardResponseMessage + + forward_Query_NextSequenceSend_0 = runtime.ForwardResponseMessage ) diff --git a/modules/core/keeper/grpc_query.go b/modules/core/keeper/grpc_query.go index a0d57ad36ac..2634de99de7 100644 --- a/modules/core/keeper/grpc_query.go +++ b/modules/core/keeper/grpc_query.go @@ -147,3 +147,8 @@ func (q Keeper) UnreceivedAcks(c context.Context, req *channeltypes.QueryUnrecei func (q Keeper) NextSequenceReceive(c context.Context, req *channeltypes.QueryNextSequenceReceiveRequest) (*channeltypes.QueryNextSequenceReceiveResponse, error) { return q.ChannelKeeper.NextSequenceReceive(c, req) } + +// NextSequenceSend implements the IBC QueryServer interface +func (q Keeper) NextSequenceSend(c context.Context, req *channeltypes.QueryNextSequenceSendRequest) (*channeltypes.QueryNextSequenceSendResponse, error) { + return q.ChannelKeeper.NextSequenceSend(c, req) +} diff --git a/proto/ibc/core/channel/v1/query.proto b/proto/ibc/core/channel/v1/query.proto index 2d5bdb2fc8c..e92422432b3 100644 --- a/proto/ibc/core/channel/v1/query.proto +++ b/proto/ibc/core/channel/v1/query.proto @@ -98,6 +98,12 @@ service Query { option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" "ports/{port_id}/next_sequence"; } + + // NextSequenceSend returns the next send sequence for a given channel. + rpc NextSequenceSend(QueryNextSequenceSendRequest) returns (QueryNextSequenceSendResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" + "ports/{port_id}/next_sequence_send"; + } } // QueryChannelRequest is the request type for the Query/Channel RPC method @@ -374,3 +380,23 @@ message QueryNextSequenceReceiveResponse { // height at which the proof was retrieved ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; } + +// QueryNextSequenceSendRequest is the request type for the +// Query/QueryNextSequenceSend RPC method +message QueryNextSequenceSendRequest { + // port unique identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; +} + +// QueryNextSequenceSendResponse is the request type for the +// Query/QueryNextSequenceSend RPC method +message QueryNextSequenceSendResponse { + // next sequence send number + uint64 next_sequence_send = 1; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} \ No newline at end of file