From 759ae9c941195782cd34370f337d502baee4523e Mon Sep 17 00:00:00 2001 From: Federico Kunze Date: Wed, 24 Jun 2020 16:57:04 +0200 Subject: [PATCH] move next sequence recv query to channel client --- proto/ibc/channel/query.proto | 23 + x/ibc-transfer/client/cli/cli.go | 17 - x/ibc-transfer/client/cli/query.go | 49 -- x/ibc-transfer/client/rest/query.go | 51 -- x/ibc-transfer/client/rest/rest.go | 6 - x/ibc-transfer/client/utils/utils.go | 33 -- x/ibc/03-connection/client/cli/query.go | 2 +- x/ibc/04-channel/client/cli/cli.go | 1 + x/ibc/04-channel/client/cli/query.go | 31 +- x/ibc/04-channel/client/rest/query.go | 36 +- x/ibc/04-channel/client/utils/utils.go | 21 + x/ibc/04-channel/types/querier.go | 13 + x/ibc/04-channel/types/query.pb.go | 670 ++++++++++++++++++++++-- 13 files changed, 733 insertions(+), 220 deletions(-) delete mode 100644 x/ibc-transfer/client/cli/query.go delete mode 100644 x/ibc-transfer/client/rest/query.go delete mode 100644 x/ibc-transfer/client/utils/utils.go diff --git a/proto/ibc/channel/query.proto b/proto/ibc/channel/query.proto index a9c1f85c2c2e..08c87bc30c4e 100644 --- a/proto/ibc/channel/query.proto +++ b/proto/ibc/channel/query.proto @@ -27,6 +27,9 @@ service Query { // UnrelayedPackets returns all the unrelayed IBC packets associated with a channel and sequences. rpc UnrelayedPackets(QueryUnrelayedPacketsRequest) returns (QueryUnrelayedPacketsResponse) {} + // NextSequenceReceive returns the next receive sequence for a given channel + rpc NextSequenceReceive(QueryNextSequenceReceiveRequest) returns (QueryNextSequenceReceiveResponse) {} + // TODO: blocked by client proto migration // rpc ChannelClientState(QueryChannelClientStateRequest) returns (QueryChannelClientStateRequest) {} } @@ -151,6 +154,26 @@ message QueryUnrelayedPacketsResponse { int64 height = 3; } +// QueryNextSequenceReceiveRequest is the request type for the Query/QueryNextSequenceReceiveRequest RPC method +message QueryNextSequenceReceiveRequest { + // port unique identifier + string port_id = 1 [(gogoproto.customname) = "PortID"]; + // channel unique identifier + string channel_id = 2 [(gogoproto.customname) = "ChannelID"]; +} + +// QuerySequenceResponse is the request type for the Query/QueryNextSequenceReceiveResponse RPC method +message QueryNextSequenceReceiveResponse { + // next sequence receive number + uint64 next_sequence_receive = 1; + // merkle proof of existence + bytes proof = 2; + // merkle proof path + string proof_path = 3; + // height at which the proof was retrieved + uint64 proof_height = 4; +} + // QueryChannelClientStateRequest is the request type for the Query/ClientState RPC method message QueryChannelClientStateRequest { // port unique identifier diff --git a/x/ibc-transfer/client/cli/cli.go b/x/ibc-transfer/client/cli/cli.go index 05c31b55f73c..c09cde72b08f 100644 --- a/x/ibc-transfer/client/cli/cli.go +++ b/x/ibc-transfer/client/cli/cli.go @@ -7,23 +7,6 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" ) -// GetQueryCmd returns the query commands for IBC fungible token transfer -func GetQueryCmd(clientCtx client.Context) *cobra.Command { - ics20TransferQueryCmd := &cobra.Command{ - Use: "ibc-transfer", - Short: "IBC fungible token transfer query subcommands", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - ics20TransferQueryCmd.AddCommand(flags.GetCommands( - GetCmdQueryNextSequence(clientCtx), - )...) - - return ics20TransferQueryCmd -} - // NewTxCmd returns the transaction commands for IBC fungible token transfer func NewTxCmd(clientCtx client.Context) *cobra.Command { ics20TransferTxCmd := &cobra.Command{ diff --git a/x/ibc-transfer/client/cli/query.go b/x/ibc-transfer/client/cli/query.go deleted file mode 100644 index a562f3425bf8..000000000000 --- a/x/ibc-transfer/client/cli/query.go +++ /dev/null @@ -1,49 +0,0 @@ -package cli - -import ( - "fmt" - "strings" - - "github.com/spf13/cobra" - "github.com/spf13/viper" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/version" - "github.com/cosmos/cosmos-sdk/x/ibc-transfer/client/utils" -) - -// GetCmdQueryNextSequence defines the command to query a next receive sequence -// TODO: move to channel -func GetCmdQueryNextSequence(clientCtx client.Context) *cobra.Command { - cmd := &cobra.Command{ - Use: "next-recv [port-id] [channel-id]", - Short: "Query a next receive sequence", - Long: strings.TrimSpace(fmt.Sprintf(`Query an IBC channel end - -Example: -$ %s query ibc-transfer next-recv [port-id] [channel-id] - `, version.ClientName), - ), - Example: fmt.Sprintf("%s query ibc-transfer next-recv [port-id] [channel-id]", version.ClientName), - Args: cobra.ExactArgs(2), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx = clientCtx.Init() - - portID := args[0] - channelID := args[1] - prove := viper.GetBool(flags.FlagProve) - - sequenceRes, err := utils.QueryNextSequenceRecv(clientCtx, portID, channelID, prove) - if err != nil { - return err - } - - clientCtx = clientCtx.WithHeight(int64(sequenceRes.ProofHeight)) - return clientCtx.PrintOutput(sequenceRes) - }, - } - cmd.Flags().Bool(flags.FlagProve, true, "show proofs for the query results") - - return cmd -} diff --git a/x/ibc-transfer/client/rest/query.go b/x/ibc-transfer/client/rest/query.go deleted file mode 100644 index 514142c08957..000000000000 --- a/x/ibc-transfer/client/rest/query.go +++ /dev/null @@ -1,51 +0,0 @@ -package rest - -import ( - "fmt" - "net/http" - - "github.com/gorilla/mux" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/types/rest" - "github.com/cosmos/cosmos-sdk/x/ibc-transfer/client/utils" -) - -func registerQueryRoutes(clientCtx client.Context, r *mux.Router) { - r.HandleFunc(fmt.Sprintf("/ibc/ports/{%s}/channels/{%s}/next-sequence-recv", RestPortID, RestChannelID), queryNextSequenceRecvHandlerFn(clientCtx)).Methods("GET") -} - -// queryNextSequenceRecvHandlerFn implements a next sequence receive querying route -// -// @Summary Query next sequence receive -// @Tags IBC -// @Produce json -// @Param port-id path string true "Port ID" -// @Param channel-id path string true "Channel ID" -// @Success 200 {object} QueryNextSequenceRecv "OK" -// @Failure 400 {object} rest.ErrorResponse "Invalid port id or channel id" -// @Failure 500 {object} rest.ErrorResponse "Internal Server Error" -// @Router /ibc/ports/{port-id}/channels/{channel-id}/next-sequence-recv [get] -func queryNextSequenceRecvHandlerFn(clientCtx client.Context) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - vars := mux.Vars(r) - portID := vars[RestPortID] - channelID := vars[RestChannelID] - prove := rest.ParseQueryParamBool(r, flags.FlagProve) - - clientCtx, ok := rest.ParseQueryHeightOrReturnBadRequest(w, clientCtx, r) - if !ok { - return - } - - sequenceRes, err := utils.QueryNextSequenceRecv(clientCtx, portID, channelID, prove) - if err != nil { - rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) - return - } - - clientCtx = clientCtx.WithHeight(int64(sequenceRes.ProofHeight)) - rest.PostProcessResponse(w, clientCtx, sequenceRes) - } -} diff --git a/x/ibc-transfer/client/rest/rest.go b/x/ibc-transfer/client/rest/rest.go index 2d790698fbfa..0c9be3da84b1 100644 --- a/x/ibc-transfer/client/rest/rest.go +++ b/x/ibc-transfer/client/rest/rest.go @@ -8,14 +8,8 @@ import ( "github.com/cosmos/cosmos-sdk/types/rest" ) -const ( - RestChannelID = "channel-id" - RestPortID = "port-id" -) - // RegisterRoutes - Central function to define routes that get registered by the main application func RegisterRoutes(clientCtx client.Context, r *mux.Router) { - registerQueryRoutes(clientCtx, r) registerTxRoutes(clientCtx, r) } diff --git a/x/ibc-transfer/client/utils/utils.go b/x/ibc-transfer/client/utils/utils.go deleted file mode 100644 index 2028bd2ef747..000000000000 --- a/x/ibc-transfer/client/utils/utils.go +++ /dev/null @@ -1,33 +0,0 @@ -package utils - -import ( - "encoding/binary" - - abci "github.com/tendermint/tendermint/abci/types" - - "github.com/cosmos/cosmos-sdk/client" - channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/04-channel/types" - host "github.com/cosmos/cosmos-sdk/x/ibc/24-host" -) - -// QueryNextSequenceRecv queries the store to get the next receive sequence and -// a merkle proof. -func QueryNextSequenceRecv( - clientCtx client.Context, portID, channelID string, prove bool, -) (channeltypes.RecvResponse, error) { - req := abci.RequestQuery{ - Path: "store/ibc/key", - Data: host.KeyNextSequenceRecv(portID, channelID), - Prove: prove, - } - - res, err := clientCtx.QueryABCI(req) - if err != nil { - return channeltypes.RecvResponse{}, err - } - - sequence := binary.BigEndian.Uint64(res.Value) - sequenceRes := channeltypes.NewRecvResponse(portID, channelID, sequence, res.Proof, res.Height) - - return sequenceRes, nil -} diff --git a/x/ibc/03-connection/client/cli/query.go b/x/ibc/03-connection/client/cli/query.go index eadf0596dabc..d30a045190ee 100644 --- a/x/ibc/03-connection/client/cli/query.go +++ b/x/ibc/03-connection/client/cli/query.go @@ -30,7 +30,7 @@ func GetCmdQueryConnections(clientCtx client.Context) *cobra.Command { clientCtx = clientCtx.Init() queryClient := types.NewQueryClient(clientCtx) - req := types.QueryConnectionsRequest{ + req := &types.QueryConnectionsRequest{ Req: &query.PageRequest{}, } diff --git a/x/ibc/04-channel/client/cli/cli.go b/x/ibc/04-channel/client/cli/cli.go index 2c81e973197d..d4317f8b6e70 100644 --- a/x/ibc/04-channel/client/cli/cli.go +++ b/x/ibc/04-channel/client/cli/cli.go @@ -26,6 +26,7 @@ func GetQueryCmd(clientCtx client.Context) *cobra.Command { // TODO: Query all packet commitments // TODO: Query unrelayed packet ACKS // TODO: Query unrelayed packet sends + GetCmdQueryNextSequence(clientCtx), )...) return ics04ChannelQueryCmd diff --git a/x/ibc/04-channel/client/cli/query.go b/x/ibc/04-channel/client/cli/query.go index 4e1a78fb96bb..9ff99f1f4b23 100644 --- a/x/ibc/04-channel/client/cli/query.go +++ b/x/ibc/04-channel/client/cli/query.go @@ -41,7 +41,6 @@ func GetCmdQueryChannel(clientCtx client.Context) *cobra.Command { }, } cmd.Flags().Bool(flags.FlagProve, true, "show proofs for the query results") - return cmd } @@ -70,3 +69,33 @@ func GetCmdQueryChannelClientState(clientCtx client.Context) *cobra.Command { } return cmd } + +// GetCmdQueryNextSequence defines the command to query a next receive sequence for a given channel +func GetCmdQueryNextSequence(clientCtx client.Context) *cobra.Command { + cmd := &cobra.Command{ + Use: "next-sequence-receive [port-id] [channel-id]", + Short: "Query a next receive sequence", + Long: "Query the next receive sequence for a given channel" + Example: fmt.Sprintf( + "%s query %s %s next-sequence-receive [port-id] [channel-id]", version.ClientName, host.ModuleName, types.SubModuleName, + ), + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx = clientCtx.Init() + + portID := args[0] + channelID := args[1] + prove := viper.GetBool(flags.FlagProve) + + sequenceRes, err := utils.QueryNextSequenceReceive(clientCtx, portID, channelID, prove) + if err != nil { + return err + } + + clientCtx = clientCtx.WithHeight(int64(sequenceRes.ProofHeight)) + return clientCtx.PrintOutput(sequenceRes) + }, + } + cmd.Flags().Bool(flags.FlagProve, true, "show proofs for the query results") + return cmd +} \ No newline at end of file diff --git a/x/ibc/04-channel/client/rest/query.go b/x/ibc/04-channel/client/rest/query.go index cc296c66e769..7ac297d572ea 100644 --- a/x/ibc/04-channel/client/rest/query.go +++ b/x/ibc/04-channel/client/rest/query.go @@ -15,20 +15,9 @@ import ( func registerQueryRoutes(clientCtx client.Context, r *mux.Router) { r.HandleFunc(fmt.Sprintf("/ibc/ports/{%s}/channels/{%s}", RestPortID, RestChannelID), queryChannelHandlerFn(clientCtx)).Methods("GET") r.HandleFunc(fmt.Sprintf("/ibc/ports/{%s}/channels/{%s}/client_state", RestPortID, RestChannelID), queryChannelClientStateHandlerFn(clientCtx)).Methods("GET") + r.HandleFunc(fmt.Sprintf("/ibc/ports/{%s}/channels/{%s}/next_sequence_receive", RestPortID, RestChannelID), queryNextSequenceRecvHandlerFn(clientCtx)).Methods("GET") } -// queryChannelHandlerFn implements a channel querying route -// -// @Summary Query channel -// @Tags IBC -// @Produce json -// @Param port-id path string true "Port ID" -// @Param channel-id path string true "Channel ID" -// @Param prove query boolean false "Proof of result" -// @Success 200 {object} QueryChannel "OK" -// @Failure 400 {object} rest.ErrorResponse "Invalid port id or channel id" -// @Failure 500 {object} rest.ErrorResponse "Internal Server Error" -// @Router /ibc/ports/{port-id}/channels/{channel-id} [get] func queryChannelHandlerFn(clientCtx client.Context) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { vars := mux.Vars(r) @@ -73,3 +62,26 @@ func queryChannelClientStateHandlerFn(clientCtx client.Context) http.HandlerFunc rest.PostProcessResponse(w, clientCtx, clientState) } } + +func queryNextSequenceRecvHandlerFn(clientCtx client.Context) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + vars := mux.Vars(r) + portID := vars[RestPortID] + channelID := vars[RestChannelID] + prove := rest.ParseQueryParamBool(r, flags.FlagProve) + + clientCtx, ok := rest.ParseQueryHeightOrReturnBadRequest(w, clientCtx, r) + if !ok { + return + } + + sequenceRes, err := utils.QueryNextSequenceReceive(clientCtx, portID, channelID, prove) + if err != nil { + rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) + return + } + + clientCtx = clientCtx.WithHeight(int64(sequenceRes.ProofHeight)) + rest.PostProcessResponse(w, clientCtx, sequenceRes) + } +} diff --git a/x/ibc/04-channel/client/utils/utils.go b/x/ibc/04-channel/client/utils/utils.go index f09e5770d3e7..566134bae512 100644 --- a/x/ibc/04-channel/client/utils/utils.go +++ b/x/ibc/04-channel/client/utils/utils.go @@ -1,6 +1,7 @@ package utils import ( + "encoding/binary" "fmt" abci "github.com/tendermint/tendermint/abci/types" @@ -86,3 +87,23 @@ func QueryChannelClientState(clientCtx client.Context, portID, channelID string) } return clientState, height, nil } + +// QueryNextSequenceReceive queries the store to get the next receive sequence and +// a merkle proof. +func QueryNextSequenceReceive( + clientCtx client.Context, portID, channelID string, prove bool, +) (*types.QueryNextSequenceReceiveResponse, error) { + req := abci.RequestQuery{ + Path: "store/ibc/key", + Data: host.KeyNextSequenceRecv(portID, channelID), + Prove: prove, + } + + res, err := clientCtx.QueryABCI(req) + if err != nil { + return nil, err + } + + sequence := binary.BigEndian.Uint64(res.Value) + return types.NewQueryNextSequenceReceiveResponse(portID, channelID, sequence, res.Proof, res.Height), nil +} diff --git a/x/ibc/04-channel/types/querier.go b/x/ibc/04-channel/types/querier.go index 160f0d03cef6..fa35b0a50a19 100644 --- a/x/ibc/04-channel/types/querier.go +++ b/x/ibc/04-channel/types/querier.go @@ -42,6 +42,19 @@ func NewQueryPacketCommitmentResponse( } } +// NewQueryNextSequenceReceiveResponse creates a new QueryNextSequenceReceiveResponse instance +func NewQueryNextSequenceReceiveResponse( + portID, channelID string, sequence uint64, proof []byte, height int64, +) *QueryNextSequenceReceiveResponse { + path := commitmenttypes.NewMerklePath(strings.Split(host.NextSequenceRecvPath(portID, channelID), "/")) + return &QueryNextSequenceReceiveResponse{ + NextSequenceReceive: sequence, + Proof: proof, + ProofPath: path.Pretty(), + ProofHeight: uint64(height), + } +} + // NewQueryChannelClientStateRequest creates a new QueryChannelClientStateRequest instance. func NewQueryChannelClientStateRequest(portID, channelID string) *QueryChannelClientStateRequest { return &QueryChannelClientStateRequest{ diff --git a/x/ibc/04-channel/types/query.pb.go b/x/ibc/04-channel/types/query.pb.go index 184538568c1f..a815094501f6 100644 --- a/x/ibc/04-channel/types/query.pb.go +++ b/x/ibc/04-channel/types/query.pb.go @@ -789,6 +789,134 @@ func (m *QueryUnrelayedPacketsResponse) GetHeight() int64 { return 0 } +// QueryNextSequenceReceiveRequest is the request type for the Query/QueryNextSequenceReceiveRequest RPC method +type QueryNextSequenceReceiveRequest 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 *QueryNextSequenceReceiveRequest) Reset() { *m = QueryNextSequenceReceiveRequest{} } +func (m *QueryNextSequenceReceiveRequest) String() string { return proto.CompactTextString(m) } +func (*QueryNextSequenceReceiveRequest) ProtoMessage() {} +func (*QueryNextSequenceReceiveRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2150995751d4f15a, []int{12} +} +func (m *QueryNextSequenceReceiveRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryNextSequenceReceiveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryNextSequenceReceiveRequest.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 *QueryNextSequenceReceiveRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryNextSequenceReceiveRequest.Merge(m, src) +} +func (m *QueryNextSequenceReceiveRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryNextSequenceReceiveRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryNextSequenceReceiveRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryNextSequenceReceiveRequest proto.InternalMessageInfo + +func (m *QueryNextSequenceReceiveRequest) GetPortID() string { + if m != nil { + return m.PortID + } + return "" +} + +func (m *QueryNextSequenceReceiveRequest) GetChannelID() string { + if m != nil { + return m.ChannelID + } + return "" +} + +// QuerySequenceResponse is the request type for the Query/QueryNextSequenceReceiveResponse RPC method +type QueryNextSequenceReceiveResponse struct { + // next sequence receive number + NextSequenceReceive uint64 `protobuf:"varint,1,opt,name=next_sequence_receive,json=nextSequenceReceive,proto3" json:"next_sequence_receive,omitempty"` + // merkle proof of existence + Proof []byte `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` + // merkle proof path + ProofPath string `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 *QueryNextSequenceReceiveResponse) Reset() { *m = QueryNextSequenceReceiveResponse{} } +func (m *QueryNextSequenceReceiveResponse) String() string { return proto.CompactTextString(m) } +func (*QueryNextSequenceReceiveResponse) ProtoMessage() {} +func (*QueryNextSequenceReceiveResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2150995751d4f15a, []int{13} +} +func (m *QueryNextSequenceReceiveResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryNextSequenceReceiveResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryNextSequenceReceiveResponse.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 *QueryNextSequenceReceiveResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryNextSequenceReceiveResponse.Merge(m, src) +} +func (m *QueryNextSequenceReceiveResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryNextSequenceReceiveResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryNextSequenceReceiveResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryNextSequenceReceiveResponse proto.InternalMessageInfo + +func (m *QueryNextSequenceReceiveResponse) GetNextSequenceReceive() uint64 { + if m != nil { + return m.NextSequenceReceive + } + return 0 +} + +func (m *QueryNextSequenceReceiveResponse) GetProof() []byte { + if m != nil { + return m.Proof + } + return nil +} + +func (m *QueryNextSequenceReceiveResponse) GetProofPath() string { + if m != nil { + return m.ProofPath + } + return "" +} + +func (m *QueryNextSequenceReceiveResponse) GetProofHeight() uint64 { + if m != nil { + return m.ProofHeight + } + return 0 +} + // QueryChannelClientStateRequest is the request type for the Query/ClientState RPC method type QueryChannelClientStateRequest struct { // port unique identifier @@ -801,7 +929,7 @@ func (m *QueryChannelClientStateRequest) Reset() { *m = QueryChannelClie func (m *QueryChannelClientStateRequest) String() string { return proto.CompactTextString(m) } func (*QueryChannelClientStateRequest) ProtoMessage() {} func (*QueryChannelClientStateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2150995751d4f15a, []int{12} + return fileDescriptor_2150995751d4f15a, []int{14} } func (m *QueryChannelClientStateRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -857,61 +985,67 @@ func init() { proto.RegisterType((*QueryPacketCommitmentsResponse)(nil), "ibc.channel.QueryPacketCommitmentsResponse") proto.RegisterType((*QueryUnrelayedPacketsRequest)(nil), "ibc.channel.QueryUnrelayedPacketsRequest") proto.RegisterType((*QueryUnrelayedPacketsResponse)(nil), "ibc.channel.QueryUnrelayedPacketsResponse") + proto.RegisterType((*QueryNextSequenceReceiveRequest)(nil), "ibc.channel.QueryNextSequenceReceiveRequest") + proto.RegisterType((*QueryNextSequenceReceiveResponse)(nil), "ibc.channel.QueryNextSequenceReceiveResponse") proto.RegisterType((*QueryChannelClientStateRequest)(nil), "ibc.channel.QueryChannelClientStateRequest") } func init() { proto.RegisterFile("ibc/channel/query.proto", fileDescriptor_2150995751d4f15a) } var fileDescriptor_2150995751d4f15a = []byte{ - // 761 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0xcd, 0x6e, 0xd3, 0x4a, - 0x14, 0x8e, 0x9b, 0x34, 0x69, 0x4e, 0x7a, 0xa5, 0x7b, 0xe7, 0x06, 0x48, 0xad, 0xd6, 0x4d, 0xcd, - 0x26, 0xd0, 0xd6, 0x41, 0x29, 0x2b, 0x76, 0x34, 0x5d, 0x90, 0x05, 0x52, 0x70, 0xc5, 0x86, 0x4d, - 0xe5, 0x38, 0xd3, 0xc4, 0x4a, 0xe3, 0x71, 0x32, 0x53, 0x89, 0xae, 0x78, 0x02, 0x24, 0x76, 0x88, - 0x0d, 0x2c, 0xd8, 0xf1, 0x0c, 0x3c, 0x00, 0xcb, 0x2e, 0x59, 0x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0x11, 0xa0, - 0xf9, 0xe3, 0x17, 0xed, 0x2e, 0x58, 0x9b, 0xf4, 0x53, 0xd0, 0xf7, 0xd2, 0x81, 0xa3, 0x92, 0x03, - 0xf8, 0x77, 0x76, 0xff, 0xa1, 0x47, 0xf3, 0x39, 0x12, 0xce, 0x5b, 0xfd, 0x71, 0x1a, 0x68, 0x54, - 0xcc, 0x87, 0xff, 0xe6, 0x36, 0x3b, 0x4a, 0x91, 0x22, 0x52, 0xb7, 0x9b, 0x0a, 0x1b, 0x17, 0x37, - 0xdb, 0xf1, 0x8b, 0xc4, 0x25, 0xec, 0xe9, 0x45, 0xe2, 0x92, 0x36, 0x90, 0x99, 0x39, 0x7c, 0xf9, - 0x63, 0x62, 0x68, 0x97, 0x13, 0x43, 0xfb, 0x35, 0x31, 0xb4, 0x0f, 0xd7, 0x46, 0xe6, 0xf2, 0xda, - 0xc8, 0xfc, 0xbc, 0x36, 0x32, 0x6f, 0x0e, 0x7a, 0x1e, 0xeb, 0x9f, 0x77, 0x2c, 0x97, 0x0c, 0xeb, - 0xf2, 0xee, 0x27, 0x1e, 0xfb, 0xb4, 0x3b, 0xa8, 0xbf, 0xad, 0x87, 0x17, 0xbe, 0x27, 0x4f, 0xf7, - 0xd5, 0x9d, 0x8f, 0x5d, 0x04, 0x98, 0x76, 0xf2, 0xfc, 0xca, 0x77, 0xf0, 0x27, 0x00, 0x00, 0xff, - 0xff, 0x2a, 0x07, 0x9b, 0xff, 0x6a, 0x0a, 0x00, 0x00, + // 827 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0xbd, 0x72, 0xd3, 0x4a, + 0x14, 0xb6, 0x62, 0xc7, 0x8e, 0x8f, 0x73, 0x67, 0xee, 0xdd, 0x38, 0x17, 0x47, 0x93, 0x28, 0x8e, + 0x68, 0x0c, 0x49, 0x64, 0xc6, 0xa1, 0xa2, 0x23, 0x4e, 0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 0xf5, 0xf3, 0x5a, 0x4b, 0xbd, 0x3e, 0xe8, 0x3a, 0xb4, 0x77, 0xd6, 0x36, 0x6c, 0x6f, + 0x50, 0x15, 0x0f, 0x73, 0xfe, 0xd9, 0x27, 0x9d, 0x7e, 0xf5, 0xbc, 0x1a, 0xbe, 0xc6, 0x1f, 0x3d, + 0xde, 0x97, 0x0f, 0x72, 0x7a, 0xe1, 0x63, 0xd2, 0xce, 0xb2, 0xf7, 0xf8, 0xc1, 0x9f, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xdf, 0x68, 0xc7, 0x94, 0x07, 0x0c, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -938,6 +1072,8 @@ type QueryClient interface { PacketCommitments(ctx context.Context, in *QueryPacketCommitmentsRequest, opts ...grpc.CallOption) (*QueryPacketCommitmentsResponse, error) // UnrelayedPackets returns all the unrelayed IBC packets associated with a channel and sequences. UnrelayedPackets(ctx context.Context, in *QueryUnrelayedPacketsRequest, opts ...grpc.CallOption) (*QueryUnrelayedPacketsResponse, error) + // NextSequenceReceive returns the next receive sequence for a given channel + NextSequenceReceive(ctx context.Context, in *QueryNextSequenceReceiveRequest, opts ...grpc.CallOption) (*QueryNextSequenceReceiveResponse, error) } type queryClient struct { @@ -1002,6 +1138,15 @@ func (c *queryClient) UnrelayedPackets(ctx context.Context, in *QueryUnrelayedPa return out, nil } +func (c *queryClient) NextSequenceReceive(ctx context.Context, in *QueryNextSequenceReceiveRequest, opts ...grpc.CallOption) (*QueryNextSequenceReceiveResponse, error) { + out := new(QueryNextSequenceReceiveResponse) + err := c.cc.Invoke(ctx, "/ibc.channel.Query/NextSequenceReceive", 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. @@ -1016,6 +1161,8 @@ type QueryServer interface { PacketCommitments(context.Context, *QueryPacketCommitmentsRequest) (*QueryPacketCommitmentsResponse, error) // UnrelayedPackets returns all the unrelayed IBC packets associated with a channel and sequences. UnrelayedPackets(context.Context, *QueryUnrelayedPacketsRequest) (*QueryUnrelayedPacketsResponse, error) + // NextSequenceReceive returns the next receive sequence for a given channel + NextSequenceReceive(context.Context, *QueryNextSequenceReceiveRequest) (*QueryNextSequenceReceiveResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1040,6 +1187,9 @@ func (*UnimplementedQueryServer) PacketCommitments(ctx context.Context, req *Que func (*UnimplementedQueryServer) UnrelayedPackets(ctx context.Context, req *QueryUnrelayedPacketsRequest) (*QueryUnrelayedPacketsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UnrelayedPackets not implemented") } +func (*UnimplementedQueryServer) NextSequenceReceive(ctx context.Context, req *QueryNextSequenceReceiveRequest) (*QueryNextSequenceReceiveResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NextSequenceReceive not implemented") +} func RegisterQueryServer(s *grpc.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1153,6 +1303,24 @@ func _Query_UnrelayedPackets_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _Query_NextSequenceReceive_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryNextSequenceReceiveRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).NextSequenceReceive(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.channel.Query/NextSequenceReceive", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).NextSequenceReceive(ctx, req.(*QueryNextSequenceReceiveRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "ibc.channel.Query", HandlerType: (*QueryServer)(nil), @@ -1181,6 +1349,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "UnrelayedPackets", Handler: _Query_UnrelayedPackets_Handler, }, + { + MethodName: "NextSequenceReceive", + Handler: _Query_NextSequenceReceive_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "ibc/channel/query.proto", @@ -1781,6 +1953,90 @@ func (m *QueryUnrelayedPacketsResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *QueryNextSequenceReceiveRequest) 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 *QueryNextSequenceReceiveRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryNextSequenceReceiveRequest) 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 *QueryNextSequenceReceiveResponse) 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 *QueryNextSequenceReceiveResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryNextSequenceReceiveResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProofHeight != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProofHeight)) + i-- + dAtA[i] = 0x20 + } + if len(m.ProofPath) > 0 { + i -= len(m.ProofPath) + copy(dAtA[i:], m.ProofPath) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ProofPath))) + 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.NextSequenceReceive != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.NextSequenceReceive)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *QueryChannelClientStateRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2082,6 +2338,46 @@ func (m *QueryUnrelayedPacketsResponse) Size() (n int) { return n } +func (m *QueryNextSequenceReceiveRequest) 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 *QueryNextSequenceReceiveResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NextSequenceReceive != 0 { + n += 1 + sovQuery(uint64(m.NextSequenceReceive)) + } + l = len(m.Proof) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.ProofPath) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.ProofHeight != 0 { + n += 1 + sovQuery(uint64(m.ProofHeight)) + } + return n +} + func (m *QueryChannelClientStateRequest) Size() (n int) { if m == nil { return 0 @@ -3906,6 +4202,280 @@ func (m *QueryUnrelayedPacketsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryNextSequenceReceiveRequest) 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: QueryNextSequenceReceiveRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryNextSequenceReceiveRequest: 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 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryNextSequenceReceiveResponse) 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: QueryNextSequenceReceiveResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryNextSequenceReceiveResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NextSequenceReceive", wireType) + } + m.NextSequenceReceive = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NextSequenceReceive |= 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 ProofPath", 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.ProofPath = string(dAtA[iNdEx:postIndex]) + 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 ErrIntOverflowQuery + } + 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 := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *QueryChannelClientStateRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0