From 82e7b9ec1d6238af6f82253d4cd812810620cda9 Mon Sep 17 00:00:00 2001 From: atheesh Date: Fri, 16 Oct 2020 00:38:31 +0530 Subject: [PATCH 01/12] WIP: Refactor x/ibc to ADR 031 --- proto/ibc/core/client/v1/client.proto | 101 +- proto/ibc/core/connection/v1/connection.proto | 27 + x/ibc/core/02-client/types/client.pb.go | 2164 +++++++++++------ .../core/03-connection/types/connection.pb.go | 860 ++++++- x/ibc/core/handler.go | 27 +- x/ibc/core/keeper/msg_server.go | 243 ++ 6 files changed, 2564 insertions(+), 858 deletions(-) create mode 100644 x/ibc/core/keeper/msg_server.go diff --git a/proto/ibc/core/client/v1/client.proto b/proto/ibc/core/client/v1/client.proto index 4a6f8320e847..118318c246c8 100644 --- a/proto/ibc/core/client/v1/client.proto +++ b/proto/ibc/core/client/v1/client.proto @@ -6,46 +6,19 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types"; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; -// IdentifiedClientState defines a client state with an additional client -// identifier field. -message IdentifiedClientState { - // client identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // client state - google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""]; -} +// Msg defines the ibc/client Msg service. +service Msg { + // CreateClient defines a rpc handler method for MsgCreateClient. + rpc CreateClient(MsgCreateClient) returns (MsgCreateClientResponse); -// ConsensusStateWithHeight defines a consensus state with an additional height field. -message ConsensusStateWithHeight { - // consensus state height - Height height = 1 [(gogoproto.nullable) = false]; - // consensus state - google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml\"consensus_state\""]; -} + // UpdateClient defines a rpc handler method for MsgUpdateClient. + rpc UpdateClient(MsgUpdateClient) returns (MsgUpdateClientResponse); -// ClientConsensusStates defines all the stored consensus states for a given -// client. -message ClientConsensusStates { - // client identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // consensus states and their heights associated with the client - repeated ConsensusStateWithHeight consensus_states = 2 - [(gogoproto.moretags) = "yaml:\"consensus_states\"", (gogoproto.nullable) = false]; -} + // UpgradeClient defines a rpc handler method for MsgUpgradeClient. + rpc UpgradeClient(MsgUpgradeClient) returns (MsgUpgradeClientResponse); -// ClientUpdateProposal is a governance proposal. If it passes, the client is -// updated with the provided header. The update may fail if the header is not -// valid given certain conditions specified by the client implementation. -message ClientUpdateProposal { - option (gogoproto.goproto_getters) = false; - // the title of the update proposal - string title = 1; - // the description of the proposal - string description = 2; - // the client identifier for the client to be updated if the proposal passes - string client_id = 3 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // the header used to update the client if the proposal passes - google.protobuf.Any header = 4; + // SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. + rpc SubmitMisbehaviour(MsgSubmitMisbehaviour) returns (MsgSubmitMisbehaviourResponse); } // MsgCreateClient defines a message to create an IBC client @@ -64,6 +37,9 @@ message MsgCreateClient { string signer = 4; } +// MsgCreateClientResponse defines the Msg/CreateClient response type. +message MsgCreateClientResponse { } + // MsgUpdateClient defines an sdk.Msg to update a IBC client state using // the given header. message MsgUpdateClient { @@ -78,6 +54,9 @@ message MsgUpdateClient { string signer = 3; } +// MsgUpdateClientResponse defines the Msg/UpdateClient response type. +message MsgUpdateClientResponse { } + // MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client state message MsgUpgradeClient { // client unique identifier @@ -92,6 +71,9 @@ message MsgUpgradeClient { string signer = 5; } +// MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. +message MsgUpgradeClientResponse { } + // MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for // light client misbehaviour. message MsgSubmitMisbehaviour { @@ -106,6 +88,51 @@ message MsgSubmitMisbehaviour { string signer = 3; } +// MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response type. +message MsgSubmitMisbehaviourResponse { } + +// IdentifiedClientState defines a client state with an additional client +// identifier field. +message IdentifiedClientState { + // client identifier + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + // client state + google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""]; +} + +// ConsensusStateWithHeight defines a consensus state with an additional height field. +message ConsensusStateWithHeight { + // consensus state height + Height height = 1 [(gogoproto.nullable) = false]; + // consensus state + google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml\"consensus_state\""]; +} + +// ClientConsensusStates defines all the stored consensus states for a given +// client. +message ClientConsensusStates { + // client identifier + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + // consensus states and their heights associated with the client + repeated ConsensusStateWithHeight consensus_states = 2 + [(gogoproto.moretags) = "yaml:\"consensus_states\"", (gogoproto.nullable) = false]; +} + +// ClientUpdateProposal is a governance proposal. If it passes, the client is +// updated with the provided header. The update may fail if the header is not +// valid given certain conditions specified by the client implementation. +message ClientUpdateProposal { + option (gogoproto.goproto_getters) = false; + // the title of the update proposal + string title = 1; + // the description of the proposal + string description = 2; + // the client identifier for the client to be updated if the proposal passes + string client_id = 3 [(gogoproto.moretags) = "yaml:\"client_id\""]; + // the header used to update the client if the proposal passes + google.protobuf.Any header = 4; +} + // Height is a monotonically increasing data type // that can be compared against another Height for the purposes of updating and // freezing clients diff --git a/proto/ibc/core/connection/v1/connection.proto b/proto/ibc/core/connection/v1/connection.proto index 368859d3b93c..5b0dd2fe5d41 100644 --- a/proto/ibc/core/connection/v1/connection.proto +++ b/proto/ibc/core/connection/v1/connection.proto @@ -8,6 +8,21 @@ import "google/protobuf/any.proto"; import "ibc/core/commitment/v1/commitment.proto"; import "ibc/core/client/v1/client.proto"; +// Msg defines the ibc/connection Msg service. +service Msg { + // ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. + rpc ConnectionOpenInit(MsgConnectionOpenInit) returns (MsgConnectionOpenInitResponse); + + // ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. + rpc ConnectionOpenTry(MsgConnectionOpenTry) returns (MsgConnectionOpenTryResponse); + + // ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. + rpc ConnectionOpenAck(MsgConnectionOpenAck) returns (MsgConnectionOpenAckResponse); + + // ConnectionOpenConfirm defines a rpc handler method for MsgConnectionOpenConfirm. + rpc ConnectionOpenConfirm(MsgConnectionOpenConfirm) returns (MsgConnectionOpenConfirmResponse); +} + // MsgConnectionOpenInit defines the msg sent by an account on Chain A to // initialize a connection with Chain B. message MsgConnectionOpenInit { @@ -21,6 +36,9 @@ message MsgConnectionOpenInit { string signer = 5; } +// MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response type. +message MsgConnectionOpenInitResponse { } + // MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a // connection on Chain B. message MsgConnectionOpenTry { @@ -47,6 +65,9 @@ message MsgConnectionOpenTry { string signer = 12; } +// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. +message MsgConnectionOpenTryResponse { } + // MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to // acknowledge the change of connection state to TRYOPEN on Chain B. message MsgConnectionOpenAck { @@ -71,6 +92,9 @@ message MsgConnectionOpenAck { string signer = 10; } +// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. +message MsgConnectionOpenAckResponse { } + // MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to // acknowledge the change of connection state to OPEN on Chain A. message MsgConnectionOpenConfirm { @@ -85,6 +109,9 @@ message MsgConnectionOpenConfirm { string signer = 4; } +// MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm response type. +message MsgConnectionOpenConfirmResponse { } + // ICS03 - Connection Data Structures as defined in // https://github.com/cosmos/ics/tree/master/spec/ics-003-connection-semantics#data-structures diff --git a/x/ibc/core/02-client/types/client.pb.go b/x/ibc/core/02-client/types/client.pb.go index f70ceca58c94..601a1d7686e1 100644 --- a/x/ibc/core/02-client/types/client.pb.go +++ b/x/ibc/core/02-client/types/client.pb.go @@ -4,10 +4,15 @@ package types import ( + context "context" fmt "fmt" types "github.com/cosmos/cosmos-sdk/codec/types" + grpc1 "github.com/gogo/protobuf/grpc" _ "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" @@ -24,6 +29,370 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// MsgCreateClient defines a message to create an IBC client +type MsgCreateClient struct { + // client unique identifier + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` + // light client state + ClientState *types.Any `protobuf:"bytes,2,opt,name=client_state,json=clientState,proto3" json:"client_state,omitempty" yaml:"client_state"` + // consensus state associated with the client that corresponds to a given + // height. + ConsensusState *types.Any `protobuf:"bytes,3,opt,name=consensus_state,json=consensusState,proto3" json:"consensus_state,omitempty" yaml:"consensus_state"` + // signer address + Signer string `protobuf:"bytes,4,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgCreateClient) Reset() { *m = MsgCreateClient{} } +func (m *MsgCreateClient) String() string { return proto.CompactTextString(m) } +func (*MsgCreateClient) ProtoMessage() {} +func (*MsgCreateClient) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{0} +} +func (m *MsgCreateClient) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateClient) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateClient.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 *MsgCreateClient) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateClient.Merge(m, src) +} +func (m *MsgCreateClient) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateClient) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateClient.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateClient proto.InternalMessageInfo + +// MsgCreateClientResponse defines the Msg/CreateClient response type. +type MsgCreateClientResponse struct { +} + +func (m *MsgCreateClientResponse) Reset() { *m = MsgCreateClientResponse{} } +func (m *MsgCreateClientResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateClientResponse) ProtoMessage() {} +func (*MsgCreateClientResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{1} +} +func (m *MsgCreateClientResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateClientResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateClientResponse.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 *MsgCreateClientResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateClientResponse.Merge(m, src) +} +func (m *MsgCreateClientResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateClientResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateClientResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateClientResponse proto.InternalMessageInfo + +// MsgUpdateClient defines an sdk.Msg to update a IBC client state using +// the given header. +type MsgUpdateClient struct { + // client unique identifier + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` + // header to update the light client + Header *types.Any `protobuf:"bytes,2,opt,name=header,proto3" json:"header,omitempty"` + // signer address + Signer string `protobuf:"bytes,3,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgUpdateClient) Reset() { *m = MsgUpdateClient{} } +func (m *MsgUpdateClient) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateClient) ProtoMessage() {} +func (*MsgUpdateClient) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{2} +} +func (m *MsgUpdateClient) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateClient) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateClient.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 *MsgUpdateClient) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateClient.Merge(m, src) +} +func (m *MsgUpdateClient) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateClient) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateClient.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateClient proto.InternalMessageInfo + +// MsgUpdateClientResponse defines the Msg/UpdateClient response type. +type MsgUpdateClientResponse struct { +} + +func (m *MsgUpdateClientResponse) Reset() { *m = MsgUpdateClientResponse{} } +func (m *MsgUpdateClientResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateClientResponse) ProtoMessage() {} +func (*MsgUpdateClientResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{3} +} +func (m *MsgUpdateClientResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateClientResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateClientResponse.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 *MsgUpdateClientResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateClientResponse.Merge(m, src) +} +func (m *MsgUpdateClientResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateClientResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateClientResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateClientResponse proto.InternalMessageInfo + +// MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client state +type MsgUpgradeClient struct { + // client unique identifier + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` + // upgraded client state + ClientState *types.Any `protobuf:"bytes,2,opt,name=client_state,json=clientState,proto3" json:"client_state,omitempty" yaml:"client_state"` + // height at which old chain halts and upgrades (i.e last block executed) + UpgradeHeight *Height `protobuf:"bytes,3,opt,name=upgrade_height,json=upgradeHeight,proto3" json:"upgrade_height,omitempty" yaml:"upgrade_height"` + // proof that old chain committed to new client + ProofUpgrade []byte `protobuf:"bytes,4,opt,name=proof_upgrade,json=proofUpgrade,proto3" json:"proof_upgrade,omitempty" yaml:"proof_upgrade"` + // signer address + Signer string `protobuf:"bytes,5,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgUpgradeClient) Reset() { *m = MsgUpgradeClient{} } +func (m *MsgUpgradeClient) String() string { return proto.CompactTextString(m) } +func (*MsgUpgradeClient) ProtoMessage() {} +func (*MsgUpgradeClient) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{4} +} +func (m *MsgUpgradeClient) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpgradeClient) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpgradeClient.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 *MsgUpgradeClient) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpgradeClient.Merge(m, src) +} +func (m *MsgUpgradeClient) XXX_Size() int { + return m.Size() +} +func (m *MsgUpgradeClient) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpgradeClient.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpgradeClient proto.InternalMessageInfo + +func (m *MsgUpgradeClient) GetClientId() string { + if m != nil { + return m.ClientId + } + return "" +} + +func (m *MsgUpgradeClient) GetClientState() *types.Any { + if m != nil { + return m.ClientState + } + return nil +} + +func (m *MsgUpgradeClient) GetUpgradeHeight() *Height { + if m != nil { + return m.UpgradeHeight + } + return nil +} + +func (m *MsgUpgradeClient) GetProofUpgrade() []byte { + if m != nil { + return m.ProofUpgrade + } + return nil +} + +func (m *MsgUpgradeClient) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +// MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. +type MsgUpgradeClientResponse struct { +} + +func (m *MsgUpgradeClientResponse) Reset() { *m = MsgUpgradeClientResponse{} } +func (m *MsgUpgradeClientResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpgradeClientResponse) ProtoMessage() {} +func (*MsgUpgradeClientResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{5} +} +func (m *MsgUpgradeClientResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpgradeClientResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpgradeClientResponse.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 *MsgUpgradeClientResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpgradeClientResponse.Merge(m, src) +} +func (m *MsgUpgradeClientResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpgradeClientResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpgradeClientResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpgradeClientResponse proto.InternalMessageInfo + +// MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for +// light client misbehaviour. +type MsgSubmitMisbehaviour struct { + // client unique identifier + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` + // misbehaviour used for freezing the light client + Misbehaviour *types.Any `protobuf:"bytes,2,opt,name=misbehaviour,proto3" json:"misbehaviour,omitempty"` + // signer address + Signer string `protobuf:"bytes,3,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgSubmitMisbehaviour) Reset() { *m = MsgSubmitMisbehaviour{} } +func (m *MsgSubmitMisbehaviour) String() string { return proto.CompactTextString(m) } +func (*MsgSubmitMisbehaviour) ProtoMessage() {} +func (*MsgSubmitMisbehaviour) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{6} +} +func (m *MsgSubmitMisbehaviour) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubmitMisbehaviour) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSubmitMisbehaviour.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 *MsgSubmitMisbehaviour) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubmitMisbehaviour.Merge(m, src) +} +func (m *MsgSubmitMisbehaviour) XXX_Size() int { + return m.Size() +} +func (m *MsgSubmitMisbehaviour) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubmitMisbehaviour.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubmitMisbehaviour proto.InternalMessageInfo + +// MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response type. +type MsgSubmitMisbehaviourResponse struct { +} + +func (m *MsgSubmitMisbehaviourResponse) Reset() { *m = MsgSubmitMisbehaviourResponse{} } +func (m *MsgSubmitMisbehaviourResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSubmitMisbehaviourResponse) ProtoMessage() {} +func (*MsgSubmitMisbehaviourResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{7} +} +func (m *MsgSubmitMisbehaviourResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubmitMisbehaviourResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSubmitMisbehaviourResponse.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 *MsgSubmitMisbehaviourResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubmitMisbehaviourResponse.Merge(m, src) +} +func (m *MsgSubmitMisbehaviourResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSubmitMisbehaviourResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubmitMisbehaviourResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubmitMisbehaviourResponse proto.InternalMessageInfo + // IdentifiedClientState defines a client state with an additional client // identifier field. type IdentifiedClientState struct { @@ -37,7 +406,7 @@ func (m *IdentifiedClientState) Reset() { *m = IdentifiedClientState{} } func (m *IdentifiedClientState) String() string { return proto.CompactTextString(m) } func (*IdentifiedClientState) ProtoMessage() {} func (*IdentifiedClientState) Descriptor() ([]byte, []int) { - return fileDescriptor_b6bc4c8185546947, []int{0} + return fileDescriptor_b6bc4c8185546947, []int{8} } func (m *IdentifiedClientState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -92,7 +461,7 @@ func (m *ConsensusStateWithHeight) Reset() { *m = ConsensusStateWithHeig func (m *ConsensusStateWithHeight) String() string { return proto.CompactTextString(m) } func (*ConsensusStateWithHeight) ProtoMessage() {} func (*ConsensusStateWithHeight) Descriptor() ([]byte, []int) { - return fileDescriptor_b6bc4c8185546947, []int{1} + return fileDescriptor_b6bc4c8185546947, []int{9} } func (m *ConsensusStateWithHeight) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -148,7 +517,7 @@ func (m *ClientConsensusStates) Reset() { *m = ClientConsensusStates{} } func (m *ClientConsensusStates) String() string { return proto.CompactTextString(m) } func (*ClientConsensusStates) ProtoMessage() {} func (*ClientConsensusStates) Descriptor() ([]byte, []int) { - return fileDescriptor_b6bc4c8185546947, []int{2} + return fileDescriptor_b6bc4c8185546947, []int{10} } func (m *ClientConsensusStates) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -209,7 +578,7 @@ func (m *ClientUpdateProposal) Reset() { *m = ClientUpdateProposal{} } func (m *ClientUpdateProposal) String() string { return proto.CompactTextString(m) } func (*ClientUpdateProposal) ProtoMessage() {} func (*ClientUpdateProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_b6bc4c8185546947, []int{3} + return fileDescriptor_b6bc4c8185546947, []int{11} } func (m *ClientUpdateProposal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -238,31 +607,33 @@ func (m *ClientUpdateProposal) XXX_DiscardUnknown() { var xxx_messageInfo_ClientUpdateProposal proto.InternalMessageInfo -// MsgCreateClient defines a message to create an IBC client -type MsgCreateClient struct { - // client unique identifier - ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` - // light client state - ClientState *types.Any `protobuf:"bytes,2,opt,name=client_state,json=clientState,proto3" json:"client_state,omitempty" yaml:"client_state"` - // consensus state associated with the client that corresponds to a given - // height. - ConsensusState *types.Any `protobuf:"bytes,3,opt,name=consensus_state,json=consensusState,proto3" json:"consensus_state,omitempty" yaml:"consensus_state"` - // signer address - Signer string `protobuf:"bytes,4,opt,name=signer,proto3" json:"signer,omitempty"` +// Height is a monotonically increasing data type +// that can be compared against another Height for the purposes of updating and +// freezing clients +// +// Normally the VersionHeight is incremented at each height while keeping version +// number the same However some consensus algorithms may choose to reset the +// height in certain conditions e.g. hard forks, state-machine breaking changes +// In these cases, the version number is incremented so that height continues to +// be monitonically increasing even as the VersionHeight gets reset +type Height struct { + // the version that the client is currently on + VersionNumber uint64 `protobuf:"varint,1,opt,name=version_number,json=versionNumber,proto3" json:"version_number,omitempty" yaml:"version_number"` + // the height within the given version + VersionHeight uint64 `protobuf:"varint,2,opt,name=version_height,json=versionHeight,proto3" json:"version_height,omitempty" yaml:"version_height"` } -func (m *MsgCreateClient) Reset() { *m = MsgCreateClient{} } -func (m *MsgCreateClient) String() string { return proto.CompactTextString(m) } -func (*MsgCreateClient) ProtoMessage() {} -func (*MsgCreateClient) Descriptor() ([]byte, []int) { - return fileDescriptor_b6bc4c8185546947, []int{4} +func (m *Height) Reset() { *m = Height{} } +func (*Height) ProtoMessage() {} +func (*Height) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{12} } -func (m *MsgCreateClient) XXX_Unmarshal(b []byte) error { +func (m *Height) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgCreateClient) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Height) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgCreateClient.Marshal(b, m, deterministic) + return xxx_messageInfo_Height.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -272,300 +643,289 @@ func (m *MsgCreateClient) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return b[:n], nil } } -func (m *MsgCreateClient) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreateClient.Merge(m, src) +func (m *Height) XXX_Merge(src proto.Message) { + xxx_messageInfo_Height.Merge(m, src) } -func (m *MsgCreateClient) XXX_Size() int { +func (m *Height) XXX_Size() int { return m.Size() } -func (m *MsgCreateClient) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreateClient.DiscardUnknown(m) +func (m *Height) XXX_DiscardUnknown() { + xxx_messageInfo_Height.DiscardUnknown(m) } -var xxx_messageInfo_MsgCreateClient proto.InternalMessageInfo - -// MsgUpdateClient defines an sdk.Msg to update a IBC client state using -// the given header. -type MsgUpdateClient struct { - // client unique identifier - ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` - // header to update the light client - Header *types.Any `protobuf:"bytes,2,opt,name=header,proto3" json:"header,omitempty"` - // signer address - Signer string `protobuf:"bytes,3,opt,name=signer,proto3" json:"signer,omitempty"` -} +var xxx_messageInfo_Height proto.InternalMessageInfo -func (m *MsgUpdateClient) Reset() { *m = MsgUpdateClient{} } -func (m *MsgUpdateClient) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateClient) ProtoMessage() {} -func (*MsgUpdateClient) Descriptor() ([]byte, []int) { - return fileDescriptor_b6bc4c8185546947, []int{5} -} -func (m *MsgUpdateClient) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateClient) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateClient.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 *MsgUpdateClient) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateClient.Merge(m, src) -} -func (m *MsgUpdateClient) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateClient) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateClient.DiscardUnknown(m) +func init() { + proto.RegisterType((*MsgCreateClient)(nil), "ibc.core.client.v1.MsgCreateClient") + proto.RegisterType((*MsgCreateClientResponse)(nil), "ibc.core.client.v1.MsgCreateClientResponse") + proto.RegisterType((*MsgUpdateClient)(nil), "ibc.core.client.v1.MsgUpdateClient") + proto.RegisterType((*MsgUpdateClientResponse)(nil), "ibc.core.client.v1.MsgUpdateClientResponse") + proto.RegisterType((*MsgUpgradeClient)(nil), "ibc.core.client.v1.MsgUpgradeClient") + proto.RegisterType((*MsgUpgradeClientResponse)(nil), "ibc.core.client.v1.MsgUpgradeClientResponse") + proto.RegisterType((*MsgSubmitMisbehaviour)(nil), "ibc.core.client.v1.MsgSubmitMisbehaviour") + proto.RegisterType((*MsgSubmitMisbehaviourResponse)(nil), "ibc.core.client.v1.MsgSubmitMisbehaviourResponse") + proto.RegisterType((*IdentifiedClientState)(nil), "ibc.core.client.v1.IdentifiedClientState") + proto.RegisterType((*ConsensusStateWithHeight)(nil), "ibc.core.client.v1.ConsensusStateWithHeight") + proto.RegisterType((*ClientConsensusStates)(nil), "ibc.core.client.v1.ClientConsensusStates") + proto.RegisterType((*ClientUpdateProposal)(nil), "ibc.core.client.v1.ClientUpdateProposal") + proto.RegisterType((*Height)(nil), "ibc.core.client.v1.Height") } -var xxx_messageInfo_MsgUpdateClient proto.InternalMessageInfo +func init() { proto.RegisterFile("ibc/core/client/v1/client.proto", fileDescriptor_b6bc4c8185546947) } -// MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client state -type MsgUpgradeClient struct { - // client unique identifier - ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` - // upgraded client state - ClientState *types.Any `protobuf:"bytes,2,opt,name=client_state,json=clientState,proto3" json:"client_state,omitempty" yaml:"client_state"` - // height at which old chain halts and upgrades (i.e last block executed) - UpgradeHeight *Height `protobuf:"bytes,3,opt,name=upgrade_height,json=upgradeHeight,proto3" json:"upgrade_height,omitempty" yaml:"upgrade_height"` - // proof that old chain committed to new client - ProofUpgrade []byte `protobuf:"bytes,4,opt,name=proof_upgrade,json=proofUpgrade,proto3" json:"proof_upgrade,omitempty" yaml:"proof_upgrade"` - // signer address - Signer string `protobuf:"bytes,5,opt,name=signer,proto3" json:"signer,omitempty"` +var fileDescriptor_b6bc4c8185546947 = []byte{ + // 827 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x3f, 0x6f, 0x1a, 0x49, + 0x14, 0x67, 0x01, 0x23, 0x7b, 0x00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x59, 0xff, 0xef, 0xec, + 0xa2, 0x2c, 0x9c, 0x5f, 0x94, 0x85, 0xcf, 0x17, 0x65, 0xe1, 0xd9, 0x65, 0x39, 0x71, 0x7e, 0x59, + 0x4e, 0x7c, 0xba, 0x2c, 0x27, 0x1e, 0xfe, 0x61, 0x63, 0xaf, 0xdd, 0x37, 0x14, 0x93, 0x74, 0x55, + 0x93, 0xd0, 0x2e, 0xa1, 0xfc, 0x67, 0x97, 0x5a, 0x4f, 0xd4, 0x13, 0x35, 0xfc, 0x0f, 0xf7, 0x5b, + 0x6d, 0x97, 0xff, 0x8d, 0xf3, 0x86, 0x3d, 0x44, 0x8d, 0x4c, 0xd0, 0xac, 0xbf, 0x7f, 0x0d, 0x00, + 0x00, 0xff, 0xff, 0x06, 0xa7, 0xa2, 0x16, 0xe6, 0x09, 0x00, 0x00, } -func (m *MsgUpgradeClient) Reset() { *m = MsgUpgradeClient{} } -func (m *MsgUpgradeClient) String() string { return proto.CompactTextString(m) } -func (*MsgUpgradeClient) ProtoMessage() {} -func (*MsgUpgradeClient) Descriptor() ([]byte, []int) { - return fileDescriptor_b6bc4c8185546947, []int{6} -} -func (m *MsgUpgradeClient) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpgradeClient) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpgradeClient.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 *MsgUpgradeClient) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpgradeClient.Merge(m, src) -} -func (m *MsgUpgradeClient) XXX_Size() int { - return m.Size() -} -func (m *MsgUpgradeClient) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpgradeClient.DiscardUnknown(m) -} +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn -var xxx_messageInfo_MsgUpgradeClient proto.InternalMessageInfo +// 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 -func (m *MsgUpgradeClient) GetClientId() string { - if m != nil { - return m.ClientId - } - return "" +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // CreateClient defines a rpc handler method for MsgCreateClient. + CreateClient(ctx context.Context, in *MsgCreateClient, opts ...grpc.CallOption) (*MsgCreateClientResponse, error) + // UpdateClient defines a rpc handler method for MsgUpdateClient. + UpdateClient(ctx context.Context, in *MsgUpdateClient, opts ...grpc.CallOption) (*MsgUpdateClientResponse, error) + // UpgradeClient defines a rpc handler method for MsgUpgradeClient. + UpgradeClient(ctx context.Context, in *MsgUpgradeClient, opts ...grpc.CallOption) (*MsgUpgradeClientResponse, error) + // SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. + SubmitMisbehaviour(ctx context.Context, in *MsgSubmitMisbehaviour, opts ...grpc.CallOption) (*MsgSubmitMisbehaviourResponse, error) } -func (m *MsgUpgradeClient) GetClientState() *types.Any { - if m != nil { - return m.ClientState - } - return nil +type msgClient struct { + cc grpc1.ClientConn } -func (m *MsgUpgradeClient) GetUpgradeHeight() *Height { - if m != nil { - return m.UpgradeHeight - } - return nil +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} } -func (m *MsgUpgradeClient) GetProofUpgrade() []byte { - if m != nil { - return m.ProofUpgrade +func (c *msgClient) CreateClient(ctx context.Context, in *MsgCreateClient, opts ...grpc.CallOption) (*MsgCreateClientResponse, error) { + out := new(MsgCreateClientResponse) + err := c.cc.Invoke(ctx, "/ibc.core.client.v1.Msg/CreateClient", in, out, opts...) + if err != nil { + return nil, err } - return nil + return out, nil } -func (m *MsgUpgradeClient) GetSigner() string { - if m != nil { - return m.Signer +func (c *msgClient) UpdateClient(ctx context.Context, in *MsgUpdateClient, opts ...grpc.CallOption) (*MsgUpdateClientResponse, error) { + out := new(MsgUpdateClientResponse) + err := c.cc.Invoke(ctx, "/ibc.core.client.v1.Msg/UpdateClient", in, out, opts...) + if err != nil { + return nil, err } - return "" + return out, nil } -// MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for -// light client misbehaviour. -type MsgSubmitMisbehaviour struct { - // client unique identifier - ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` - // misbehaviour used for freezing the light client - Misbehaviour *types.Any `protobuf:"bytes,2,opt,name=misbehaviour,proto3" json:"misbehaviour,omitempty"` - // signer address - Signer string `protobuf:"bytes,3,opt,name=signer,proto3" json:"signer,omitempty"` +func (c *msgClient) UpgradeClient(ctx context.Context, in *MsgUpgradeClient, opts ...grpc.CallOption) (*MsgUpgradeClientResponse, error) { + out := new(MsgUpgradeClientResponse) + err := c.cc.Invoke(ctx, "/ibc.core.client.v1.Msg/UpgradeClient", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *MsgSubmitMisbehaviour) Reset() { *m = MsgSubmitMisbehaviour{} } -func (m *MsgSubmitMisbehaviour) String() string { return proto.CompactTextString(m) } -func (*MsgSubmitMisbehaviour) ProtoMessage() {} -func (*MsgSubmitMisbehaviour) Descriptor() ([]byte, []int) { - return fileDescriptor_b6bc4c8185546947, []int{7} -} -func (m *MsgSubmitMisbehaviour) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSubmitMisbehaviour) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSubmitMisbehaviour.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 (c *msgClient) SubmitMisbehaviour(ctx context.Context, in *MsgSubmitMisbehaviour, opts ...grpc.CallOption) (*MsgSubmitMisbehaviourResponse, error) { + out := new(MsgSubmitMisbehaviourResponse) + err := c.cc.Invoke(ctx, "/ibc.core.client.v1.Msg/SubmitMisbehaviour", in, out, opts...) + if err != nil { + return nil, err } -} -func (m *MsgSubmitMisbehaviour) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSubmitMisbehaviour.Merge(m, src) -} -func (m *MsgSubmitMisbehaviour) XXX_Size() int { - return m.Size() -} -func (m *MsgSubmitMisbehaviour) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSubmitMisbehaviour.DiscardUnknown(m) + return out, nil } -var xxx_messageInfo_MsgSubmitMisbehaviour proto.InternalMessageInfo - -// Height is a monotonically increasing data type -// that can be compared against another Height for the purposes of updating and -// freezing clients -// -// Normally the VersionHeight is incremented at each height while keeping version -// number the same However some consensus algorithms may choose to reset the -// height in certain conditions e.g. hard forks, state-machine breaking changes -// In these cases, the version number is incremented so that height continues to -// be monitonically increasing even as the VersionHeight gets reset -type Height struct { - // the version that the client is currently on - VersionNumber uint64 `protobuf:"varint,1,opt,name=version_number,json=versionNumber,proto3" json:"version_number,omitempty" yaml:"version_number"` - // the height within the given version - VersionHeight uint64 `protobuf:"varint,2,opt,name=version_height,json=versionHeight,proto3" json:"version_height,omitempty" yaml:"version_height"` +// MsgServer is the server API for Msg service. +type MsgServer interface { + // CreateClient defines a rpc handler method for MsgCreateClient. + CreateClient(context.Context, *MsgCreateClient) (*MsgCreateClientResponse, error) + // UpdateClient defines a rpc handler method for MsgUpdateClient. + UpdateClient(context.Context, *MsgUpdateClient) (*MsgUpdateClientResponse, error) + // UpgradeClient defines a rpc handler method for MsgUpgradeClient. + UpgradeClient(context.Context, *MsgUpgradeClient) (*MsgUpgradeClientResponse, error) + // SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. + SubmitMisbehaviour(context.Context, *MsgSubmitMisbehaviour) (*MsgSubmitMisbehaviourResponse, error) } -func (m *Height) Reset() { *m = Height{} } -func (*Height) ProtoMessage() {} -func (*Height) Descriptor() ([]byte, []int) { - return fileDescriptor_b6bc4c8185546947, []int{8} +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { } -func (m *Height) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (*UnimplementedMsgServer) CreateClient(ctx context.Context, req *MsgCreateClient) (*MsgCreateClientResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateClient not implemented") } -func (m *Height) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Height.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 (*UnimplementedMsgServer) UpdateClient(ctx context.Context, req *MsgUpdateClient) (*MsgUpdateClientResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateClient not implemented") } -func (m *Height) XXX_Merge(src proto.Message) { - xxx_messageInfo_Height.Merge(m, src) +func (*UnimplementedMsgServer) UpgradeClient(ctx context.Context, req *MsgUpgradeClient) (*MsgUpgradeClientResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpgradeClient not implemented") } -func (m *Height) XXX_Size() int { - return m.Size() +func (*UnimplementedMsgServer) SubmitMisbehaviour(ctx context.Context, req *MsgSubmitMisbehaviour) (*MsgSubmitMisbehaviourResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitMisbehaviour not implemented") } -func (m *Height) XXX_DiscardUnknown() { - xxx_messageInfo_Height.DiscardUnknown(m) + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) } -var xxx_messageInfo_Height proto.InternalMessageInfo +func _Msg_CreateClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateClient) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateClient(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.client.v1.Msg/CreateClient", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateClient(ctx, req.(*MsgCreateClient)) + } + return interceptor(ctx, in, info, handler) +} -func init() { - proto.RegisterType((*IdentifiedClientState)(nil), "ibc.core.client.v1.IdentifiedClientState") - proto.RegisterType((*ConsensusStateWithHeight)(nil), "ibc.core.client.v1.ConsensusStateWithHeight") - proto.RegisterType((*ClientConsensusStates)(nil), "ibc.core.client.v1.ClientConsensusStates") - proto.RegisterType((*ClientUpdateProposal)(nil), "ibc.core.client.v1.ClientUpdateProposal") - proto.RegisterType((*MsgCreateClient)(nil), "ibc.core.client.v1.MsgCreateClient") - proto.RegisterType((*MsgUpdateClient)(nil), "ibc.core.client.v1.MsgUpdateClient") - proto.RegisterType((*MsgUpgradeClient)(nil), "ibc.core.client.v1.MsgUpgradeClient") - proto.RegisterType((*MsgSubmitMisbehaviour)(nil), "ibc.core.client.v1.MsgSubmitMisbehaviour") - proto.RegisterType((*Height)(nil), "ibc.core.client.v1.Height") +func _Msg_UpdateClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateClient) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateClient(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.client.v1.Msg/UpdateClient", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateClient(ctx, req.(*MsgUpdateClient)) + } + return interceptor(ctx, in, info, handler) } -func init() { proto.RegisterFile("ibc/core/client/v1/client.proto", fileDescriptor_b6bc4c8185546947) } +func _Msg_UpgradeClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpgradeClient) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpgradeClient(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.client.v1.Msg/UpgradeClient", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpgradeClient(ctx, req.(*MsgUpgradeClient)) + } + return interceptor(ctx, in, info, handler) +} -var fileDescriptor_b6bc4c8185546947 = []byte{ - // 718 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0x3d, 0x4f, 0xdb, 0x4e, - 0x1c, 0x8e, 0x93, 0x10, 0x91, 0x4b, 0x78, 0x91, 0xff, 0x09, 0x84, 0x0c, 0x71, 0x74, 0x13, 0x03, - 0xd8, 0x7f, 0xd2, 0xa1, 0x28, 0x52, 0xa5, 0x36, 0x2c, 0x65, 0xa0, 0xa2, 0x46, 0x55, 0x5f, 0x54, - 0x29, 0xf2, 0xcb, 0xe1, 0x9c, 0x9a, 0xf8, 0x22, 0xdf, 0x25, 0x22, 0xdf, 0xa0, 0x63, 0xa5, 0x56, - 0x55, 0x87, 0x0e, 0x4c, 0x1d, 0xbb, 0xf5, 0x1b, 0x74, 0x60, 0xe8, 0xc0, 0xd8, 0xc9, 0xaa, 0x60, - 0xe9, 0x9c, 0x4f, 0x50, 0xf9, 0xee, 0x08, 0x36, 0x10, 0x40, 0x4c, 0x4c, 0xbe, 0xdf, 0xcb, 0x3d, - 0xf7, 0xfc, 0x9e, 0xe7, 0x74, 0x06, 0x1a, 0xb6, 0x1d, 0xc3, 0x21, 0x01, 0x32, 0x9c, 0x2e, 0x46, - 0x3e, 0x33, 0x86, 0x1b, 0x72, 0xa5, 0xf7, 0x03, 0xc2, 0x88, 0xaa, 0x62, 0xdb, 0xd1, 0xa3, 0x06, - 0x5d, 0xa6, 0x87, 0x1b, 0xd5, 0x92, 0x47, 0x3c, 0xc2, 0xcb, 0x46, 0xb4, 0x12, 0x9d, 0xd5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 0xfe, 0xbf, 0xb1, 0x2e, 0x7f, 0xd7, 0x6c, 0xd4, 0x47, 0xd4, 0xce, 0x71, 0xa5, 0x1e, - 0xfc, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x4e, 0x1c, 0xf5, 0xf4, 0xce, 0x07, 0x00, 0x00, +func _Msg_SubmitMisbehaviour_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSubmitMisbehaviour) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SubmitMisbehaviour(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.client.v1.Msg/SubmitMisbehaviour", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SubmitMisbehaviour(ctx, req.(*MsgSubmitMisbehaviour)) + } + return interceptor(ctx, in, info, handler) } -func (m *IdentifiedClientState) Marshal() (dAtA []byte, err error) { +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ibc.core.client.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateClient", + Handler: _Msg_CreateClient_Handler, + }, + { + MethodName: "UpdateClient", + Handler: _Msg_UpdateClient_Handler, + }, + { + MethodName: "UpgradeClient", + Handler: _Msg_UpgradeClient_Handler, + }, + { + MethodName: "SubmitMisbehaviour", + Handler: _Msg_SubmitMisbehaviour_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "ibc/core/client/v1/client.proto", +} + +func (m *MsgCreateClient) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -575,16 +935,35 @@ func (m *IdentifiedClientState) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *IdentifiedClientState) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgCreateClient) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *IdentifiedClientState) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgCreateClient) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintClient(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x22 + } + if m.ConsensusState != nil { + { + size, err := m.ConsensusState.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClient(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } if m.ClientState != nil { { size, err := m.ClientState.MarshalToSizedBuffer(dAtA[:i]) @@ -607,7 +986,7 @@ func (m *IdentifiedClientState) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ConsensusStateWithHeight) Marshal() (dAtA []byte, err error) { +func (m *MsgCreateClientResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -617,19 +996,49 @@ func (m *ConsensusStateWithHeight) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ConsensusStateWithHeight) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgCreateClientResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ConsensusStateWithHeight) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgCreateClientResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.ConsensusState != nil { + return len(dAtA) - i, nil +} + +func (m *MsgUpdateClient) 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 *MsgUpdateClient) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateClient) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintClient(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x1a + } + if m.Header != nil { { - size, err := m.ConsensusState.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -639,20 +1048,17 @@ func (m *ConsensusStateWithHeight) MarshalToSizedBuffer(dAtA []byte) (int, error i-- dAtA[i] = 0x12 } - { - size, err := m.Height.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintClient(dAtA, i, uint64(size)) + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintClient(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *ClientConsensusStates) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateClientResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -662,29 +1068,76 @@ func (m *ClientConsensusStates) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ClientConsensusStates) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateClientResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ClientConsensusStates) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateClientResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.ConsensusStates) > 0 { - for iNdEx := len(m.ConsensusStates) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ConsensusStates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintClient(dAtA, i, uint64(size)) + return len(dAtA) - i, nil +} + +func (m *MsgUpgradeClient) 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 *MsgUpgradeClient) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpgradeClient) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintClient(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x2a + } + if len(m.ProofUpgrade) > 0 { + i -= len(m.ProofUpgrade) + copy(dAtA[i:], m.ProofUpgrade) + i = encodeVarintClient(dAtA, i, uint64(len(m.ProofUpgrade))) + i-- + dAtA[i] = 0x22 + } + if m.UpgradeHeight != nil { + { + size, err := m.UpgradeHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x12 + i -= size + i = encodeVarintClient(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.ClientState != nil { + { + size, err := m.ClientState.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClient(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 } if len(m.ClientId) > 0 { i -= len(m.ClientId) @@ -696,7 +1149,7 @@ func (m *ClientConsensusStates) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ClientUpdateProposal) Marshal() (dAtA []byte, err error) { +func (m *MsgUpgradeClientResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -706,19 +1159,49 @@ func (m *ClientUpdateProposal) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ClientUpdateProposal) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpgradeClientResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ClientUpdateProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpgradeClientResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Header != nil { + return len(dAtA) - i, nil +} + +func (m *MsgSubmitMisbehaviour) 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 *MsgSubmitMisbehaviour) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitMisbehaviour) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintClient(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x1a + } + if m.Misbehaviour != nil { { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Misbehaviour.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -726,33 +1209,42 @@ func (m *ClientUpdateProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintClient(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x12 } if len(m.ClientId) > 0 { i -= len(m.ClientId) copy(dAtA[i:], m.ClientId) i = encodeVarintClient(dAtA, i, uint64(len(m.ClientId))) i-- - dAtA[i] = 0x1a - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintClient(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintClient(dAtA, i, uint64(len(m.Title))) - i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *MsgCreateClient) Marshal() (dAtA []byte, err error) { +func (m *MsgSubmitMisbehaviourResponse) 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 *MsgSubmitMisbehaviourResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitMisbehaviourResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *IdentifiedClientState) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -762,35 +1254,16 @@ func (m *MsgCreateClient) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgCreateClient) MarshalTo(dAtA []byte) (int, error) { +func (m *IdentifiedClientState) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgCreateClient) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *IdentifiedClientState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintClient(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x22 - } - if m.ConsensusState != nil { - { - size, err := m.ConsensusState.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintClient(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } if m.ClientState != nil { { size, err := m.ClientState.MarshalToSizedBuffer(dAtA[:i]) @@ -813,7 +1286,7 @@ func (m *MsgCreateClient) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgUpdateClient) Marshal() (dAtA []byte, err error) { +func (m *ConsensusStateWithHeight) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -823,26 +1296,19 @@ func (m *MsgUpdateClient) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUpdateClient) MarshalTo(dAtA []byte) (int, error) { +func (m *ConsensusStateWithHeight) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpdateClient) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ConsensusStateWithHeight) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintClient(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x1a - } - if m.Header != nil { + if m.ConsensusState != nil { { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.ConsensusState.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -852,17 +1318,20 @@ func (m *MsgUpdateClient) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if len(m.ClientId) > 0 { - i -= len(m.ClientId) - copy(dAtA[i:], m.ClientId) - i = encodeVarintClient(dAtA, i, uint64(len(m.ClientId))) - i-- - dAtA[i] = 0xa + { + size, err := m.Height.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClient(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *MsgUpgradeClient) Marshal() (dAtA []byte, err error) { +func (m *ClientConsensusStates) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -872,53 +1341,29 @@ func (m *MsgUpgradeClient) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUpgradeClient) MarshalTo(dAtA []byte) (int, error) { +func (m *ClientConsensusStates) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpgradeClient) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ClientConsensusStates) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintClient(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x2a - } - if len(m.ProofUpgrade) > 0 { - i -= len(m.ProofUpgrade) - copy(dAtA[i:], m.ProofUpgrade) - i = encodeVarintClient(dAtA, i, uint64(len(m.ProofUpgrade))) - i-- - dAtA[i] = 0x22 - } - if m.UpgradeHeight != nil { - { - size, err := m.UpgradeHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintClient(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.ClientState != nil { - { - size, err := m.ClientState.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.ConsensusStates) > 0 { + for iNdEx := len(m.ConsensusStates) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ConsensusStates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClient(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintClient(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 } - i-- - dAtA[i] = 0x12 } if len(m.ClientId) > 0 { i -= len(m.ClientId) @@ -930,7 +1375,7 @@ func (m *MsgUpgradeClient) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgSubmitMisbehaviour) Marshal() (dAtA []byte, err error) { +func (m *ClientUpdateProposal) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -940,26 +1385,19 @@ func (m *MsgSubmitMisbehaviour) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgSubmitMisbehaviour) MarshalTo(dAtA []byte) (int, error) { +func (m *ClientUpdateProposal) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgSubmitMisbehaviour) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ClientUpdateProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintClient(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x1a - } - if m.Misbehaviour != nil { + if m.Header != nil { { - size, err := m.Misbehaviour.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -967,13 +1405,27 @@ func (m *MsgSubmitMisbehaviour) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintClient(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x22 } if len(m.ClientId) > 0 { i -= len(m.ClientId) copy(dAtA[i:], m.ClientId) i = encodeVarintClient(dAtA, i, uint64(len(m.ClientId))) i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintClient(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintClient(dAtA, i, uint64(len(m.Title))) + i-- dAtA[i] = 0xa } return len(dAtA) - i, nil @@ -1023,7 +1475,7 @@ func encodeVarintClient(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *IdentifiedClientState) Size() (n int) { +func (m *MsgCreateClient) Size() (n int) { if m == nil { return 0 } @@ -1037,25 +1489,27 @@ func (m *IdentifiedClientState) Size() (n int) { l = m.ClientState.Size() n += 1 + l + sovClient(uint64(l)) } + if m.ConsensusState != nil { + l = m.ConsensusState.Size() + n += 1 + l + sovClient(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovClient(uint64(l)) + } return n } -func (m *ConsensusStateWithHeight) Size() (n int) { +func (m *MsgCreateClientResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = m.Height.Size() - n += 1 + l + sovClient(uint64(l)) - if m.ConsensusState != nil { - l = m.ConsensusState.Size() - n += 1 + l + sovClient(uint64(l)) - } return n } -func (m *ClientConsensusStates) Size() (n int) { +func (m *MsgUpdateClient) Size() (n int) { if m == nil { return 0 } @@ -1065,41 +1519,65 @@ func (m *ClientConsensusStates) Size() (n int) { if l > 0 { n += 1 + l + sovClient(uint64(l)) } - if len(m.ConsensusStates) > 0 { - for _, e := range m.ConsensusStates { - l = e.Size() - n += 1 + l + sovClient(uint64(l)) - } + if m.Header != nil { + l = m.Header.Size() + n += 1 + l + sovClient(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovClient(uint64(l)) } return n } -func (m *ClientUpdateProposal) Size() (n int) { +func (m *MsgUpdateClientResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Title) + return n +} + +func (m *MsgUpgradeClient) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClientId) if l > 0 { n += 1 + l + sovClient(uint64(l)) } - l = len(m.Description) - if l > 0 { + if m.ClientState != nil { + l = m.ClientState.Size() n += 1 + l + sovClient(uint64(l)) } - l = len(m.ClientId) + if m.UpgradeHeight != nil { + l = m.UpgradeHeight.Size() + n += 1 + l + sovClient(uint64(l)) + } + l = len(m.ProofUpgrade) if l > 0 { n += 1 + l + sovClient(uint64(l)) } - if m.Header != nil { - l = m.Header.Size() + l = len(m.Signer) + if l > 0 { n += 1 + l + sovClient(uint64(l)) } return n } -func (m *MsgCreateClient) Size() (n int) { +func (m *MsgUpgradeClientResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgSubmitMisbehaviour) Size() (n int) { if m == nil { return 0 } @@ -1109,12 +1587,8 @@ func (m *MsgCreateClient) Size() (n int) { if l > 0 { n += 1 + l + sovClient(uint64(l)) } - if m.ClientState != nil { - l = m.ClientState.Size() - n += 1 + l + sovClient(uint64(l)) - } - if m.ConsensusState != nil { - l = m.ConsensusState.Size() + if m.Misbehaviour != nil { + l = m.Misbehaviour.Size() n += 1 + l + sovClient(uint64(l)) } l = len(m.Signer) @@ -1124,7 +1598,16 @@ func (m *MsgCreateClient) Size() (n int) { return n } -func (m *MsgUpdateClient) Size() (n int) { +func (m *MsgSubmitMisbehaviourResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *IdentifiedClientState) Size() (n int) { if m == nil { return 0 } @@ -1134,18 +1617,29 @@ func (m *MsgUpdateClient) Size() (n int) { if l > 0 { n += 1 + l + sovClient(uint64(l)) } - if m.Header != nil { - l = m.Header.Size() + if m.ClientState != nil { + l = m.ClientState.Size() n += 1 + l + sovClient(uint64(l)) } - l = len(m.Signer) - if l > 0 { + return n +} + +func (m *ConsensusStateWithHeight) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Height.Size() + n += 1 + l + sovClient(uint64(l)) + if m.ConsensusState != nil { + l = m.ConsensusState.Size() n += 1 + l + sovClient(uint64(l)) } return n } -func (m *MsgUpgradeClient) Size() (n int) { +func (m *ClientConsensusStates) Size() (n int) { if m == nil { return 0 } @@ -1155,43 +1649,37 @@ func (m *MsgUpgradeClient) Size() (n int) { if l > 0 { n += 1 + l + sovClient(uint64(l)) } - if m.ClientState != nil { - l = m.ClientState.Size() - n += 1 + l + sovClient(uint64(l)) - } - if m.UpgradeHeight != nil { - l = m.UpgradeHeight.Size() - n += 1 + l + sovClient(uint64(l)) - } - l = len(m.ProofUpgrade) - if l > 0 { - n += 1 + l + sovClient(uint64(l)) - } - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovClient(uint64(l)) + if len(m.ConsensusStates) > 0 { + for _, e := range m.ConsensusStates { + l = e.Size() + n += 1 + l + sovClient(uint64(l)) + } } return n } -func (m *MsgSubmitMisbehaviour) Size() (n int) { +func (m *ClientUpdateProposal) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.ClientId) + l = len(m.Title) if l > 0 { n += 1 + l + sovClient(uint64(l)) } - if m.Misbehaviour != nil { - l = m.Misbehaviour.Size() + l = len(m.Description) + if l > 0 { n += 1 + l + sovClient(uint64(l)) } - l = len(m.Signer) + l = len(m.ClientId) if l > 0 { n += 1 + l + sovClient(uint64(l)) } + if m.Header != nil { + l = m.Header.Size() + n += 1 + l + sovClient(uint64(l)) + } return n } @@ -1216,7 +1704,7 @@ func sovClient(x uint64) (n int) { func sozClient(x uint64) (n int) { return sovClient(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *IdentifiedClientState) Unmarshal(dAtA []byte) error { +func (m *MsgCreateClient) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1239,10 +1727,10 @@ func (m *IdentifiedClientState) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: IdentifiedClientState: wiretype end group for non-group") + return fmt.Errorf("proto: MsgCreateClient: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: IdentifiedClientState: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgCreateClient: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1313,62 +1801,9 @@ func (m *IdentifiedClientState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipClient(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthClient - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthClient - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ConsensusStateWithHeight) 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 ErrIntOverflowClient - } - 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: ConsensusStateWithHeight: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConsensusStateWithHeight: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusState", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1395,15 +1830,18 @@ func (m *ConsensusStateWithHeight) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Height.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.ConsensusState == nil { + m.ConsensusState = &types.Any{} + } + if err := m.ConsensusState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsensusState", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowClient @@ -1413,28 +1851,77 @@ func (m *ConsensusStateWithHeight) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthClient } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthClient } if postIndex > l { return io.ErrUnexpectedEOF } - if m.ConsensusState == nil { - m.ConsensusState = &types.Any{} - } - if err := m.ConsensusState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipClient(dAtA[iNdEx:]) + if err != nil { return err } - iNdEx = postIndex + if skippy < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateClientResponse) 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 ErrIntOverflowClient + } + 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: MsgCreateClientResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateClientResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { default: iNdEx = preIndex skippy, err := skipClient(dAtA[iNdEx:]) @@ -1459,7 +1946,7 @@ func (m *ConsensusStateWithHeight) Unmarshal(dAtA []byte) error { } return nil } -func (m *ClientConsensusStates) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateClient) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1482,10 +1969,10 @@ func (m *ClientConsensusStates) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ClientConsensusStates: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateClient: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ClientConsensusStates: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateClient: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1522,7 +2009,7 @@ func (m *ClientConsensusStates) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsensusStates", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1549,11 +2036,98 @@ func (m *ClientConsensusStates) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsensusStates = append(m.ConsensusStates, ConsensusStateWithHeight{}) - if err := m.ConsensusStates[len(m.ConsensusStates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + if m.Header == nil { + m.Header = &types.Any{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + 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 ErrInvalidLengthClient + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateClientResponse) 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 ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - iNdEx = postIndex + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateClientResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateClientResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { default: iNdEx = preIndex skippy, err := skipClient(dAtA[iNdEx:]) @@ -1578,7 +2152,7 @@ func (m *ClientConsensusStates) Unmarshal(dAtA []byte) error { } return nil } -func (m *ClientUpdateProposal) Unmarshal(dAtA []byte) error { +func (m *MsgUpgradeClient) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1601,15 +2175,15 @@ func (m *ClientUpdateProposal) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ClientUpdateProposal: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpgradeClient: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ClientUpdateProposal: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpgradeClient: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1637,13 +2211,13 @@ func (m *ClientUpdateProposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Title = string(dAtA[iNdEx:postIndex]) + m.ClientId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClientState", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowClient @@ -1653,29 +2227,33 @@ func (m *ClientUpdateProposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthClient } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthClient } if postIndex > l { return io.ErrUnexpectedEOF } - m.Description = string(dAtA[iNdEx:postIndex]) + if m.ClientState == nil { + m.ClientState = &types.Any{} + } + if err := m.ClientState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UpgradeHeight", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowClient @@ -1685,29 +2263,33 @@ func (m *ClientUpdateProposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthClient } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthClient } if postIndex > l { return io.ErrUnexpectedEOF } - m.ClientId = string(dAtA[iNdEx:postIndex]) + if m.UpgradeHeight == nil { + m.UpgradeHeight = &Height{} + } + if err := m.UpgradeHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ProofUpgrade", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowClient @@ -1717,27 +2299,57 @@ func (m *ClientUpdateProposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthClient } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthClient } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Header == nil { - m.Header = &types.Any{} + m.ProofUpgrade = append(m.ProofUpgrade[:0], dAtA[iNdEx:postIndex]...) + if m.ProofUpgrade == nil { + m.ProofUpgrade = []byte{} } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + 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 ErrInvalidLengthClient } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1763,7 +2375,7 @@ func (m *ClientUpdateProposal) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgCreateClient) Unmarshal(dAtA []byte) error { +func (m *MsgUpgradeClientResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1786,10 +2398,63 @@ func (m *MsgCreateClient) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgCreateClient: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpgradeClientResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateClient: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpgradeClientResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSubmitMisbehaviour) 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 ErrIntOverflowClient + } + 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: MsgSubmitMisbehaviour: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitMisbehaviour: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1826,7 +2491,7 @@ func (m *MsgCreateClient) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientState", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Misbehaviour", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1853,50 +2518,14 @@ func (m *MsgCreateClient) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ClientState == nil { - m.ClientState = &types.Any{} + if m.Misbehaviour == nil { + m.Misbehaviour = &types.Any{} } - if err := m.ClientState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Misbehaviour.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsensusState", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthClient - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthClient - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ConsensusState == nil { - m.ConsensusState = &types.Any{} - } - if err := m.ConsensusState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } @@ -1952,7 +2581,60 @@ func (m *MsgCreateClient) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateClient) Unmarshal(dAtA []byte) error { +func (m *MsgSubmitMisbehaviourResponse) 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 ErrIntOverflowClient + } + 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: MsgSubmitMisbehaviourResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitMisbehaviourResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *IdentifiedClientState) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1975,10 +2657,10 @@ func (m *MsgUpdateClient) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateClient: wiretype end group for non-group") + return fmt.Errorf("proto: IdentifiedClientState: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateClient: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: IdentifiedClientState: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2015,7 +2697,7 @@ func (m *MsgUpdateClient) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClientState", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2042,45 +2724,13 @@ func (m *MsgUpdateClient) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Header == nil { - m.Header = &types.Any{} + if m.ClientState == nil { + m.ClientState = &types.Any{} } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ClientState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowClient - } - 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 ErrInvalidLengthClient - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthClient - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipClient(dAtA[iNdEx:]) @@ -2105,7 +2755,7 @@ func (m *MsgUpdateClient) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpgradeClient) Unmarshal(dAtA []byte) error { +func (m *ConsensusStateWithHeight) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2128,17 +2778,17 @@ func (m *MsgUpgradeClient) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpgradeClient: wiretype end group for non-group") + return fmt.Errorf("proto: ConsensusStateWithHeight: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpgradeClient: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ConsensusStateWithHeight: 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) + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowClient @@ -2148,27 +2798,28 @@ func (m *MsgUpgradeClient) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthClient } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthClient } if postIndex > l { return io.ErrUnexpectedEOF } - m.ClientId = string(dAtA[iNdEx:postIndex]) + if err := m.Height.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientState", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusState", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2195,54 +2846,71 @@ func (m *MsgUpgradeClient) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ClientState == nil { - m.ClientState = &types.Any{} + if m.ConsensusState == nil { + m.ConsensusState = &types.Any{} } - if err := m.ClientState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ConsensusState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UpgradeHeight", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } + default: + iNdEx = preIndex + skippy, err := skipClient(dAtA[iNdEx:]) + if err != nil { + return err } - if msglen < 0 { + if skippy < 0 { return ErrInvalidLengthClient } - postIndex := iNdEx + msglen - if postIndex < 0 { + if (iNdEx + skippy) < 0 { return ErrInvalidLengthClient } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - if m.UpgradeHeight == nil { - m.UpgradeHeight = &Height{} + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ClientConsensusStates) 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 ErrIntOverflowClient } - if err := m.UpgradeHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + if iNdEx >= l { + return io.ErrUnexpectedEOF } - iNdEx = postIndex - case 4: + 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: ClientConsensusStates: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClientConsensusStates: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofUpgrade", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowClient @@ -2252,31 +2920,29 @@ func (m *MsgUpgradeClient) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthClient } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthClient } if postIndex > l { return io.ErrUnexpectedEOF } - m.ProofUpgrade = append(m.ProofUpgrade[:0], dAtA[iNdEx:postIndex]...) - if m.ProofUpgrade == nil { - m.ProofUpgrade = []byte{} - } + m.ClientId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusStates", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowClient @@ -2286,23 +2952,25 @@ func (m *MsgUpgradeClient) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthClient } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthClient } if postIndex > l { return io.ErrUnexpectedEOF } - m.Signer = string(dAtA[iNdEx:postIndex]) + m.ConsensusStates = append(m.ConsensusStates, ConsensusStateWithHeight{}) + if err := m.ConsensusStates[len(m.ConsensusStates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -2328,7 +2996,7 @@ func (m *MsgUpgradeClient) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgSubmitMisbehaviour) Unmarshal(dAtA []byte) error { +func (m *ClientUpdateProposal) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2351,15 +3019,15 @@ func (m *MsgSubmitMisbehaviour) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgSubmitMisbehaviour: wiretype end group for non-group") + return fmt.Errorf("proto: ClientUpdateProposal: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitMisbehaviour: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ClientUpdateProposal: 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) + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2387,13 +3055,13 @@ func (m *MsgSubmitMisbehaviour) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ClientId = string(dAtA[iNdEx:postIndex]) + m.Title = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Misbehaviour", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowClient @@ -2403,31 +3071,27 @@ func (m *MsgSubmitMisbehaviour) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthClient } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthClient } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Misbehaviour == nil { - m.Misbehaviour = &types.Any{} - } - if err := m.Misbehaviour.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Description = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2455,7 +3119,43 @@ func (m *MsgSubmitMisbehaviour) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Signer = string(dAtA[iNdEx:postIndex]) + m.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClient + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Header == nil { + m.Header = &types.Any{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/ibc/core/03-connection/types/connection.pb.go b/x/ibc/core/03-connection/types/connection.pb.go index deae3b896729..79efbee5d0b3 100644 --- a/x/ibc/core/03-connection/types/connection.pb.go +++ b/x/ibc/core/03-connection/types/connection.pb.go @@ -4,12 +4,17 @@ package types import ( + context "context" fmt "fmt" types "github.com/cosmos/cosmos-sdk/codec/types" + grpc1 "github.com/gogo/protobuf/grpc" types1 "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" types2 "github.com/cosmos/cosmos-sdk/x/ibc/core/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" @@ -107,6 +112,43 @@ func (m *MsgConnectionOpenInit) XXX_DiscardUnknown() { var xxx_messageInfo_MsgConnectionOpenInit proto.InternalMessageInfo +// MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response type. +type MsgConnectionOpenInitResponse struct { +} + +func (m *MsgConnectionOpenInitResponse) Reset() { *m = MsgConnectionOpenInitResponse{} } +func (m *MsgConnectionOpenInitResponse) String() string { return proto.CompactTextString(m) } +func (*MsgConnectionOpenInitResponse) ProtoMessage() {} +func (*MsgConnectionOpenInitResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_90572467c054e43a, []int{1} +} +func (m *MsgConnectionOpenInitResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConnectionOpenInitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConnectionOpenInitResponse.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 *MsgConnectionOpenInitResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConnectionOpenInitResponse.Merge(m, src) +} +func (m *MsgConnectionOpenInitResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgConnectionOpenInitResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConnectionOpenInitResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgConnectionOpenInitResponse proto.InternalMessageInfo + // MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a // connection on Chain B. type MsgConnectionOpenTry struct { @@ -132,7 +174,7 @@ func (m *MsgConnectionOpenTry) Reset() { *m = MsgConnectionOpenTry{} } func (m *MsgConnectionOpenTry) String() string { return proto.CompactTextString(m) } func (*MsgConnectionOpenTry) ProtoMessage() {} func (*MsgConnectionOpenTry) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{1} + return fileDescriptor_90572467c054e43a, []int{2} } func (m *MsgConnectionOpenTry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -161,6 +203,43 @@ func (m *MsgConnectionOpenTry) XXX_DiscardUnknown() { var xxx_messageInfo_MsgConnectionOpenTry proto.InternalMessageInfo +// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. +type MsgConnectionOpenTryResponse struct { +} + +func (m *MsgConnectionOpenTryResponse) Reset() { *m = MsgConnectionOpenTryResponse{} } +func (m *MsgConnectionOpenTryResponse) String() string { return proto.CompactTextString(m) } +func (*MsgConnectionOpenTryResponse) ProtoMessage() {} +func (*MsgConnectionOpenTryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_90572467c054e43a, []int{3} +} +func (m *MsgConnectionOpenTryResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConnectionOpenTryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConnectionOpenTryResponse.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 *MsgConnectionOpenTryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConnectionOpenTryResponse.Merge(m, src) +} +func (m *MsgConnectionOpenTryResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgConnectionOpenTryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConnectionOpenTryResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgConnectionOpenTryResponse proto.InternalMessageInfo + // MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to // acknowledge the change of connection state to TRYOPEN on Chain B. type MsgConnectionOpenAck struct { @@ -184,7 +263,7 @@ func (m *MsgConnectionOpenAck) Reset() { *m = MsgConnectionOpenAck{} } func (m *MsgConnectionOpenAck) String() string { return proto.CompactTextString(m) } func (*MsgConnectionOpenAck) ProtoMessage() {} func (*MsgConnectionOpenAck) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{2} + return fileDescriptor_90572467c054e43a, []int{4} } func (m *MsgConnectionOpenAck) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -213,6 +292,43 @@ func (m *MsgConnectionOpenAck) XXX_DiscardUnknown() { var xxx_messageInfo_MsgConnectionOpenAck proto.InternalMessageInfo +// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. +type MsgConnectionOpenAckResponse struct { +} + +func (m *MsgConnectionOpenAckResponse) Reset() { *m = MsgConnectionOpenAckResponse{} } +func (m *MsgConnectionOpenAckResponse) String() string { return proto.CompactTextString(m) } +func (*MsgConnectionOpenAckResponse) ProtoMessage() {} +func (*MsgConnectionOpenAckResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_90572467c054e43a, []int{5} +} +func (m *MsgConnectionOpenAckResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConnectionOpenAckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConnectionOpenAckResponse.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 *MsgConnectionOpenAckResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConnectionOpenAckResponse.Merge(m, src) +} +func (m *MsgConnectionOpenAckResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgConnectionOpenAckResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConnectionOpenAckResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgConnectionOpenAckResponse proto.InternalMessageInfo + // MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to // acknowledge the change of connection state to OPEN on Chain A. type MsgConnectionOpenConfirm struct { @@ -227,7 +343,7 @@ func (m *MsgConnectionOpenConfirm) Reset() { *m = MsgConnectionOpenConfi func (m *MsgConnectionOpenConfirm) String() string { return proto.CompactTextString(m) } func (*MsgConnectionOpenConfirm) ProtoMessage() {} func (*MsgConnectionOpenConfirm) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{3} + return fileDescriptor_90572467c054e43a, []int{6} } func (m *MsgConnectionOpenConfirm) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -256,6 +372,43 @@ func (m *MsgConnectionOpenConfirm) XXX_DiscardUnknown() { var xxx_messageInfo_MsgConnectionOpenConfirm proto.InternalMessageInfo +// MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm response type. +type MsgConnectionOpenConfirmResponse struct { +} + +func (m *MsgConnectionOpenConfirmResponse) Reset() { *m = MsgConnectionOpenConfirmResponse{} } +func (m *MsgConnectionOpenConfirmResponse) String() string { return proto.CompactTextString(m) } +func (*MsgConnectionOpenConfirmResponse) ProtoMessage() {} +func (*MsgConnectionOpenConfirmResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_90572467c054e43a, []int{7} +} +func (m *MsgConnectionOpenConfirmResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConnectionOpenConfirmResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConnectionOpenConfirmResponse.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 *MsgConnectionOpenConfirmResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConnectionOpenConfirmResponse.Merge(m, src) +} +func (m *MsgConnectionOpenConfirmResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgConnectionOpenConfirmResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConnectionOpenConfirmResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgConnectionOpenConfirmResponse proto.InternalMessageInfo + // ConnectionEnd defines a stateful object on a chain connected to another // separate one. NOTE: there must only be 2 defined ConnectionEnds to establish // a connection between two chains. @@ -275,7 +428,7 @@ func (m *ConnectionEnd) Reset() { *m = ConnectionEnd{} } func (m *ConnectionEnd) String() string { return proto.CompactTextString(m) } func (*ConnectionEnd) ProtoMessage() {} func (*ConnectionEnd) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{4} + return fileDescriptor_90572467c054e43a, []int{8} } func (m *ConnectionEnd) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -324,7 +477,7 @@ func (m *IdentifiedConnection) Reset() { *m = IdentifiedConnection{} } func (m *IdentifiedConnection) String() string { return proto.CompactTextString(m) } func (*IdentifiedConnection) ProtoMessage() {} func (*IdentifiedConnection) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{5} + return fileDescriptor_90572467c054e43a, []int{9} } func (m *IdentifiedConnection) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -369,7 +522,7 @@ func (m *Counterparty) Reset() { *m = Counterparty{} } func (m *Counterparty) String() string { return proto.CompactTextString(m) } func (*Counterparty) ProtoMessage() {} func (*Counterparty) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{6} + return fileDescriptor_90572467c054e43a, []int{10} } func (m *Counterparty) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -408,7 +561,7 @@ func (m *ClientPaths) Reset() { *m = ClientPaths{} } func (m *ClientPaths) String() string { return proto.CompactTextString(m) } func (*ClientPaths) ProtoMessage() {} func (*ClientPaths) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{7} + return fileDescriptor_90572467c054e43a, []int{11} } func (m *ClientPaths) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -456,7 +609,7 @@ func (m *ConnectionPaths) Reset() { *m = ConnectionPaths{} } func (m *ConnectionPaths) String() string { return proto.CompactTextString(m) } func (*ConnectionPaths) ProtoMessage() {} func (*ConnectionPaths) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{8} + return fileDescriptor_90572467c054e43a, []int{12} } func (m *ConnectionPaths) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -512,7 +665,7 @@ func (m *Version) Reset() { *m = Version{} } func (m *Version) String() string { return proto.CompactTextString(m) } func (*Version) ProtoMessage() {} func (*Version) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{9} + return fileDescriptor_90572467c054e43a, []int{13} } func (m *Version) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -544,9 +697,13 @@ var xxx_messageInfo_Version proto.InternalMessageInfo func init() { proto.RegisterEnum("ibc.core.connection.v1.State", State_name, State_value) proto.RegisterType((*MsgConnectionOpenInit)(nil), "ibc.core.connection.v1.MsgConnectionOpenInit") + proto.RegisterType((*MsgConnectionOpenInitResponse)(nil), "ibc.core.connection.v1.MsgConnectionOpenInitResponse") proto.RegisterType((*MsgConnectionOpenTry)(nil), "ibc.core.connection.v1.MsgConnectionOpenTry") + proto.RegisterType((*MsgConnectionOpenTryResponse)(nil), "ibc.core.connection.v1.MsgConnectionOpenTryResponse") proto.RegisterType((*MsgConnectionOpenAck)(nil), "ibc.core.connection.v1.MsgConnectionOpenAck") + proto.RegisterType((*MsgConnectionOpenAckResponse)(nil), "ibc.core.connection.v1.MsgConnectionOpenAckResponse") proto.RegisterType((*MsgConnectionOpenConfirm)(nil), "ibc.core.connection.v1.MsgConnectionOpenConfirm") + proto.RegisterType((*MsgConnectionOpenConfirmResponse)(nil), "ibc.core.connection.v1.MsgConnectionOpenConfirmResponse") proto.RegisterType((*ConnectionEnd)(nil), "ibc.core.connection.v1.ConnectionEnd") proto.RegisterType((*IdentifiedConnection)(nil), "ibc.core.connection.v1.IdentifiedConnection") proto.RegisterType((*Counterparty)(nil), "ibc.core.connection.v1.Counterparty") @@ -560,77 +717,280 @@ func init() { } var fileDescriptor_90572467c054e43a = []byte{ - // 1110 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0x41, 0x6f, 0xe3, 0x44, - 0x14, 0x8e, 0x9d, 0xa4, 0x49, 0x5e, 0xd2, 0x6d, 0xd7, 0x9b, 0xb6, 0xc6, 0xb0, 0x76, 0xd6, 0x80, - 0xa8, 0x10, 0xeb, 0x90, 0x16, 0x71, 0x28, 0xe2, 0xd0, 0x64, 0x83, 0xb0, 0x60, 0xbb, 0x95, 0x9b, - 0x22, 0xd1, 0x4b, 0x94, 0x3a, 0x93, 0x74, 0xd4, 0xc6, 0x8e, 0x6c, 0xb7, 0x6c, 0xfe, 0xc1, 0xaa, - 0x17, 0xb8, 0x70, 0xe0, 0x50, 0x69, 0x25, 0xee, 0xfc, 0x06, 0x8e, 0x2b, 0x4e, 0x7b, 0xe4, 0x64, - 0xa1, 0xf6, 0x02, 0xd7, 0xfc, 0x02, 0xe4, 0x19, 0xdb, 0x19, 0xa7, 0xa9, 0x56, 0xdb, 0x06, 0x71, - 0xca, 0xbc, 0x79, 0xdf, 0x9b, 0x99, 0xf7, 0xcd, 0xf7, 0xde, 0x38, 0xf0, 0x11, 0x3e, 0x34, 0xab, - 0xa6, 0xed, 0xa0, 0xaa, 0x69, 0x5b, 0x16, 0x32, 0x3d, 0x6c, 0x5b, 0xd5, 0xb3, 0x1a, 0x63, 0x69, - 0x43, 0xc7, 0xf6, 0x6c, 0x61, 0x15, 0x1f, 0x9a, 0x5a, 0x00, 0xd4, 0x18, 0xd7, 0x59, 0x4d, 0x2a, - 0xf7, 0xed, 0xbe, 0x4d, 0x20, 0xd5, 0x60, 0x44, 0xd1, 0xd2, 0x3b, 0x7d, 0xdb, 0xee, 0x9f, 0xa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x82, 0x95, 0x2e, 0x72, 0xb1, 0x83, 0xba, 0xed, 0x59, - 0xf4, 0x54, 0xc6, 0xbe, 0xf2, 0x1e, 0x0d, 0x9f, 0x09, 0x53, 0x8d, 0x07, 0xe1, 0x7c, 0x83, 0x65, - 0xeb, 0x07, 0x78, 0xc4, 0x66, 0xdb, 0x36, 0x8f, 0x6c, 0x17, 0x59, 0x53, 0x3b, 0xa4, 0xc9, 0x0e, - 0x9f, 0x8c, 0x7d, 0x65, 0x3d, 0xba, 0x80, 0x37, 0x84, 0xa8, 0x86, 0xcc, 0x62, 0x1a, 0x04, 0x92, - 0xd8, 0x78, 0x17, 0x4a, 0x61, 0x9a, 0xae, 0xd7, 0xf1, 0x10, 0xe1, 0xb6, 0xb8, 0x51, 0xd6, 0xa8, - 0x5c, 0xb5, 0x48, 0xae, 0xda, 0xb6, 0x35, 0xaa, 0xaf, 0x8d, 0x7d, 0xe5, 0x41, 0x82, 0x1a, 0x12, - 0xa3, 0x1a, 0x45, 0x6a, 0xee, 0x05, 0xd6, 0xb5, 0x8b, 0xcf, 0xde, 0xf1, 0xe2, 0xf7, 0x61, 0x25, - 0x91, 0x67, 0x78, 0xed, 0xae, 0xb8, 0x50, 0x49, 0x27, 0x09, 0x9f, 0x09, 0x53, 0x8d, 0x32, 0x3b, - 0xff, 0x5d, 0x38, 0x2d, 0x1c, 0x40, 0x69, 0xe8, 0xd8, 0x76, 0xaf, 0x7d, 0x84, 0x70, 0xff, 0xc8, - 0x13, 0x73, 0xe4, 0x98, 0x12, 0x73, 0x4c, 0x5a, 0x59, 0x67, 0x35, 0xed, 0x6b, 0x82, 0xa8, 0xbf, - 0x1b, 0x1c, 0x6e, 0x42, 0x01, 0x1b, 0xad, 0x1a, 0x45, 0x62, 0x52, 0xa4, 0xf0, 0x19, 0x00, 0xf5, - 0x62, 0x0b, 0x7b, 0x62, 0xbe, 0xc2, 0xad, 0x97, 0xea, 0x2b, 0x63, 0x5f, 0xb9, 0xcf, 0x46, 0x06, - 0x3e, 0xd5, 0x28, 0x10, 0x83, 0xd4, 0xe8, 0x56, 0x74, 0x22, 0xba, 0xb3, 0x58, 0x20, 0x71, 0x6b, - 0xd3, 0x3b, 0x52, 0x6f, 0xb4, 0x63, 0x83, 0x58, 0x42, 0x03, 0x96, 0x42, 0xaf, 0x6d, 0xb9, 0xc8, - 0x72, 0x4f, 0x5d, 0x11, 0x48, 0xb8, 0x34, 0xf6, 0x95, 0xd5, 0x44, 0x78, 0x04, 0x50, 0x8d, 0x7b, - 0x74, 0x85, 0x68, 0x42, 0xe8, 0xc1, 0x72, 0xec, 0x8d, 0x68, 0x29, 0xbe, 0x91, 0x16, 0x25, 0xa4, - 0x65, 0x2d, 0x6e, 0x0a, 0x89, 0x15, 0x54, 0x63, 0x29, 0x9e, 0x0a, 0xe9, 0x99, 0x14, 0x6c, 0xe9, - 0x86, 0x82, 0xfd, 0x3d, 0x3b, 0xa3, 0x60, 0xb7, 0xcd, 0xe3, 0xeb, 0x4d, 0x89, 0x7b, 0xab, 0xa6, - 0x64, 0x82, 0x94, 0xac, 0x99, 0x19, 0x15, 0xfc, 0xe1, 0xd8, 0x57, 0x1e, 0xcd, 0xaa, 0xaf, 0xe4, - 0xc2, 0x62, 0xa2, 0xb0, 0xd8, 0x4d, 0x98, 0x4e, 0x95, 0x4e, 0x76, 0xaa, 0xf9, 0x17, 0xdb, 0xb4, - 0x8a, 0xb3, 0x73, 0x54, 0x71, 0x0d, 0xa8, 0x38, 0xdb, 0x9e, 0x33, 0x12, 0x17, 0x88, 0x9a, 0x98, - 0xe6, 0x18, 0xbb, 0x54, 0x23, 0x4f, 0xc6, 0x41, 0x3f, 0x9d, 0x96, 0x70, 0xee, 0x6e, 0x12, 0xce, - 0xcf, 0x45, 0xc2, 0x85, 0xff, 0x54, 0xc2, 0x70, 0x83, 0x84, 0xcf, 0x79, 0x10, 0xaf, 0x49, 0xb8, - 0x61, 0x5b, 0x3d, 0xec, 0x0c, 0xee, 0x2a, 0xe3, 0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xbc, 0x1a, 0xff, 0x4f, 0xfa, 0x74, 0xf3, 0x31, 0xf3, 0x2f, 0xce, 0x1b, - 0x0d, 0x91, 0x7b, 0xb8, 0x40, 0x9e, 0xd9, 0xcd, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x62, 0x66, - 0x42, 0x8b, 0xe9, 0x0d, 0x00, 0x00, + // 1219 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0xcf, 0x6f, 0xe3, 0x44, + 0x14, 0x8e, 0xf3, 0xa3, 0x49, 0x5e, 0xd2, 0x6d, 0xeb, 0x4d, 0x5b, 0x63, 0xb6, 0x76, 0xd6, 0x80, + 0xa8, 0xd0, 0x36, 0xd9, 0xb4, 0x0b, 0x42, 0x45, 0x1c, 0x92, 0x6c, 0x10, 0x11, 0xb4, 0x5b, 0xb9, + 0x29, 0x12, 0xbd, 0x44, 0xa9, 0x33, 0x49, 0xad, 0x34, 0x76, 0x64, 0xbb, 0xdd, 0x0d, 0x57, 0x2e, + 0xab, 0x5e, 0xe0, 0xc2, 0x81, 0x43, 0xa5, 0x95, 0xb8, 0xf3, 0x37, 0x70, 0x5c, 0x71, 0xda, 0x23, + 0xa7, 0x08, 0xb5, 0x17, 0xb8, 0xe6, 0xc6, 0x0d, 0x79, 0xc6, 0x76, 0xc6, 0x89, 0xa3, 0x6d, 0xda, + 0x22, 0x4e, 0x9d, 0x37, 0xef, 0x7b, 0xf3, 0xe6, 0x7d, 0xfe, 0xde, 0xcc, 0xa4, 0xf0, 0xa1, 0x7a, + 0xa4, 0xe4, 0x15, 0xdd, 0x40, 0x79, 0x45, 0xd7, 0x34, 0xa4, 0x58, 0xaa, 0xae, 0xe5, 0xcf, 0x0a, + 0x94, 0x95, 0xeb, 0x19, 0xba, 0xa5, 0xb3, 0x2b, 0xea, 0x91, 0x92, 0xb3, 0x81, 0x39, 0xca, 0x75, + 0x56, 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xd1, 0x97, 0xbf, 0x08, 0xa1, 0xcd, 0x7f, 0x22, 0x10, 0xd9, 0x31, 0xdb, 0xec, 0x77, 0xc0, + 0x06, 0xfc, 0xac, 0xda, 0x98, 0x26, 0xca, 0xc0, 0x9f, 0x1b, 0xfc, 0xc7, 0x33, 0xc1, 0xdd, 0x83, + 0x8b, 0x7d, 0x0e, 0x4b, 0x93, 0xbf, 0x4c, 0x1e, 0x5d, 0x7b, 0xad, 0x9a, 0xd1, 0xe7, 0x9f, 0xcc, + 0x82, 0x9e, 0x9e, 0xd8, 0x3e, 0xe8, 0xaf, 0x9f, 0xb8, 0xa8, 0x74, 0x66, 0x48, 0x4c, 0xdd, 0x6d, + 0xec, 0xf7, 0x0c, 0x2c, 0x07, 0x5f, 0x6c, 0x8f, 0xaf, 0xbd, 0x9e, 0x13, 0xc1, 0x7f, 0x3a, 0x6b, + 0x84, 0xbb, 0x8b, 0xd2, 0xc1, 0xeb, 0x4b, 0x81, 0x79, 0x73, 0x29, 0x30, 0x7f, 0x5e, 0x0a, 0xcc, + 0x8f, 0x57, 0x42, 0xe8, 0xcd, 0x95, 0x10, 0xfa, 0xe3, 0x4a, 0x08, 0x1d, 0x7e, 0xd6, 0x56, 0xad, + 0xe3, 0xd3, 0x23, 0xbb, 0x6d, 0xf3, 0x8a, 0x6e, 0x76, 0x75, 0xd3, 0xf9, 0xb3, 0x61, 0x36, 0x3b, + 0xf9, 0x17, 0x79, 0xef, 0x87, 0xfa, 0xe3, 0xad, 0x0d, 0xea, 0xdf, 0x08, 0x56, 0xbf, 0x87, 0xcc, + 0xa3, 0x39, 0xfc, 0x4c, 0xdb, 0xfa, 0x37, 0x00, 0x00, 0xff, 0xff, 0x85, 0x21, 0x71, 0xfb, 0x6a, + 0x10, 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 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. + ConnectionOpenInit(ctx context.Context, in *MsgConnectionOpenInit, opts ...grpc.CallOption) (*MsgConnectionOpenInitResponse, error) + // ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. + ConnectionOpenTry(ctx context.Context, in *MsgConnectionOpenTry, opts ...grpc.CallOption) (*MsgConnectionOpenTryResponse, error) + // ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. + ConnectionOpenAck(ctx context.Context, in *MsgConnectionOpenAck, opts ...grpc.CallOption) (*MsgConnectionOpenAckResponse, error) + // ConnectionOpenConfirm defines a rpc handler method for MsgConnectionOpenConfirm. + ConnectionOpenConfirm(ctx context.Context, in *MsgConnectionOpenConfirm, opts ...grpc.CallOption) (*MsgConnectionOpenConfirmResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) ConnectionOpenInit(ctx context.Context, in *MsgConnectionOpenInit, opts ...grpc.CallOption) (*MsgConnectionOpenInitResponse, error) { + out := new(MsgConnectionOpenInitResponse) + err := c.cc.Invoke(ctx, "/ibc.core.connection.v1.Msg/ConnectionOpenInit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ConnectionOpenTry(ctx context.Context, in *MsgConnectionOpenTry, opts ...grpc.CallOption) (*MsgConnectionOpenTryResponse, error) { + out := new(MsgConnectionOpenTryResponse) + err := c.cc.Invoke(ctx, "/ibc.core.connection.v1.Msg/ConnectionOpenTry", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ConnectionOpenAck(ctx context.Context, in *MsgConnectionOpenAck, opts ...grpc.CallOption) (*MsgConnectionOpenAckResponse, error) { + out := new(MsgConnectionOpenAckResponse) + err := c.cc.Invoke(ctx, "/ibc.core.connection.v1.Msg/ConnectionOpenAck", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ConnectionOpenConfirm(ctx context.Context, in *MsgConnectionOpenConfirm, opts ...grpc.CallOption) (*MsgConnectionOpenConfirmResponse, error) { + out := new(MsgConnectionOpenConfirmResponse) + err := c.cc.Invoke(ctx, "/ibc.core.connection.v1.Msg/ConnectionOpenConfirm", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. + ConnectionOpenInit(context.Context, *MsgConnectionOpenInit) (*MsgConnectionOpenInitResponse, error) + // ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. + ConnectionOpenTry(context.Context, *MsgConnectionOpenTry) (*MsgConnectionOpenTryResponse, error) + // ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. + ConnectionOpenAck(context.Context, *MsgConnectionOpenAck) (*MsgConnectionOpenAckResponse, error) + // ConnectionOpenConfirm defines a rpc handler method for MsgConnectionOpenConfirm. + ConnectionOpenConfirm(context.Context, *MsgConnectionOpenConfirm) (*MsgConnectionOpenConfirmResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) ConnectionOpenInit(ctx context.Context, req *MsgConnectionOpenInit) (*MsgConnectionOpenInitResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConnectionOpenInit not implemented") +} +func (*UnimplementedMsgServer) ConnectionOpenTry(ctx context.Context, req *MsgConnectionOpenTry) (*MsgConnectionOpenTryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConnectionOpenTry not implemented") +} +func (*UnimplementedMsgServer) ConnectionOpenAck(ctx context.Context, req *MsgConnectionOpenAck) (*MsgConnectionOpenAckResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConnectionOpenAck not implemented") +} +func (*UnimplementedMsgServer) ConnectionOpenConfirm(ctx context.Context, req *MsgConnectionOpenConfirm) (*MsgConnectionOpenConfirmResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConnectionOpenConfirm not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_ConnectionOpenInit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgConnectionOpenInit) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ConnectionOpenInit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.connection.v1.Msg/ConnectionOpenInit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ConnectionOpenInit(ctx, req.(*MsgConnectionOpenInit)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ConnectionOpenTry_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgConnectionOpenTry) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ConnectionOpenTry(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.connection.v1.Msg/ConnectionOpenTry", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ConnectionOpenTry(ctx, req.(*MsgConnectionOpenTry)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ConnectionOpenAck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgConnectionOpenAck) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ConnectionOpenAck(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.connection.v1.Msg/ConnectionOpenAck", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ConnectionOpenAck(ctx, req.(*MsgConnectionOpenAck)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ConnectionOpenConfirm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgConnectionOpenConfirm) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ConnectionOpenConfirm(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.connection.v1.Msg/ConnectionOpenConfirm", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ConnectionOpenConfirm(ctx, req.(*MsgConnectionOpenConfirm)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ibc.core.connection.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ConnectionOpenInit", + Handler: _Msg_ConnectionOpenInit_Handler, + }, + { + MethodName: "ConnectionOpenTry", + Handler: _Msg_ConnectionOpenTry_Handler, + }, + { + MethodName: "ConnectionOpenAck", + Handler: _Msg_ConnectionOpenAck_Handler, + }, + { + MethodName: "ConnectionOpenConfirm", + Handler: _Msg_ConnectionOpenConfirm_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "ibc/core/connection/v1/connection.proto", } func (m *MsgConnectionOpenInit) Marshal() (dAtA []byte, err error) { @@ -694,6 +1054,29 @@ func (m *MsgConnectionOpenInit) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgConnectionOpenInitResponse) 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 *MsgConnectionOpenInitResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConnectionOpenInitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgConnectionOpenTry) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -817,6 +1200,29 @@ func (m *MsgConnectionOpenTry) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgConnectionOpenTryResponse) 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 *MsgConnectionOpenTryResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConnectionOpenTryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgConnectionOpenAck) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -921,6 +1327,29 @@ func (m *MsgConnectionOpenAck) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgConnectionOpenAckResponse) 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 *MsgConnectionOpenAckResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConnectionOpenAckResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgConnectionOpenConfirm) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -975,6 +1404,29 @@ func (m *MsgConnectionOpenConfirm) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } +func (m *MsgConnectionOpenConfirmResponse) 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 *MsgConnectionOpenConfirmResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConnectionOpenConfirmResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *ConnectionEnd) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1285,6 +1737,15 @@ func (m *MsgConnectionOpenInit) Size() (n int) { return n } +func (m *MsgConnectionOpenInitResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgConnectionOpenTry) Size() (n int) { if m == nil { return 0 @@ -1338,6 +1799,15 @@ func (m *MsgConnectionOpenTry) Size() (n int) { return n } +func (m *MsgConnectionOpenTryResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgConnectionOpenAck) Size() (n int) { if m == nil { return 0 @@ -1383,6 +1853,15 @@ func (m *MsgConnectionOpenAck) Size() (n int) { return n } +func (m *MsgConnectionOpenAckResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgConnectionOpenConfirm) Size() (n int) { if m == nil { return 0 @@ -1406,6 +1885,15 @@ func (m *MsgConnectionOpenConfirm) Size() (n int) { return n } +func (m *MsgConnectionOpenConfirmResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *ConnectionEnd) Size() (n int) { if m == nil { return 0 @@ -1750,6 +2238,59 @@ func (m *MsgConnectionOpenInit) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgConnectionOpenInitResponse) 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 ErrIntOverflowConnection + } + 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: MsgConnectionOpenInitResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConnectionOpenInitResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipConnection(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthConnection + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthConnection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgConnectionOpenTry) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2200,6 +2741,59 @@ func (m *MsgConnectionOpenTry) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgConnectionOpenTryResponse) 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 ErrIntOverflowConnection + } + 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: MsgConnectionOpenTryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConnectionOpenTryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipConnection(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthConnection + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthConnection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgConnectionOpenAck) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2585,6 +3179,59 @@ func (m *MsgConnectionOpenAck) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgConnectionOpenAckResponse) 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 ErrIntOverflowConnection + } + 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: MsgConnectionOpenAckResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConnectionOpenAckResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipConnection(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthConnection + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthConnection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgConnectionOpenConfirm) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2769,6 +3416,59 @@ func (m *MsgConnectionOpenConfirm) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgConnectionOpenConfirmResponse) 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 ErrIntOverflowConnection + } + 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: MsgConnectionOpenConfirmResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConnectionOpenConfirmResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipConnection(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthConnection + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthConnection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *ConnectionEnd) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/ibc/core/handler.go b/x/ibc/core/handler.go index 684a7c6a1ca8..4c34188915c4 100644 --- a/x/ibc/core/handler.go +++ b/x/ibc/core/handler.go @@ -6,9 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - client "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client" clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" - connection "github.com/cosmos/cosmos-sdk/x/ibc/core/03-connection" connectiontypes "github.com/cosmos/cosmos-sdk/x/ibc/core/03-connection/types" channel "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel" channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel/types" @@ -21,29 +19,40 @@ func NewHandler(k keeper.Keeper) sdk.Handler { return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) + var msgServer = keeper.MsgServer{ + Keeper: k, + } + switch msg := msg.(type) { // IBC client msg interface types case *clienttypes.MsgCreateClient: - return client.HandleMsgCreateClient(ctx, k.ClientKeeper, msg) + res, err := msgServer.CreateClient(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *clienttypes.MsgUpdateClient: - return client.HandleMsgUpdateClient(ctx, k.ClientKeeper, msg) + res, err := msgServer.UpdateClient(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *clienttypes.MsgSubmitMisbehaviour: - return client.HandleMsgSubmitMisbehaviour(ctx, k.ClientKeeper, msg) + res, err := msgServer.SubmitMisbehaviour(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) // IBC connection msgs case *connectiontypes.MsgConnectionOpenInit: - return connection.HandleMsgConnectionOpenInit(ctx, k.ConnectionKeeper, msg) + res, err := msgServer.ConnectionOpenInit(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *connectiontypes.MsgConnectionOpenTry: - return connection.HandleMsgConnectionOpenTry(ctx, k.ConnectionKeeper, msg) + res, err := msgServer.ConnectionOpenTry(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *connectiontypes.MsgConnectionOpenAck: - return connection.HandleMsgConnectionOpenAck(ctx, k.ConnectionKeeper, msg) + res, err := msgServer.ConnectionOpenAck(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *connectiontypes.MsgConnectionOpenConfirm: - return connection.HandleMsgConnectionOpenConfirm(ctx, k.ConnectionKeeper, msg) + res, err := msgServer.ConnectionOpenConfirm(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) // IBC channel msgs case *channeltypes.MsgChannelOpenInit: diff --git a/x/ibc/core/keeper/msg_server.go b/x/ibc/core/keeper/msg_server.go new file mode 100644 index 000000000000..8094173deac3 --- /dev/null +++ b/x/ibc/core/keeper/msg_server.go @@ -0,0 +1,243 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" + connectiontypes "github.com/cosmos/cosmos-sdk/x/ibc/core/03-connection/types" +) + +type MsgServer struct { + Keeper +} + +var _ clienttypes.MsgServer = MsgServer{} +var _ connectiontypes.MsgServer = MsgServer{} + +func (k MsgServer) CreateClient(goCtx context.Context, msg *clienttypes.MsgCreateClient) (*clienttypes.MsgCreateClientResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + clientState, err := clienttypes.UnpackClientState(msg.ClientState) + if err != nil { + return nil, err + } + + consensusState, err := clienttypes.UnpackConsensusState(msg.ConsensusState) + if err != nil { + return nil, err + } + + if err = k.ClientKeeper.CreateClient(ctx, msg.ClientId, clientState, consensusState); err != nil { + return nil, err + } + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + clienttypes.EventTypeCreateClient, + sdk.NewAttribute(clienttypes.AttributeKeyClientID, msg.ClientId), + sdk.NewAttribute(clienttypes.AttributeKeyClientType, clientState.ClientType()), + sdk.NewAttribute(clienttypes.AttributeKeyConsensusHeight, clientState.GetLatestHeight().String()), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, clienttypes.AttributeValueCategory), + ), + }) + + return &clienttypes.MsgCreateClientResponse{}, nil +} + +func (k MsgServer) UpdateClient(goCtx context.Context, msg *clienttypes.MsgUpdateClient) (*clienttypes.MsgUpdateClientResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + header, err := clienttypes.UnpackHeader(msg.Header) + if err != nil { + return nil, err + } + + if err = k.ClientKeeper.UpdateClient(ctx, msg.ClientId, header); err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, clienttypes.AttributeValueCategory), + ), + ) + + return &clienttypes.MsgUpdateClientResponse{}, nil +} + +func (k MsgServer) UpgradeClient(goCtx context.Context, msg *clienttypes.MsgUpgradeClient) (*clienttypes.MsgUpgradeClientResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + upgradedClient, err := clienttypes.UnpackClientState(msg.ClientState) + if err != nil { + return nil, err + } + + if err := upgradedClient.Validate(); err != nil { + return nil, err + } + + if err = k.ClientKeeper.UpgradeClient(ctx, msg.ClientId, upgradedClient, msg.UpgradeHeight, msg.ProofUpgrade); err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, clienttypes.AttributeValueCategory), + ), + ) + + return &clienttypes.MsgUpgradeClientResponse{}, nil +} + +func (k MsgServer) SubmitMisbehaviour(goCtx context.Context, msg *clienttypes.MsgSubmitMisbehaviour) (*clienttypes.MsgSubmitMisbehaviourResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + misbehaviour, err := clienttypes.UnpackMisbehaviour(msg.Misbehaviour) + if err != nil { + return nil, err + } + + if err := k.ClientKeeper.CheckMisbehaviourAndUpdateState(ctx, misbehaviour); err != nil { + return nil, sdkerrors.Wrap(err, "failed to process misbehaviour for IBC client") + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + clienttypes.EventTypeSubmitMisbehaviour, + sdk.NewAttribute(clienttypes.AttributeKeyClientID, msg.ClientId), + sdk.NewAttribute(clienttypes.AttributeKeyClientType, misbehaviour.ClientType()), + sdk.NewAttribute(clienttypes.AttributeKeyConsensusHeight, misbehaviour.GetHeight().String()), + ), + ) + + return &clienttypes.MsgSubmitMisbehaviourResponse{}, nil +} + +func (k MsgServer) ConnectionOpenInit(goCtx context.Context, msg *connectiontypes.MsgConnectionOpenInit) (*connectiontypes.MsgConnectionOpenInitResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + if err := k.ConnectionKeeper.ConnOpenInit( + ctx, msg.ConnectionId, msg.ClientId, msg.Counterparty, msg.Version, + ); err != nil { + return nil, sdkerrors.Wrap(err, "connection handshake open init failed") + } + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + connectiontypes.EventTypeConnectionOpenInit, + sdk.NewAttribute(connectiontypes.AttributeKeyConnectionID, msg.ConnectionId), + sdk.NewAttribute(connectiontypes.AttributeKeyClientID, msg.ClientId), + sdk.NewAttribute(connectiontypes.AttributeKeyCounterpartyClientID, msg.Counterparty.ClientId), + sdk.NewAttribute(connectiontypes.AttributeKeyCounterpartyConnectionID, msg.Counterparty.ConnectionId), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, connectiontypes.AttributeValueCategory), + ), + }) + + return &connectiontypes.MsgConnectionOpenInitResponse{}, nil +} + +func (k MsgServer) ConnectionOpenTry(goCtx context.Context, msg *connectiontypes.MsgConnectionOpenTry) (*connectiontypes.MsgConnectionOpenTryResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + targetClient, err := clienttypes.UnpackClientState(msg.ClientState) + if err != nil { + return nil, sdkerrors.Wrapf(err, "client in msg is not exported.ClientState. invalid client: %v.", targetClient) + } + + if err := k.ConnectionKeeper.ConnOpenTry( + ctx, msg.DesiredConnectionId, msg.CounterpartyChosenConnectionId, msg.Counterparty, msg.ClientId, targetClient, + msg.CounterpartyVersions, msg.ProofInit, msg.ProofClient, msg.ProofConsensus, + msg.ProofHeight, msg.ConsensusHeight, + ); err != nil { + return nil, sdkerrors.Wrap(err, "connection handshake open try failed") + } + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + connectiontypes.EventTypeConnectionOpenTry, + sdk.NewAttribute(connectiontypes.AttributeKeyConnectionID, msg.DesiredConnectionId), + sdk.NewAttribute(connectiontypes.AttributeKeyClientID, msg.ClientId), + sdk.NewAttribute(connectiontypes.AttributeKeyCounterpartyClientID, msg.Counterparty.ClientId), + sdk.NewAttribute(connectiontypes.AttributeKeyCounterpartyConnectionID, msg.Counterparty.ConnectionId), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, connectiontypes.AttributeValueCategory), + ), + }) + + return &connectiontypes.MsgConnectionOpenTryResponse{}, nil +} + +func (k MsgServer) ConnectionOpenAck(goCtx context.Context, msg *connectiontypes.MsgConnectionOpenAck) (*connectiontypes.MsgConnectionOpenAckResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + targetClient, err := clienttypes.UnpackClientState(msg.ClientState) + if err != nil { + return nil, sdkerrors.Wrapf(err, "client in msg is not exported.ClientState. invalid client: %v", targetClient) + } + + if err := k.ConnectionKeeper.ConnOpenAck( + ctx, msg.ConnectionId, targetClient, msg.Version, msg.CounterpartyConnectionId, + msg.ProofTry, msg.ProofClient, msg.ProofConsensus, + msg.ProofHeight, msg.ConsensusHeight, + ); err != nil { + return nil, sdkerrors.Wrap(err, "connection handshake open ack failed") + } + + connectionEnd, _ := k.ConnectionKeeper.GetConnection(ctx, msg.ConnectionId) + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + connectiontypes.EventTypeConnectionOpenAck, + sdk.NewAttribute(connectiontypes.AttributeKeyConnectionID, msg.ConnectionId), + sdk.NewAttribute(connectiontypes.AttributeKeyClientID, connectionEnd.ClientId), + sdk.NewAttribute(connectiontypes.AttributeKeyCounterpartyClientID, connectionEnd.Counterparty.ClientId), + sdk.NewAttribute(connectiontypes.AttributeKeyCounterpartyConnectionID, connectionEnd.Counterparty.ConnectionId), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, connectiontypes.AttributeValueCategory), + ), + }) + + return &connectiontypes.MsgConnectionOpenAckResponse{}, nil +} + +func (k MsgServer) ConnectionOpenConfirm(goCtx context.Context, msg *connectiontypes.MsgConnectionOpenConfirm) (*connectiontypes.MsgConnectionOpenConfirmResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + if err := k.ConnectionKeeper.ConnOpenConfirm( + ctx, msg.ConnectionId, msg.ProofAck, msg.ProofHeight, + ); err != nil { + return nil, sdkerrors.Wrap(err, "connection handshake open confirm failed") + } + + connectionEnd, _ := k.ConnectionKeeper.GetConnection(ctx, msg.ConnectionId) + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + connectiontypes.EventTypeConnectionOpenConfirm, + sdk.NewAttribute(connectiontypes.AttributeKeyConnectionID, msg.ConnectionId), + sdk.NewAttribute(connectiontypes.AttributeKeyClientID, connectionEnd.ClientId), + sdk.NewAttribute(connectiontypes.AttributeKeyCounterpartyClientID, connectionEnd.Counterparty.ClientId), + sdk.NewAttribute(connectiontypes.AttributeKeyCounterpartyConnectionID, connectionEnd.Counterparty.ConnectionId), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, connectiontypes.AttributeValueCategory), + ), + }) + + return &connectiontypes.MsgConnectionOpenConfirmResponse{}, nil +} From 60830b67ddacf8cdea721aae70f1a8af91154381 Mon Sep 17 00:00:00 2001 From: atheesh Date: Fri, 16 Oct 2020 13:52:29 +0530 Subject: [PATCH 02/12] updated handler --- proto/ibc/core/channel/v1/channel.proto | 67 +- x/ibc/core/02-client/handler.go | 83 - x/ibc/core/03-connection/handler.go | 134 -- x/ibc/core/04-channel/types/channel.pb.go | 1892 +++++++++++++++++++-- x/ibc/core/handler.go | 325 +--- x/ibc/core/keeper/msg_server.go | 364 ++++ 6 files changed, 2236 insertions(+), 629 deletions(-) diff --git a/proto/ibc/core/channel/v1/channel.proto b/proto/ibc/core/channel/v1/channel.proto index 342f4d32e722..41414e8c2331 100644 --- a/proto/ibc/core/channel/v1/channel.proto +++ b/proto/ibc/core/channel/v1/channel.proto @@ -6,6 +6,39 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel/types"; import "gogoproto/gogo.proto"; import "ibc/core/client/v1/client.proto"; +// Msg defines the ibc/channel Msg service. +service Msg { + // ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. + rpc ChannelOpenInit(MsgChannelOpenInit) returns (MsgChannelOpenInitResponse); + + // ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. + rpc ChannelOpenTry(MsgChannelOpenTry) returns (MsgChannelOpenTryResponse); + + // ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. + rpc ChannelOpenAck(MsgChannelOpenAck) returns (MsgChannelOpenAckResponse); + + // ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. + rpc ChannelOpenConfirm(MsgChannelOpenConfirm) returns (MsgChannelOpenConfirmResponse); + + // ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. + rpc ChannelCloseInit(MsgChannelCloseInit) returns (MsgChannelCloseInitResponse); + + // ChannelCloseConfirm defines a rpc handler method for MsgChannelCloseConfirm. + rpc ChannelCloseConfirm(MsgChannelCloseConfirm) returns (MsgChannelCloseConfirmResponse); + + // RecvPacket defines a rpc handler method for MsgRecvPacket. + rpc RecvPacket(MsgRecvPacket) returns (MsgRecvPacketResponse); + + // Timeout defines a rpc handler method for MsgTimeout. + rpc Timeout(MsgTimeout) returns (MsgTimeoutResponse); + + // TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. + rpc TimeoutOnClose(MsgTimeoutOnClose) returns (MsgTimeoutOnCloseResponse); + + // Acknowledgement defines a rpc handler method for MsgAcknowledgement. + rpc Acknowledgement(MsgAcknowledgement) returns (MsgAcknowledgementResponse); +} + // MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It // is called by a relayer on Chain A. message MsgChannelOpenInit { @@ -18,7 +51,10 @@ message MsgChannelOpenInit { string signer = 4; } -// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel +// MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. +message MsgChannelOpenInitResponse {} + +// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel // on Chain B. message MsgChannelOpenTry { option (gogoproto.equal) = false; @@ -35,6 +71,9 @@ message MsgChannelOpenTry { string signer = 8; } +// MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. +message MsgChannelOpenTryResponse {} + // MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge // the change of channel state to TRYOPEN on Chain B. message MsgChannelOpenAck { @@ -51,6 +90,9 @@ message MsgChannelOpenAck { string signer = 7; } +// MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. +message MsgChannelOpenAckResponse {} + // MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to // acknowledge the change of channel state to OPEN on Chain A. message MsgChannelOpenConfirm { @@ -65,6 +107,9 @@ message MsgChannelOpenConfirm { string signer = 5; } +// MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response type. +message MsgChannelOpenConfirmResponse {} + // MsgChannelCloseInit defines a msg sent by a Relayer to Chain A // to close a channel with Chain B. message MsgChannelCloseInit { @@ -76,6 +121,9 @@ message MsgChannelCloseInit { string signer = 3; } +// MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. +message MsgChannelCloseInitResponse {} + // MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B // to acknowledge the change of channel state to CLOSED on Chain A. message MsgChannelCloseConfirm { @@ -90,6 +138,9 @@ message MsgChannelCloseConfirm { string signer = 5; } +// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response type. +message MsgChannelCloseConfirmResponse {} + // MsgRecvPacket receives incoming IBC packet message MsgRecvPacket { option (gogoproto.equal) = false; @@ -102,6 +153,9 @@ message MsgRecvPacket { string signer = 4; } +// MsgRecvPacketResponse defines the Msg/RecvPacket response type. +message MsgRecvPacketResponse {} + // MsgTimeout receives timed-out packet message MsgTimeout { option (gogoproto.equal) = false; @@ -115,6 +169,9 @@ message MsgTimeout { string signer = 5; } +// MsgTimeoutResponse defines the Msg/Timeout response type. +message MsgTimeoutResponse {} + // MsgTimeoutOnClose timed-out packet upon counterparty channel closure. message MsgTimeoutOnClose { option (gogoproto.equal) = false; @@ -129,6 +186,9 @@ message MsgTimeoutOnClose { string signer = 6; } +// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. +message MsgTimeoutOnCloseResponse {} + // MsgAcknowledgement receives incoming IBC acknowledgement message MsgAcknowledgement { option (gogoproto.equal) = false; @@ -142,6 +202,9 @@ message MsgAcknowledgement { string signer = 5; } +// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. +message MsgAcknowledgementResponse {} + // Channel defines pipeline for exactly-once packet delivery between specific // modules on separate blockchains, which has at least one end capable of // sending packets and one end capable of receiving packets. @@ -278,4 +341,4 @@ message Acknowledgement { bytes result = 21; string error = 22; } -} +} \ No newline at end of file diff --git a/x/ibc/core/02-client/handler.go b/x/ibc/core/02-client/handler.go index 55cf0862f84e..65de90767ef8 100644 --- a/x/ibc/core/02-client/handler.go +++ b/x/ibc/core/02-client/handler.go @@ -8,63 +8,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" ) -// HandleMsgCreateClient defines the sdk.Handler for MsgCreateClient -func HandleMsgCreateClient(ctx sdk.Context, k keeper.Keeper, msg *types.MsgCreateClient) (*sdk.Result, error) { - clientState, err := types.UnpackClientState(msg.ClientState) - if err != nil { - return nil, err - } - - consensusState, err := types.UnpackConsensusState(msg.ConsensusState) - if err != nil { - return nil, err - } - - if err = k.CreateClient(ctx, msg.ClientId, clientState, consensusState); err != nil { - return nil, err - } - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeCreateClient, - sdk.NewAttribute(types.AttributeKeyClientID, msg.ClientId), - sdk.NewAttribute(types.AttributeKeyClientType, clientState.ClientType()), - sdk.NewAttribute(types.AttributeKeyConsensusHeight, clientState.GetLatestHeight().String()), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - }) - - return &sdk.Result{ - Events: ctx.EventManager().Events().ToABCIEvents(), - }, nil -} - -// HandleMsgUpdateClient defines the sdk.Handler for MsgUpdateClient -func HandleMsgUpdateClient(ctx sdk.Context, k keeper.Keeper, msg *types.MsgUpdateClient) (*sdk.Result, error) { - header, err := types.UnpackHeader(msg.Header) - if err != nil { - return nil, err - } - - if err = k.UpdateClient(ctx, msg.ClientId, header); err != nil { - return nil, err - } - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - ) - - return &sdk.Result{ - Events: ctx.EventManager().Events().ToABCIEvents(), - }, nil -} - // HandleMsgUpgradeClient defines the sdk.Handler for MsgUpgradeClient func HandleMsgUpgradeClient(ctx sdk.Context, k keeper.Keeper, msg *types.MsgUpgradeClient) (*sdk.Result, error) { upgradedClient, err := types.UnpackClientState(msg.ClientState) @@ -92,32 +35,6 @@ func HandleMsgUpgradeClient(ctx sdk.Context, k keeper.Keeper, msg *types.MsgUpgr }, nil } -// HandleMsgSubmitMisbehaviour defines the Evidence module handler for submitting a -// light client misbehaviour. -func HandleMsgSubmitMisbehaviour(ctx sdk.Context, k keeper.Keeper, msg *types.MsgSubmitMisbehaviour) (*sdk.Result, error) { - misbehaviour, err := types.UnpackMisbehaviour(msg.Misbehaviour) - if err != nil { - return nil, err - } - - if err := k.CheckMisbehaviourAndUpdateState(ctx, misbehaviour); err != nil { - return nil, sdkerrors.Wrap(err, "failed to process misbehaviour for IBC client") - } - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - types.EventTypeSubmitMisbehaviour, - sdk.NewAttribute(types.AttributeKeyClientID, msg.ClientId), - sdk.NewAttribute(types.AttributeKeyClientType, misbehaviour.ClientType()), - sdk.NewAttribute(types.AttributeKeyConsensusHeight, misbehaviour.GetHeight().String()), - ), - ) - - return &sdk.Result{ - Events: ctx.EventManager().Events().ToABCIEvents(), - }, nil -} - // NewClientUpdateProposalHandler defines the client update proposal handler func NewClientUpdateProposalHandler(k keeper.Keeper) govtypes.Handler { return func(ctx sdk.Context, content govtypes.Content) error { diff --git a/x/ibc/core/03-connection/handler.go b/x/ibc/core/03-connection/handler.go index da298038d723..c2b0392420df 100644 --- a/x/ibc/core/03-connection/handler.go +++ b/x/ibc/core/03-connection/handler.go @@ -1,135 +1 @@ package connection - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" - "github.com/cosmos/cosmos-sdk/x/ibc/core/03-connection/keeper" - "github.com/cosmos/cosmos-sdk/x/ibc/core/03-connection/types" -) - -// HandleMsgConnectionOpenInit defines the sdk.Handler for MsgConnectionOpenInit -func HandleMsgConnectionOpenInit(ctx sdk.Context, k keeper.Keeper, msg *types.MsgConnectionOpenInit) (*sdk.Result, error) { - if err := k.ConnOpenInit( - ctx, msg.ConnectionId, msg.ClientId, msg.Counterparty, msg.Version, - ); err != nil { - return nil, sdkerrors.Wrap(err, "connection handshake open init failed") - } - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeConnectionOpenInit, - sdk.NewAttribute(types.AttributeKeyConnectionID, msg.ConnectionId), - sdk.NewAttribute(types.AttributeKeyClientID, msg.ClientId), - sdk.NewAttribute(types.AttributeKeyCounterpartyClientID, msg.Counterparty.ClientId), - sdk.NewAttribute(types.AttributeKeyCounterpartyConnectionID, msg.Counterparty.ConnectionId), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - }) - - return &sdk.Result{ - Events: ctx.EventManager().Events().ToABCIEvents(), - }, nil -} - -// HandleMsgConnectionOpenTry defines the sdk.Handler for MsgConnectionOpenTry -func HandleMsgConnectionOpenTry(ctx sdk.Context, k keeper.Keeper, msg *types.MsgConnectionOpenTry) (*sdk.Result, error) { - targetClient, err := clienttypes.UnpackClientState(msg.ClientState) - if err != nil { - return nil, sdkerrors.Wrapf(err, "client in msg is not exported.ClientState. invalid client: %v.", targetClient) - } - - if err := k.ConnOpenTry( - ctx, msg.DesiredConnectionId, msg.CounterpartyChosenConnectionId, msg.Counterparty, msg.ClientId, targetClient, - msg.CounterpartyVersions, msg.ProofInit, msg.ProofClient, msg.ProofConsensus, - msg.ProofHeight, msg.ConsensusHeight, - ); err != nil { - return nil, sdkerrors.Wrap(err, "connection handshake open try failed") - } - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeConnectionOpenTry, - sdk.NewAttribute(types.AttributeKeyConnectionID, msg.DesiredConnectionId), - sdk.NewAttribute(types.AttributeKeyClientID, msg.ClientId), - sdk.NewAttribute(types.AttributeKeyCounterpartyClientID, msg.Counterparty.ClientId), - sdk.NewAttribute(types.AttributeKeyCounterpartyConnectionID, msg.Counterparty.ConnectionId), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - }) - - return &sdk.Result{ - Events: ctx.EventManager().Events().ToABCIEvents(), - }, nil -} - -// HandleMsgConnectionOpenAck defines the sdk.Handler for MsgConnectionOpenAck -func HandleMsgConnectionOpenAck(ctx sdk.Context, k keeper.Keeper, msg *types.MsgConnectionOpenAck) (*sdk.Result, error) { - targetClient, err := clienttypes.UnpackClientState(msg.ClientState) - if err != nil { - return nil, sdkerrors.Wrapf(err, "client in msg is not exported.ClientState. invalid client: %v", targetClient) - } - - if err := k.ConnOpenAck( - ctx, msg.ConnectionId, targetClient, msg.Version, msg.CounterpartyConnectionId, - msg.ProofTry, msg.ProofClient, msg.ProofConsensus, - msg.ProofHeight, msg.ConsensusHeight, - ); err != nil { - return nil, sdkerrors.Wrap(err, "connection handshake open ack failed") - } - - connectionEnd, _ := k.GetConnection(ctx, msg.ConnectionId) - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeConnectionOpenAck, - sdk.NewAttribute(types.AttributeKeyConnectionID, msg.ConnectionId), - sdk.NewAttribute(types.AttributeKeyClientID, connectionEnd.ClientId), - sdk.NewAttribute(types.AttributeKeyCounterpartyClientID, connectionEnd.Counterparty.ClientId), - sdk.NewAttribute(types.AttributeKeyCounterpartyConnectionID, connectionEnd.Counterparty.ConnectionId), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - }) - - return &sdk.Result{ - Events: ctx.EventManager().Events().ToABCIEvents(), - }, nil -} - -// HandleMsgConnectionOpenConfirm defines the sdk.Handler for MsgConnectionOpenConfirm -func HandleMsgConnectionOpenConfirm(ctx sdk.Context, k keeper.Keeper, msg *types.MsgConnectionOpenConfirm) (*sdk.Result, error) { - if err := k.ConnOpenConfirm( - ctx, msg.ConnectionId, msg.ProofAck, msg.ProofHeight, - ); err != nil { - return nil, sdkerrors.Wrap(err, "connection handshake open confirm failed") - } - - connectionEnd, _ := k.GetConnection(ctx, msg.ConnectionId) - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeConnectionOpenConfirm, - sdk.NewAttribute(types.AttributeKeyConnectionID, msg.ConnectionId), - sdk.NewAttribute(types.AttributeKeyClientID, connectionEnd.ClientId), - sdk.NewAttribute(types.AttributeKeyCounterpartyClientID, connectionEnd.Counterparty.ClientId), - sdk.NewAttribute(types.AttributeKeyCounterpartyConnectionID, connectionEnd.Counterparty.ConnectionId), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - }) - - return &sdk.Result{ - Events: ctx.EventManager().Events().ToABCIEvents(), - }, nil -} diff --git a/x/ibc/core/04-channel/types/channel.pb.go b/x/ibc/core/04-channel/types/channel.pb.go index dc69ed0b5f61..e06a7ed7ec34 100644 --- a/x/ibc/core/04-channel/types/channel.pb.go +++ b/x/ibc/core/04-channel/types/channel.pb.go @@ -4,10 +4,15 @@ package types import ( + context "context" fmt "fmt" types "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" + grpc1 "github.com/gogo/protobuf/grpc" _ "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" @@ -142,7 +147,44 @@ func (m *MsgChannelOpenInit) XXX_DiscardUnknown() { var xxx_messageInfo_MsgChannelOpenInit proto.InternalMessageInfo -// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel +// MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. +type MsgChannelOpenInitResponse struct { +} + +func (m *MsgChannelOpenInitResponse) Reset() { *m = MsgChannelOpenInitResponse{} } +func (m *MsgChannelOpenInitResponse) String() string { return proto.CompactTextString(m) } +func (*MsgChannelOpenInitResponse) ProtoMessage() {} +func (*MsgChannelOpenInitResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{1} +} +func (m *MsgChannelOpenInitResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelOpenInitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelOpenInitResponse.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 *MsgChannelOpenInitResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelOpenInitResponse.Merge(m, src) +} +func (m *MsgChannelOpenInitResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelOpenInitResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelOpenInitResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelOpenInitResponse proto.InternalMessageInfo + +// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel // on Chain B. type MsgChannelOpenTry struct { PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` @@ -159,7 +201,7 @@ func (m *MsgChannelOpenTry) Reset() { *m = MsgChannelOpenTry{} } func (m *MsgChannelOpenTry) String() string { return proto.CompactTextString(m) } func (*MsgChannelOpenTry) ProtoMessage() {} func (*MsgChannelOpenTry) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{1} + return fileDescriptor_c3a07336710636a0, []int{2} } func (m *MsgChannelOpenTry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -188,6 +230,43 @@ func (m *MsgChannelOpenTry) XXX_DiscardUnknown() { var xxx_messageInfo_MsgChannelOpenTry proto.InternalMessageInfo +// MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. +type MsgChannelOpenTryResponse struct { +} + +func (m *MsgChannelOpenTryResponse) Reset() { *m = MsgChannelOpenTryResponse{} } +func (m *MsgChannelOpenTryResponse) String() string { return proto.CompactTextString(m) } +func (*MsgChannelOpenTryResponse) ProtoMessage() {} +func (*MsgChannelOpenTryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{3} +} +func (m *MsgChannelOpenTryResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelOpenTryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelOpenTryResponse.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 *MsgChannelOpenTryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelOpenTryResponse.Merge(m, src) +} +func (m *MsgChannelOpenTryResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelOpenTryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelOpenTryResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelOpenTryResponse proto.InternalMessageInfo + // MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge // the change of channel state to TRYOPEN on Chain B. type MsgChannelOpenAck struct { @@ -204,7 +283,7 @@ func (m *MsgChannelOpenAck) Reset() { *m = MsgChannelOpenAck{} } func (m *MsgChannelOpenAck) String() string { return proto.CompactTextString(m) } func (*MsgChannelOpenAck) ProtoMessage() {} func (*MsgChannelOpenAck) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{2} + return fileDescriptor_c3a07336710636a0, []int{4} } func (m *MsgChannelOpenAck) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -233,6 +312,43 @@ func (m *MsgChannelOpenAck) XXX_DiscardUnknown() { var xxx_messageInfo_MsgChannelOpenAck proto.InternalMessageInfo +// MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. +type MsgChannelOpenAckResponse struct { +} + +func (m *MsgChannelOpenAckResponse) Reset() { *m = MsgChannelOpenAckResponse{} } +func (m *MsgChannelOpenAckResponse) String() string { return proto.CompactTextString(m) } +func (*MsgChannelOpenAckResponse) ProtoMessage() {} +func (*MsgChannelOpenAckResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{5} +} +func (m *MsgChannelOpenAckResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelOpenAckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelOpenAckResponse.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 *MsgChannelOpenAckResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelOpenAckResponse.Merge(m, src) +} +func (m *MsgChannelOpenAckResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelOpenAckResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelOpenAckResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelOpenAckResponse proto.InternalMessageInfo + // MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to // acknowledge the change of channel state to OPEN on Chain A. type MsgChannelOpenConfirm struct { @@ -247,7 +363,7 @@ func (m *MsgChannelOpenConfirm) Reset() { *m = MsgChannelOpenConfirm{} } func (m *MsgChannelOpenConfirm) String() string { return proto.CompactTextString(m) } func (*MsgChannelOpenConfirm) ProtoMessage() {} func (*MsgChannelOpenConfirm) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{3} + return fileDescriptor_c3a07336710636a0, []int{6} } func (m *MsgChannelOpenConfirm) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -276,6 +392,43 @@ func (m *MsgChannelOpenConfirm) XXX_DiscardUnknown() { var xxx_messageInfo_MsgChannelOpenConfirm proto.InternalMessageInfo +// MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response type. +type MsgChannelOpenConfirmResponse struct { +} + +func (m *MsgChannelOpenConfirmResponse) Reset() { *m = MsgChannelOpenConfirmResponse{} } +func (m *MsgChannelOpenConfirmResponse) String() string { return proto.CompactTextString(m) } +func (*MsgChannelOpenConfirmResponse) ProtoMessage() {} +func (*MsgChannelOpenConfirmResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{7} +} +func (m *MsgChannelOpenConfirmResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelOpenConfirmResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelOpenConfirmResponse.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 *MsgChannelOpenConfirmResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelOpenConfirmResponse.Merge(m, src) +} +func (m *MsgChannelOpenConfirmResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelOpenConfirmResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelOpenConfirmResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelOpenConfirmResponse proto.InternalMessageInfo + // MsgChannelCloseInit defines a msg sent by a Relayer to Chain A // to close a channel with Chain B. type MsgChannelCloseInit struct { @@ -288,7 +441,7 @@ func (m *MsgChannelCloseInit) Reset() { *m = MsgChannelCloseInit{} } func (m *MsgChannelCloseInit) String() string { return proto.CompactTextString(m) } func (*MsgChannelCloseInit) ProtoMessage() {} func (*MsgChannelCloseInit) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{4} + return fileDescriptor_c3a07336710636a0, []int{8} } func (m *MsgChannelCloseInit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -317,6 +470,43 @@ func (m *MsgChannelCloseInit) XXX_DiscardUnknown() { var xxx_messageInfo_MsgChannelCloseInit proto.InternalMessageInfo +// MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. +type MsgChannelCloseInitResponse struct { +} + +func (m *MsgChannelCloseInitResponse) Reset() { *m = MsgChannelCloseInitResponse{} } +func (m *MsgChannelCloseInitResponse) String() string { return proto.CompactTextString(m) } +func (*MsgChannelCloseInitResponse) ProtoMessage() {} +func (*MsgChannelCloseInitResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{9} +} +func (m *MsgChannelCloseInitResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelCloseInitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelCloseInitResponse.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 *MsgChannelCloseInitResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelCloseInitResponse.Merge(m, src) +} +func (m *MsgChannelCloseInitResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelCloseInitResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelCloseInitResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelCloseInitResponse proto.InternalMessageInfo + // MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B // to acknowledge the change of channel state to CLOSED on Chain A. type MsgChannelCloseConfirm struct { @@ -331,7 +521,7 @@ func (m *MsgChannelCloseConfirm) Reset() { *m = MsgChannelCloseConfirm{} func (m *MsgChannelCloseConfirm) String() string { return proto.CompactTextString(m) } func (*MsgChannelCloseConfirm) ProtoMessage() {} func (*MsgChannelCloseConfirm) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{5} + return fileDescriptor_c3a07336710636a0, []int{10} } func (m *MsgChannelCloseConfirm) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -360,6 +550,43 @@ func (m *MsgChannelCloseConfirm) XXX_DiscardUnknown() { var xxx_messageInfo_MsgChannelCloseConfirm proto.InternalMessageInfo +// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response type. +type MsgChannelCloseConfirmResponse struct { +} + +func (m *MsgChannelCloseConfirmResponse) Reset() { *m = MsgChannelCloseConfirmResponse{} } +func (m *MsgChannelCloseConfirmResponse) String() string { return proto.CompactTextString(m) } +func (*MsgChannelCloseConfirmResponse) ProtoMessage() {} +func (*MsgChannelCloseConfirmResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{11} +} +func (m *MsgChannelCloseConfirmResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelCloseConfirmResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelCloseConfirmResponse.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 *MsgChannelCloseConfirmResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelCloseConfirmResponse.Merge(m, src) +} +func (m *MsgChannelCloseConfirmResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelCloseConfirmResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelCloseConfirmResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelCloseConfirmResponse proto.InternalMessageInfo + // MsgRecvPacket receives incoming IBC packet type MsgRecvPacket struct { Packet Packet `protobuf:"bytes,1,opt,name=packet,proto3" json:"packet"` @@ -372,7 +599,7 @@ func (m *MsgRecvPacket) Reset() { *m = MsgRecvPacket{} } func (m *MsgRecvPacket) String() string { return proto.CompactTextString(m) } func (*MsgRecvPacket) ProtoMessage() {} func (*MsgRecvPacket) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{6} + return fileDescriptor_c3a07336710636a0, []int{12} } func (m *MsgRecvPacket) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -401,6 +628,43 @@ func (m *MsgRecvPacket) XXX_DiscardUnknown() { var xxx_messageInfo_MsgRecvPacket proto.InternalMessageInfo +// MsgRecvPacketResponse defines the Msg/RecvPacket response type. +type MsgRecvPacketResponse struct { +} + +func (m *MsgRecvPacketResponse) Reset() { *m = MsgRecvPacketResponse{} } +func (m *MsgRecvPacketResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRecvPacketResponse) ProtoMessage() {} +func (*MsgRecvPacketResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{13} +} +func (m *MsgRecvPacketResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRecvPacketResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRecvPacketResponse.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 *MsgRecvPacketResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRecvPacketResponse.Merge(m, src) +} +func (m *MsgRecvPacketResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRecvPacketResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRecvPacketResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRecvPacketResponse proto.InternalMessageInfo + // MsgTimeout receives timed-out packet type MsgTimeout struct { Packet Packet `protobuf:"bytes,1,opt,name=packet,proto3" json:"packet"` @@ -414,7 +678,7 @@ func (m *MsgTimeout) Reset() { *m = MsgTimeout{} } func (m *MsgTimeout) String() string { return proto.CompactTextString(m) } func (*MsgTimeout) ProtoMessage() {} func (*MsgTimeout) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{7} + return fileDescriptor_c3a07336710636a0, []int{14} } func (m *MsgTimeout) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -443,6 +707,43 @@ func (m *MsgTimeout) XXX_DiscardUnknown() { var xxx_messageInfo_MsgTimeout proto.InternalMessageInfo +// MsgTimeoutResponse defines the Msg/Timeout response type. +type MsgTimeoutResponse struct { +} + +func (m *MsgTimeoutResponse) Reset() { *m = MsgTimeoutResponse{} } +func (m *MsgTimeoutResponse) String() string { return proto.CompactTextString(m) } +func (*MsgTimeoutResponse) ProtoMessage() {} +func (*MsgTimeoutResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{15} +} +func (m *MsgTimeoutResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTimeoutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTimeoutResponse.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 *MsgTimeoutResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTimeoutResponse.Merge(m, src) +} +func (m *MsgTimeoutResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgTimeoutResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTimeoutResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTimeoutResponse proto.InternalMessageInfo + // MsgTimeoutOnClose timed-out packet upon counterparty channel closure. type MsgTimeoutOnClose struct { Packet Packet `protobuf:"bytes,1,opt,name=packet,proto3" json:"packet"` @@ -457,7 +758,7 @@ func (m *MsgTimeoutOnClose) Reset() { *m = MsgTimeoutOnClose{} } func (m *MsgTimeoutOnClose) String() string { return proto.CompactTextString(m) } func (*MsgTimeoutOnClose) ProtoMessage() {} func (*MsgTimeoutOnClose) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{8} + return fileDescriptor_c3a07336710636a0, []int{16} } func (m *MsgTimeoutOnClose) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -486,6 +787,43 @@ func (m *MsgTimeoutOnClose) XXX_DiscardUnknown() { var xxx_messageInfo_MsgTimeoutOnClose proto.InternalMessageInfo +// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. +type MsgTimeoutOnCloseResponse struct { +} + +func (m *MsgTimeoutOnCloseResponse) Reset() { *m = MsgTimeoutOnCloseResponse{} } +func (m *MsgTimeoutOnCloseResponse) String() string { return proto.CompactTextString(m) } +func (*MsgTimeoutOnCloseResponse) ProtoMessage() {} +func (*MsgTimeoutOnCloseResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{17} +} +func (m *MsgTimeoutOnCloseResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTimeoutOnCloseResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTimeoutOnCloseResponse.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 *MsgTimeoutOnCloseResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTimeoutOnCloseResponse.Merge(m, src) +} +func (m *MsgTimeoutOnCloseResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgTimeoutOnCloseResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTimeoutOnCloseResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTimeoutOnCloseResponse proto.InternalMessageInfo + // MsgAcknowledgement receives incoming IBC acknowledgement type MsgAcknowledgement struct { Packet Packet `protobuf:"bytes,1,opt,name=packet,proto3" json:"packet"` @@ -499,7 +837,7 @@ func (m *MsgAcknowledgement) Reset() { *m = MsgAcknowledgement{} } func (m *MsgAcknowledgement) String() string { return proto.CompactTextString(m) } func (*MsgAcknowledgement) ProtoMessage() {} func (*MsgAcknowledgement) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{9} + return fileDescriptor_c3a07336710636a0, []int{18} } func (m *MsgAcknowledgement) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -528,6 +866,43 @@ func (m *MsgAcknowledgement) XXX_DiscardUnknown() { var xxx_messageInfo_MsgAcknowledgement proto.InternalMessageInfo +// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. +type MsgAcknowledgementResponse struct { +} + +func (m *MsgAcknowledgementResponse) Reset() { *m = MsgAcknowledgementResponse{} } +func (m *MsgAcknowledgementResponse) String() string { return proto.CompactTextString(m) } +func (*MsgAcknowledgementResponse) ProtoMessage() {} +func (*MsgAcknowledgementResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{19} +} +func (m *MsgAcknowledgementResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAcknowledgementResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAcknowledgementResponse.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 *MsgAcknowledgementResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAcknowledgementResponse.Merge(m, src) +} +func (m *MsgAcknowledgementResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgAcknowledgementResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAcknowledgementResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAcknowledgementResponse proto.InternalMessageInfo + // Channel defines pipeline for exactly-once packet delivery between specific // modules on separate blockchains, which has at least one end capable of // sending packets and one end capable of receiving packets. @@ -549,7 +924,7 @@ func (m *Channel) Reset() { *m = Channel{} } func (m *Channel) String() string { return proto.CompactTextString(m) } func (*Channel) ProtoMessage() {} func (*Channel) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{10} + return fileDescriptor_c3a07336710636a0, []int{20} } func (m *Channel) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -602,7 +977,7 @@ func (m *IdentifiedChannel) Reset() { *m = IdentifiedChannel{} } func (m *IdentifiedChannel) String() string { return proto.CompactTextString(m) } func (*IdentifiedChannel) ProtoMessage() {} func (*IdentifiedChannel) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{11} + return fileDescriptor_c3a07336710636a0, []int{21} } func (m *IdentifiedChannel) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -643,7 +1018,7 @@ func (m *Counterparty) Reset() { *m = Counterparty{} } func (m *Counterparty) String() string { return proto.CompactTextString(m) } func (*Counterparty) ProtoMessage() {} func (*Counterparty) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{12} + return fileDescriptor_c3a07336710636a0, []int{22} } func (m *Counterparty) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -698,7 +1073,7 @@ func (m *Packet) Reset() { *m = Packet{} } func (m *Packet) String() string { return proto.CompactTextString(m) } func (*Packet) ProtoMessage() {} func (*Packet) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{13} + return fileDescriptor_c3a07336710636a0, []int{23} } func (m *Packet) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -744,7 +1119,7 @@ func (m *PacketAckCommitment) Reset() { *m = PacketAckCommitment{} } func (m *PacketAckCommitment) String() string { return proto.CompactTextString(m) } func (*PacketAckCommitment) ProtoMessage() {} func (*PacketAckCommitment) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{14} + return fileDescriptor_c3a07336710636a0, []int{24} } func (m *PacketAckCommitment) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -793,7 +1168,7 @@ func (m *Acknowledgement) Reset() { *m = Acknowledgement{} } func (m *Acknowledgement) String() string { return proto.CompactTextString(m) } func (*Acknowledgement) ProtoMessage() {} func (*Acknowledgement) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{15} + return fileDescriptor_c3a07336710636a0, []int{25} } func (m *Acknowledgement) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -871,15 +1246,25 @@ func init() { proto.RegisterEnum("ibc.core.channel.v1.State", State_name, State_value) proto.RegisterEnum("ibc.core.channel.v1.Order", Order_name, Order_value) proto.RegisterType((*MsgChannelOpenInit)(nil), "ibc.core.channel.v1.MsgChannelOpenInit") + proto.RegisterType((*MsgChannelOpenInitResponse)(nil), "ibc.core.channel.v1.MsgChannelOpenInitResponse") proto.RegisterType((*MsgChannelOpenTry)(nil), "ibc.core.channel.v1.MsgChannelOpenTry") + proto.RegisterType((*MsgChannelOpenTryResponse)(nil), "ibc.core.channel.v1.MsgChannelOpenTryResponse") proto.RegisterType((*MsgChannelOpenAck)(nil), "ibc.core.channel.v1.MsgChannelOpenAck") + proto.RegisterType((*MsgChannelOpenAckResponse)(nil), "ibc.core.channel.v1.MsgChannelOpenAckResponse") proto.RegisterType((*MsgChannelOpenConfirm)(nil), "ibc.core.channel.v1.MsgChannelOpenConfirm") + proto.RegisterType((*MsgChannelOpenConfirmResponse)(nil), "ibc.core.channel.v1.MsgChannelOpenConfirmResponse") proto.RegisterType((*MsgChannelCloseInit)(nil), "ibc.core.channel.v1.MsgChannelCloseInit") + proto.RegisterType((*MsgChannelCloseInitResponse)(nil), "ibc.core.channel.v1.MsgChannelCloseInitResponse") proto.RegisterType((*MsgChannelCloseConfirm)(nil), "ibc.core.channel.v1.MsgChannelCloseConfirm") + proto.RegisterType((*MsgChannelCloseConfirmResponse)(nil), "ibc.core.channel.v1.MsgChannelCloseConfirmResponse") proto.RegisterType((*MsgRecvPacket)(nil), "ibc.core.channel.v1.MsgRecvPacket") + proto.RegisterType((*MsgRecvPacketResponse)(nil), "ibc.core.channel.v1.MsgRecvPacketResponse") proto.RegisterType((*MsgTimeout)(nil), "ibc.core.channel.v1.MsgTimeout") + proto.RegisterType((*MsgTimeoutResponse)(nil), "ibc.core.channel.v1.MsgTimeoutResponse") proto.RegisterType((*MsgTimeoutOnClose)(nil), "ibc.core.channel.v1.MsgTimeoutOnClose") + proto.RegisterType((*MsgTimeoutOnCloseResponse)(nil), "ibc.core.channel.v1.MsgTimeoutOnCloseResponse") proto.RegisterType((*MsgAcknowledgement)(nil), "ibc.core.channel.v1.MsgAcknowledgement") + proto.RegisterType((*MsgAcknowledgementResponse)(nil), "ibc.core.channel.v1.MsgAcknowledgementResponse") proto.RegisterType((*Channel)(nil), "ibc.core.channel.v1.Channel") proto.RegisterType((*IdentifiedChannel)(nil), "ibc.core.channel.v1.IdentifiedChannel") proto.RegisterType((*Counterparty)(nil), "ibc.core.channel.v1.Counterparty") @@ -891,99 +1276,538 @@ func init() { func init() { proto.RegisterFile("ibc/core/channel/v1/channel.proto", fileDescriptor_c3a07336710636a0) } var fileDescriptor_c3a07336710636a0 = []byte{ - // 1465 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0xcf, 0x6b, 0x1b, 0xc7, - 0x17, 0xd7, 0x4a, 0x2b, 0xd9, 0x7e, 0x96, 0x6d, 0x79, 0xfc, 0x23, 0x8a, 0x9c, 0x68, 0x95, 0xe5, - 0xfb, 0x05, 0x37, 0x25, 0x76, 0x9c, 0x86, 0xfe, 0x08, 0x3d, 0xd4, 0x92, 0x15, 0x2c, 0x92, 0x48, - 0x66, 0xac, 0x14, 0xea, 0x8b, 0x2a, 0xaf, 0x26, 0xd2, 0x22, 0x6b, 0x47, 0xdd, 0x5d, 0x3b, 0xf1, - 0x7f, 0x10, 0x0c, 0x85, 0x9e, 0x0b, 0x86, 0x40, 0x29, 0x14, 0x0a, 0xed, 0xb1, 0x7f, 0x40, 0x2f, - 0x39, 0xe6, 0x96, 0x9e, 0x96, 0x92, 0x1c, 0x9a, 0xf3, 0xfe, 0x03, 0x2d, 0x3b, 0x33, 0x2b, 0xed, - 0xca, 0x52, 0x48, 0x9a, 0x5a, 0x50, 0xe8, 0x69, 0xe7, 0xbd, 0xf7, 0x99, 0x99, 0xf7, 0x3e, 0xef, - 0xcd, 0xaf, 0x85, 0x2b, 0xfa, 0xbe, 0xb6, 0xae, 0x51, 0x93, 0xac, 0x6b, 0xad, 0xba, 0x61, 0x90, - 0x83, 0xf5, 0xa3, 0x0d, 0xbf, 0xb9, 0xd6, 0x35, 0xa9, 0x4d, 0xd1, 0x82, 0xbe, 0xaf, 0xad, 0x79, - 0x90, 0x35, 0x5f, 0x7f, 0xb4, 0x91, 0x59, 0x6c,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x96, 0x59, 0xd7, 0x51, 0x32, 0x67, 0x87, 0xea, 0xf9, 0x84, 0x02, 0x5a, - 0xdf, 0x31, 0x04, 0x72, 0xa3, 0x6e, 0xd7, 0xf9, 0x8b, 0x12, 0xb3, 0x36, 0xfa, 0x12, 0x66, 0x6d, - 0x7e, 0xa0, 0xbd, 0xf9, 0xbb, 0xf1, 0xb2, 0xd8, 0xd9, 0x04, 0x1d, 0xe1, 0xfe, 0x2a, 0x9e, 0x11, - 0x0a, 0xb1, 0xbb, 0x95, 0x60, 0xde, 0x47, 0x78, 0x5f, 0xcb, 0xae, 0x77, 0xba, 0xec, 0x19, 0x29, - 0xe7, 0x2f, 0xb9, 0x8e, 0x92, 0x0e, 0x0f, 0xd2, 0x83, 0xa8, 0x38, 0x25, 0x74, 0x55, 0x5f, 0x25, - 0x2a, 0xe0, 0x27, 0x09, 0x16, 0x78, 0x05, 0x6c, 0x6a, 0xed, 0x02, 0xed, 0x74, 0x74, 0x9b, 0x6d, - 0xdc, 0x63, 0xb8, 0xc2, 0x06, 0x2b, 0x2e, 0x36, 0x50, 0x71, 0x08, 0xe4, 0x56, 0xdd, 0x6a, 0xb1, - 0x54, 0x27, 0x31, 0x6b, 0x0b, 0x87, 0x2b, 0x30, 0x37, 0x78, 0x92, 0xa5, 0x21, 0x61, 0x12, 0xeb, - 0xf0, 0xc0, 0x4e, 0x2f, 0x79, 0xf0, 0xed, 0x08, 0x16, 0x32, 0x5a, 0x86, 0x38, 0x31, 0x4d, 0x6a, - 0xa6, 0x97, 0x3d, 0x9f, 0xb6, 0x23, 0x98, 0x8b, 0x79, 0x80, 0x49, 0x93, 0x58, 0x5d, 0x6a, 0x58, - 0xe4, 0xea, 0x2f, 0x12, 0xc4, 0x77, 0xc5, 0x46, 0xa5, 0xec, 0x56, 0x37, 0xab, 0xc5, 0xda, 0xfd, - 0x72, 0xa9, 0x5c, 0xaa, 0x96, 0x36, 0xef, 0x96, 0xf6, 0x8a, 0x5b, 0xb5, 0xfb,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8d, 0xf6, 0xfa, 0xa3, 0xf5, 0xde, 0x9f, 0xc1, 0xeb, 0x37, 0xaf, 0xf9, 0xbf, - 0x1a, 0xed, 0xe3, 0x2e, 0xb1, 0xf6, 0x13, 0xec, 0xd7, 0xe0, 0x07, 0x7f, 0x05, 0x00, 0x00, 0xff, - 0xff, 0x7f, 0x85, 0xc2, 0xbb, 0x8b, 0x14, 0x00, 0x00, + // 1708 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x59, 0xcd, 0x6f, 0xdb, 0xc8, + 0x15, 0xd7, 0x07, 0xf5, 0xe1, 0x17, 0xd9, 0x96, 0xc7, 0x1f, 0x51, 0xe8, 0x58, 0xd4, 0x12, 0xed, + 0xae, 0x9b, 0x62, 0xa5, 0x24, 0xbb, 0xe8, 0x47, 0xd0, 0x43, 0x2d, 0x59, 0x8b, 0x08, 0xd9, 0x58, + 0xc6, 0x58, 0x29, 0x50, 0xa3, 0x80, 0x2a, 0x53, 0x13, 0x89, 0x90, 0x45, 0xaa, 0x24, 0x6d, 0xaf, + 0xff, 0x83, 0x85, 0x81, 0x02, 0x3d, 0x17, 0x30, 0xb0, 0x40, 0x51, 0xa0, 0x40, 0x81, 0xee, 0xb1, + 0x7f, 0x40, 0x2f, 0x7b, 0xdc, 0xdb, 0xf6, 0x44, 0x14, 0xc9, 0xa1, 0x39, 0xeb, 0x1f, 0x68, 0xc1, + 0x99, 0x21, 0x45, 0x52, 0x54, 0xac, 0x34, 0xb5, 0x80, 0x02, 0x3d, 0x89, 0xf3, 0xde, 0x6f, 0xde, + 0xbc, 0xf9, 0xbd, 0xc7, 0x37, 0xf3, 0x28, 0xf8, 0x40, 0x3d, 0x51, 0x2a, 0x8a, 0x6e, 0x90, 0x8a, + 0xd2, 0xef, 0x68, 0x1a, 0x39, 0xad, 0x9c, 0x3f, 0x72, 0x1f, 0xcb, 0x23, 0x43, 0xb7, 0x74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, 0x25, 0xdf, 0x96, 0xfa, 0x8b, 0x2d, 0x7a, 0xac, 0x53, 0x09, 0xd1, 0xe1, + 0xb1, 0xf5, 0xc7, 0x04, 0x64, 0x78, 0x41, 0x44, 0x0f, 0x21, 0x65, 0x5a, 0x1d, 0x8b, 0x50, 0x86, + 0x56, 0x02, 0x0e, 0x4e, 0x18, 0x3a, 0x72, 0x10, 0x98, 0x01, 0xd1, 0x8f, 0x20, 0xab, 0x1b, 0x5d, + 0x62, 0xa8, 0x5a, 0x8f, 0x52, 0x32, 0x6b, 0x52, 0xd3, 0x01, 0x61, 0x0f, 0x8b, 0x9e, 0x41, 0xce, + 0x7f, 0x55, 0xe3, 0xc5, 0xe0, 0x83, 0xe8, 0x26, 0xc1, 0x07, 0xe4, 0x81, 0x09, 0x4c, 0x46, 0x35, + 0x58, 0x55, 0x74, 0x4d, 0x23, 0x8a, 0xa5, 0xea, 0x5a, 0xbb, 0xaf, 0x8f, 0xcc, 0x82, 0x50, 0x4a, + 0xee, 0x2e, 0x55, 0xc5, 0xb1, 0x2d, 0x6d, 0xb9, 0xf7, 0xc5, 0x00, 0x40, 0xc6, 0x2b, 0x13, 0xc9, + 0x53, 0x7d, 0x64, 0xa2, 0x02, 0x64, 0x02, 0x6d, 0x06, 0x76, 0x87, 0x4f, 0x04, 0x87, 0x49, 0xf9, + 0x9f, 0x09, 0x58, 0x6b, 0x74, 0x89, 0x66, 0xa9, 0x2f, 0x55, 0xaf, 0xb3, 0xfa, 0x3f, 0x63, 0x51, + 0x8c, 0xa1, 0xbb, 0x93, 0xdb, 0x07, 0x7f, 0x83, 0xf9, 0x4d, 0x63, 0x27, 0x70, 0xd3, 0x60, 0xf7, + 0xdf, 0xc9, 0x95, 0x82, 0x33, 0x7d, 0x01, 0x39, 0xff, 0x06, 0x16, 0x70, 0x97, 0xe1, 0x0b, 0xff, + 0x2b, 0x09, 0x69, 0x7e, 0xe8, 0x8b, 0x90, 0x75, 0xcb, 0x14, 0x5d, 0x54, 0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 0xe1, 0x0d, + 0x53, 0x39, 0x6e, 0x76, 0xee, 0x45, 0x37, 0x0d, 0xce, 0xcb, 0x1b, 0x2e, 0xa4, 0x33, 0xbd, 0x0c, + 0x01, 0x67, 0xbf, 0xbc, 0x33, 0xee, 0xdc, 0x55, 0xfc, 0xcd, 0xab, 0x62, 0xfc, 0xdb, 0x57, 0xc5, + 0xf8, 0x3f, 0x5e, 0x15, 0xe3, 0xbf, 0x7b, 0x5d, 0x8c, 0x7d, 0xfb, 0xba, 0x18, 0xfb, 0xfb, 0xeb, + 0x62, 0xec, 0xf8, 0x27, 0x3d, 0xd5, 0xea, 0x9f, 0x9d, 0x94, 0x15, 0x7d, 0x58, 0x51, 0x74, 0x73, + 0xa8, 0x9b, 0xfc, 0xe7, 0x63, 0xb3, 0x3b, 0xa8, 0x7c, 0x51, 0xf1, 0xfe, 0x6f, 0x79, 0xf8, 0xe9, + 0xc7, 0xee, 0x1f, 0x38, 0xd6, 0xe5, 0x88, 0x98, 0x27, 0x69, 0xfa, 0x87, 0xcb, 0x27, 0xff, 0x0e, + 0x00, 0x00, 0xff, 0xff, 0xdf, 0x36, 0x4a, 0x13, 0xe1, 0x19, 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 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. + ChannelOpenInit(ctx context.Context, in *MsgChannelOpenInit, opts ...grpc.CallOption) (*MsgChannelOpenInitResponse, error) + // ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. + ChannelOpenTry(ctx context.Context, in *MsgChannelOpenTry, opts ...grpc.CallOption) (*MsgChannelOpenTryResponse, error) + // ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. + ChannelOpenAck(ctx context.Context, in *MsgChannelOpenAck, opts ...grpc.CallOption) (*MsgChannelOpenAckResponse, error) + // ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. + ChannelOpenConfirm(ctx context.Context, in *MsgChannelOpenConfirm, opts ...grpc.CallOption) (*MsgChannelOpenConfirmResponse, error) + // ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. + ChannelCloseInit(ctx context.Context, in *MsgChannelCloseInit, opts ...grpc.CallOption) (*MsgChannelCloseInitResponse, error) + // ChannelCloseConfirm defines a rpc handler method for MsgChannelCloseConfirm. + ChannelCloseConfirm(ctx context.Context, in *MsgChannelCloseConfirm, opts ...grpc.CallOption) (*MsgChannelCloseConfirmResponse, error) + // RecvPacket defines a rpc handler method for MsgRecvPacket. + RecvPacket(ctx context.Context, in *MsgRecvPacket, opts ...grpc.CallOption) (*MsgRecvPacketResponse, error) + // Timeout defines a rpc handler method for MsgTimeout. + Timeout(ctx context.Context, in *MsgTimeout, opts ...grpc.CallOption) (*MsgTimeoutResponse, error) + // TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. + TimeoutOnClose(ctx context.Context, in *MsgTimeoutOnClose, opts ...grpc.CallOption) (*MsgTimeoutOnCloseResponse, error) + // Acknowledgement defines a rpc handler method for MsgAcknowledgement. + Acknowledgement(ctx context.Context, in *MsgAcknowledgement, opts ...grpc.CallOption) (*MsgAcknowledgementResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) ChannelOpenInit(ctx context.Context, in *MsgChannelOpenInit, opts ...grpc.CallOption) (*MsgChannelOpenInitResponse, error) { + out := new(MsgChannelOpenInitResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelOpenInit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ChannelOpenTry(ctx context.Context, in *MsgChannelOpenTry, opts ...grpc.CallOption) (*MsgChannelOpenTryResponse, error) { + out := new(MsgChannelOpenTryResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelOpenTry", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ChannelOpenAck(ctx context.Context, in *MsgChannelOpenAck, opts ...grpc.CallOption) (*MsgChannelOpenAckResponse, error) { + out := new(MsgChannelOpenAckResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelOpenAck", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ChannelOpenConfirm(ctx context.Context, in *MsgChannelOpenConfirm, opts ...grpc.CallOption) (*MsgChannelOpenConfirmResponse, error) { + out := new(MsgChannelOpenConfirmResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelOpenConfirm", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ChannelCloseInit(ctx context.Context, in *MsgChannelCloseInit, opts ...grpc.CallOption) (*MsgChannelCloseInitResponse, error) { + out := new(MsgChannelCloseInitResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelCloseInit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ChannelCloseConfirm(ctx context.Context, in *MsgChannelCloseConfirm, opts ...grpc.CallOption) (*MsgChannelCloseConfirmResponse, error) { + out := new(MsgChannelCloseConfirmResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelCloseConfirm", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) RecvPacket(ctx context.Context, in *MsgRecvPacket, opts ...grpc.CallOption) (*MsgRecvPacketResponse, error) { + out := new(MsgRecvPacketResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/RecvPacket", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Timeout(ctx context.Context, in *MsgTimeout, opts ...grpc.CallOption) (*MsgTimeoutResponse, error) { + out := new(MsgTimeoutResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/Timeout", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) TimeoutOnClose(ctx context.Context, in *MsgTimeoutOnClose, opts ...grpc.CallOption) (*MsgTimeoutOnCloseResponse, error) { + out := new(MsgTimeoutOnCloseResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/TimeoutOnClose", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Acknowledgement(ctx context.Context, in *MsgAcknowledgement, opts ...grpc.CallOption) (*MsgAcknowledgementResponse, error) { + out := new(MsgAcknowledgementResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/Acknowledgement", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. + ChannelOpenInit(context.Context, *MsgChannelOpenInit) (*MsgChannelOpenInitResponse, error) + // ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. + ChannelOpenTry(context.Context, *MsgChannelOpenTry) (*MsgChannelOpenTryResponse, error) + // ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. + ChannelOpenAck(context.Context, *MsgChannelOpenAck) (*MsgChannelOpenAckResponse, error) + // ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. + ChannelOpenConfirm(context.Context, *MsgChannelOpenConfirm) (*MsgChannelOpenConfirmResponse, error) + // ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. + ChannelCloseInit(context.Context, *MsgChannelCloseInit) (*MsgChannelCloseInitResponse, error) + // ChannelCloseConfirm defines a rpc handler method for MsgChannelCloseConfirm. + ChannelCloseConfirm(context.Context, *MsgChannelCloseConfirm) (*MsgChannelCloseConfirmResponse, error) + // RecvPacket defines a rpc handler method for MsgRecvPacket. + RecvPacket(context.Context, *MsgRecvPacket) (*MsgRecvPacketResponse, error) + // Timeout defines a rpc handler method for MsgTimeout. + Timeout(context.Context, *MsgTimeout) (*MsgTimeoutResponse, error) + // TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. + TimeoutOnClose(context.Context, *MsgTimeoutOnClose) (*MsgTimeoutOnCloseResponse, error) + // Acknowledgement defines a rpc handler method for MsgAcknowledgement. + Acknowledgement(context.Context, *MsgAcknowledgement) (*MsgAcknowledgementResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) ChannelOpenInit(ctx context.Context, req *MsgChannelOpenInit) (*MsgChannelOpenInitResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChannelOpenInit not implemented") +} +func (*UnimplementedMsgServer) ChannelOpenTry(ctx context.Context, req *MsgChannelOpenTry) (*MsgChannelOpenTryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChannelOpenTry not implemented") +} +func (*UnimplementedMsgServer) ChannelOpenAck(ctx context.Context, req *MsgChannelOpenAck) (*MsgChannelOpenAckResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChannelOpenAck not implemented") +} +func (*UnimplementedMsgServer) ChannelOpenConfirm(ctx context.Context, req *MsgChannelOpenConfirm) (*MsgChannelOpenConfirmResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChannelOpenConfirm not implemented") +} +func (*UnimplementedMsgServer) ChannelCloseInit(ctx context.Context, req *MsgChannelCloseInit) (*MsgChannelCloseInitResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChannelCloseInit not implemented") +} +func (*UnimplementedMsgServer) ChannelCloseConfirm(ctx context.Context, req *MsgChannelCloseConfirm) (*MsgChannelCloseConfirmResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChannelCloseConfirm not implemented") +} +func (*UnimplementedMsgServer) RecvPacket(ctx context.Context, req *MsgRecvPacket) (*MsgRecvPacketResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RecvPacket not implemented") +} +func (*UnimplementedMsgServer) Timeout(ctx context.Context, req *MsgTimeout) (*MsgTimeoutResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Timeout not implemented") +} +func (*UnimplementedMsgServer) TimeoutOnClose(ctx context.Context, req *MsgTimeoutOnClose) (*MsgTimeoutOnCloseResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TimeoutOnClose not implemented") +} +func (*UnimplementedMsgServer) Acknowledgement(ctx context.Context, req *MsgAcknowledgement) (*MsgAcknowledgementResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Acknowledgement not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_ChannelOpenInit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgChannelOpenInit) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ChannelOpenInit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/ChannelOpenInit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ChannelOpenInit(ctx, req.(*MsgChannelOpenInit)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ChannelOpenTry_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgChannelOpenTry) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ChannelOpenTry(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/ChannelOpenTry", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ChannelOpenTry(ctx, req.(*MsgChannelOpenTry)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ChannelOpenAck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgChannelOpenAck) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ChannelOpenAck(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/ChannelOpenAck", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ChannelOpenAck(ctx, req.(*MsgChannelOpenAck)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ChannelOpenConfirm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgChannelOpenConfirm) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ChannelOpenConfirm(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/ChannelOpenConfirm", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ChannelOpenConfirm(ctx, req.(*MsgChannelOpenConfirm)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ChannelCloseInit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgChannelCloseInit) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ChannelCloseInit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/ChannelCloseInit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ChannelCloseInit(ctx, req.(*MsgChannelCloseInit)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ChannelCloseConfirm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgChannelCloseConfirm) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ChannelCloseConfirm(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/ChannelCloseConfirm", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ChannelCloseConfirm(ctx, req.(*MsgChannelCloseConfirm)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_RecvPacket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRecvPacket) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RecvPacket(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/RecvPacket", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RecvPacket(ctx, req.(*MsgRecvPacket)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Timeout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgTimeout) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Timeout(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/Timeout", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Timeout(ctx, req.(*MsgTimeout)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_TimeoutOnClose_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgTimeoutOnClose) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).TimeoutOnClose(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/TimeoutOnClose", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).TimeoutOnClose(ctx, req.(*MsgTimeoutOnClose)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Acknowledgement_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAcknowledgement) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Acknowledgement(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/Acknowledgement", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Acknowledgement(ctx, req.(*MsgAcknowledgement)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ibc.core.channel.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ChannelOpenInit", + Handler: _Msg_ChannelOpenInit_Handler, + }, + { + MethodName: "ChannelOpenTry", + Handler: _Msg_ChannelOpenTry_Handler, + }, + { + MethodName: "ChannelOpenAck", + Handler: _Msg_ChannelOpenAck_Handler, + }, + { + MethodName: "ChannelOpenConfirm", + Handler: _Msg_ChannelOpenConfirm_Handler, + }, + { + MethodName: "ChannelCloseInit", + Handler: _Msg_ChannelCloseInit_Handler, + }, + { + MethodName: "ChannelCloseConfirm", + Handler: _Msg_ChannelCloseConfirm_Handler, + }, + { + MethodName: "RecvPacket", + Handler: _Msg_RecvPacket_Handler, + }, + { + MethodName: "Timeout", + Handler: _Msg_Timeout_Handler, + }, + { + MethodName: "TimeoutOnClose", + Handler: _Msg_TimeoutOnClose_Handler, + }, + { + MethodName: "Acknowledgement", + Handler: _Msg_Acknowledgement_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "ibc/core/channel/v1/channel.proto", } func (m *MsgChannelOpenInit) Marshal() (dAtA []byte, err error) { @@ -1040,6 +1864,29 @@ func (m *MsgChannelOpenInit) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgChannelOpenInitResponse) 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 *MsgChannelOpenInitResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelOpenInitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgChannelOpenTry) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1125,6 +1972,29 @@ func (m *MsgChannelOpenTry) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgChannelOpenTryResponse) 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 *MsgChannelOpenTryResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelOpenTryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgChannelOpenAck) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1200,6 +2070,29 @@ func (m *MsgChannelOpenAck) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgChannelOpenAckResponse) 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 *MsgChannelOpenAckResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelOpenAckResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgChannelOpenConfirm) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1261,6 +2154,29 @@ func (m *MsgChannelOpenConfirm) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgChannelOpenConfirmResponse) 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 *MsgChannelOpenConfirmResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelOpenConfirmResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgChannelCloseInit) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1305,6 +2221,29 @@ func (m *MsgChannelCloseInit) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgChannelCloseInitResponse) 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 *MsgChannelCloseInitResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelCloseInitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgChannelCloseConfirm) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1366,6 +2305,29 @@ func (m *MsgChannelCloseConfirm) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *MsgChannelCloseConfirmResponse) 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 *MsgChannelCloseConfirmResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelCloseConfirmResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgRecvPacket) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1423,6 +2385,29 @@ func (m *MsgRecvPacket) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgRecvPacketResponse) 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 *MsgRecvPacketResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRecvPacketResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgTimeout) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1485,6 +2470,29 @@ func (m *MsgTimeout) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgTimeoutResponse) 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 *MsgTimeoutResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTimeoutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgTimeoutOnClose) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1554,6 +2562,29 @@ func (m *MsgTimeoutOnClose) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgTimeoutOnCloseResponse) 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 *MsgTimeoutOnCloseResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTimeoutOnCloseResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgAcknowledgement) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1618,6 +2649,29 @@ func (m *MsgAcknowledgement) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgAcknowledgementResponse) 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 *MsgAcknowledgementResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAcknowledgementResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *Channel) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2014,6 +3068,15 @@ func (m *MsgChannelOpenInit) Size() (n int) { return n } +func (m *MsgChannelOpenInitResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgChannelOpenTry) Size() (n int) { if m == nil { return 0 @@ -2051,6 +3114,15 @@ func (m *MsgChannelOpenTry) Size() (n int) { return n } +func (m *MsgChannelOpenTryResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgChannelOpenAck) Size() (n int) { if m == nil { return 0 @@ -2086,6 +3158,15 @@ func (m *MsgChannelOpenAck) Size() (n int) { return n } +func (m *MsgChannelOpenAckResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgChannelOpenConfirm) Size() (n int) { if m == nil { return 0 @@ -2113,6 +3194,15 @@ func (m *MsgChannelOpenConfirm) Size() (n int) { return n } +func (m *MsgChannelOpenConfirmResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgChannelCloseInit) Size() (n int) { if m == nil { return 0 @@ -2134,6 +3224,15 @@ func (m *MsgChannelCloseInit) Size() (n int) { return n } +func (m *MsgChannelCloseInitResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgChannelCloseConfirm) Size() (n int) { if m == nil { return 0 @@ -2161,6 +3260,15 @@ func (m *MsgChannelCloseConfirm) Size() (n int) { return n } +func (m *MsgChannelCloseConfirmResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgRecvPacket) Size() (n int) { if m == nil { return 0 @@ -2182,6 +3290,15 @@ func (m *MsgRecvPacket) Size() (n int) { return n } +func (m *MsgRecvPacketResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgTimeout) Size() (n int) { if m == nil { return 0 @@ -2206,6 +3323,15 @@ func (m *MsgTimeout) Size() (n int) { return n } +func (m *MsgTimeoutResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgTimeoutOnClose) Size() (n int) { if m == nil { return 0 @@ -2234,6 +3360,15 @@ func (m *MsgTimeoutOnClose) Size() (n int) { return n } +func (m *MsgTimeoutOnCloseResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgAcknowledgement) Size() (n int) { if m == nil { return 0 @@ -2259,6 +3394,15 @@ func (m *MsgAcknowledgement) Size() (n int) { return n } +func (m *MsgAcknowledgementResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *Channel) Size() (n int) { if m == nil { return 0 @@ -2622,6 +3766,59 @@ func (m *MsgChannelOpenInit) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgChannelOpenInitResponse) 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 ErrIntOverflowChannel + } + 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: MsgChannelOpenInitResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelOpenInitResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgChannelOpenTry) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2935,6 +4132,59 @@ func (m *MsgChannelOpenTry) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgChannelOpenTryResponse) 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 ErrIntOverflowChannel + } + 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: MsgChannelOpenTryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelOpenTryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgChannelOpenAck) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3215,6 +4465,59 @@ func (m *MsgChannelOpenAck) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgChannelOpenAckResponse) 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 ErrIntOverflowChannel + } + 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: MsgChannelOpenAckResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelOpenAckResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgChannelOpenConfirm) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3431,6 +4734,59 @@ func (m *MsgChannelOpenConfirm) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgChannelOpenConfirmResponse) 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 ErrIntOverflowChannel + } + 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: MsgChannelOpenConfirmResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelOpenConfirmResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgChannelCloseInit) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3580,6 +4936,59 @@ func (m *MsgChannelCloseInit) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgChannelCloseInitResponse) 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 ErrIntOverflowChannel + } + 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: MsgChannelCloseInitResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelCloseInitResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgChannelCloseConfirm) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3796,6 +5205,59 @@ func (m *MsgChannelCloseConfirm) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgChannelCloseConfirmResponse) 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 ErrIntOverflowChannel + } + 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: MsgChannelCloseConfirmResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelCloseConfirmResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgRecvPacket) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3981,6 +5443,59 @@ func (m *MsgRecvPacket) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgRecvPacketResponse) 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 ErrIntOverflowChannel + } + 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: MsgRecvPacketResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRecvPacketResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgTimeout) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4185,6 +5700,59 @@ func (m *MsgTimeout) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgTimeoutResponse) 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 ErrIntOverflowChannel + } + 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: MsgTimeoutResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTimeoutResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgTimeoutOnClose) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4423,6 +5991,59 @@ func (m *MsgTimeoutOnClose) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgTimeoutOnCloseResponse) 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 ErrIntOverflowChannel + } + 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: MsgTimeoutOnCloseResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTimeoutOnCloseResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgAcknowledgement) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4642,6 +6263,59 @@ func (m *MsgAcknowledgement) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgAcknowledgementResponse) 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 ErrIntOverflowChannel + } + 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: MsgAcknowledgementResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAcknowledgementResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *Channel) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/ibc/core/handler.go b/x/ibc/core/handler.go index 4c34188915c4..dee950e0a4bf 100644 --- a/x/ibc/core/handler.go +++ b/x/ibc/core/handler.go @@ -1,28 +1,23 @@ package ibc import ( - "github.com/armon/go-metrics" - - "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" connectiontypes "github.com/cosmos/cosmos-sdk/x/ibc/core/03-connection/types" - channel "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel" channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel/types" - porttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/05-port/types" "github.com/cosmos/cosmos-sdk/x/ibc/core/keeper" ) // NewHandler defines the IBC handler func NewHandler(k keeper.Keeper) sdk.Handler { + var msgServer = keeper.MsgServer{ + Keeper: k, + } + return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) - var msgServer = keeper.MsgServer{ - Keeper: k, - } - switch msg := msg.(type) { // IBC client msg interface types case *clienttypes.MsgCreateClient: @@ -56,317 +51,45 @@ func NewHandler(k keeper.Keeper) sdk.Handler { // IBC channel msgs case *channeltypes.MsgChannelOpenInit: - // Lookup module by port capability - module, portCap, err := k.PortKeeper.LookupModuleByPort(ctx, msg.PortId) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - res, cap, err := channel.HandleMsgChannelOpenInit(ctx, k.ChannelKeeper, portCap, msg) - if err != nil { - return nil, err - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - if err = cbs.OnChanOpenInit(ctx, msg.Channel.Ordering, msg.Channel.ConnectionHops, msg.PortId, msg.ChannelId, cap, msg.Channel.Counterparty, msg.Channel.Version); err != nil { - return nil, sdkerrors.Wrap(err, "channel open init callback failed") - } - - return res, nil + res, err := msgServer.ChannelOpenInit(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgChannelOpenTry: - // Lookup module by port capability - module, portCap, err := k.PortKeeper.LookupModuleByPort(ctx, msg.PortId) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - res, cap, err := channel.HandleMsgChannelOpenTry(ctx, k.ChannelKeeper, portCap, msg) - if err != nil { - return nil, err - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - if err = cbs.OnChanOpenTry(ctx, msg.Channel.Ordering, msg.Channel.ConnectionHops, msg.PortId, msg.DesiredChannelId, cap, msg.Channel.Counterparty, msg.Channel.Version, msg.CounterpartyVersion); err != nil { - return nil, sdkerrors.Wrap(err, "channel open try callback failed") - } - - return res, nil + res, err := msgServer.ChannelOpenTry(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgChannelOpenAck: - // Lookup module by channel capability - module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.PortId, msg.ChannelId) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - if err = cbs.OnChanOpenAck(ctx, msg.PortId, msg.ChannelId, msg.CounterpartyVersion); err != nil { - return nil, sdkerrors.Wrap(err, "channel open ack callback failed") - } - - return channel.HandleMsgChannelOpenAck(ctx, k.ChannelKeeper, cap, msg) + res, err := msgServer.ChannelOpenAck(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgChannelOpenConfirm: - // Lookup module by channel capability - module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.PortId, msg.ChannelId) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - if err = cbs.OnChanOpenConfirm(ctx, msg.PortId, msg.ChannelId); err != nil { - return nil, sdkerrors.Wrap(err, "channel open confirm callback failed") - } - - return channel.HandleMsgChannelOpenConfirm(ctx, k.ChannelKeeper, cap, msg) + res, err := msgServer.ChannelOpenConfirm(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgChannelCloseInit: - // Lookup module by channel capability - module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.PortId, msg.ChannelId) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - if err = cbs.OnChanCloseInit(ctx, msg.PortId, msg.ChannelId); err != nil { - return nil, sdkerrors.Wrap(err, "channel close init callback failed") - } - - return channel.HandleMsgChannelCloseInit(ctx, k.ChannelKeeper, cap, msg) + res, err := msgServer.ChannelCloseInit(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgChannelCloseConfirm: - // Lookup module by channel capability - module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.PortId, msg.ChannelId) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - if err = cbs.OnChanCloseConfirm(ctx, msg.PortId, msg.ChannelId); err != nil { - return nil, sdkerrors.Wrap(err, "channel close confirm callback failed") - } - - return channel.HandleMsgChannelCloseConfirm(ctx, k.ChannelKeeper, cap, msg) + res, err := msgServer.ChannelCloseConfirm(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) // IBC packet msgs get routed to the appropriate module callback case *channeltypes.MsgRecvPacket: - // Lookup module by channel capability - module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.Packet.DestinationPort, msg.Packet.DestinationChannel) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - // Perform TAO verification - if err := k.ChannelKeeper.RecvPacket(ctx, msg.Packet, msg.Proof, msg.ProofHeight); err != nil { - return nil, sdkerrors.Wrap(err, "receive packet verification failed") - } - - // Perform application logic callback - res, ack, err := cbs.OnRecvPacket(ctx, msg.Packet) - if err != nil { - return nil, sdkerrors.Wrap(err, "receive packet callback failed") - } - - if err := k.ChannelKeeper.WriteReceipt(ctx, cap, msg.Packet); err != nil { - return nil, err - } - - // Set packet acknowledgement only if the acknowledgement is not nil. - // NOTE: IBC applications modules may call the WriteAcknowledgement asynchronously if the - // acknowledgement is nil. - if ack != nil { - if err := k.ChannelKeeper.WriteAcknowledgement(ctx, msg.Packet, ack); err != nil { - return nil, err - } - } - - defer func() { - telemetry.IncrCounterWithLabels( - []string{"tx", "msg", "ibc", msg.Type()}, - 1, - []metrics.Label{ - telemetry.NewLabel("source-port", msg.Packet.SourcePort), - telemetry.NewLabel("source-channel", msg.Packet.SourceChannel), - telemetry.NewLabel("destination-port", msg.Packet.DestinationPort), - telemetry.NewLabel("destination-channel", msg.Packet.DestinationChannel), - }, - ) - }() - - return res, nil + res, err := msgServer.RecvPacket(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgAcknowledgement: - // Lookup module by channel capability - module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.Packet.SourcePort, msg.Packet.SourceChannel) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - // Perform TAO verification - if err := k.ChannelKeeper.AcknowledgePacket(ctx, msg.Packet, msg.Acknowledgement, msg.Proof, msg.ProofHeight); err != nil { - return nil, sdkerrors.Wrap(err, "acknowledge packet verification failed") - } - - // Perform application logic callback - res, err := cbs.OnAcknowledgementPacket(ctx, msg.Packet, msg.Acknowledgement) - if err != nil { - return nil, sdkerrors.Wrap(err, "acknowledge packet callback failed") - } - - // Delete packet commitment - if err = k.ChannelKeeper.AcknowledgementExecuted(ctx, cap, msg.Packet); err != nil { - return nil, err - } - - defer func() { - telemetry.IncrCounterWithLabels( - []string{"tx", "msg", "ibc", msg.Type()}, - 1, - []metrics.Label{ - telemetry.NewLabel("source-port", msg.Packet.SourcePort), - telemetry.NewLabel("source-channel", msg.Packet.SourceChannel), - telemetry.NewLabel("destination-port", msg.Packet.DestinationPort), - telemetry.NewLabel("destination-channel", msg.Packet.DestinationChannel), - }, - ) - }() - - return res, nil + res, err := msgServer.Acknowledgement(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgTimeout: - // Lookup module by channel capability - module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.Packet.SourcePort, msg.Packet.SourceChannel) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - // Perform TAO verification - if err := k.ChannelKeeper.TimeoutPacket(ctx, msg.Packet, msg.Proof, msg.ProofHeight, msg.NextSequenceRecv); err != nil { - return nil, sdkerrors.Wrap(err, "timeout packet verification failed") - } - - // Perform application logic callback - res, err := cbs.OnTimeoutPacket(ctx, msg.Packet) - if err != nil { - return nil, sdkerrors.Wrap(err, "timeout packet callback failed") - } - - // Delete packet commitment - if err = k.ChannelKeeper.TimeoutExecuted(ctx, cap, msg.Packet); err != nil { - return nil, err - } - - defer func() { - telemetry.IncrCounterWithLabels( - []string{"ibc", "timeout", "packet"}, - 1, - []metrics.Label{ - telemetry.NewLabel("source-port", msg.Packet.SourcePort), - telemetry.NewLabel("source-channel", msg.Packet.SourceChannel), - telemetry.NewLabel("destination-port", msg.Packet.DestinationPort), - telemetry.NewLabel("destination-channel", msg.Packet.DestinationChannel), - telemetry.NewLabel("timeout-type", "height"), - }, - ) - }() - - return res, nil + res, err := msgServer.Timeout(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgTimeoutOnClose: - // Lookup module by channel capability - module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.Packet.SourcePort, msg.Packet.SourceChannel) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - // Perform TAO verification - if err := k.ChannelKeeper.TimeoutOnClose(ctx, cap, msg.Packet, msg.Proof, msg.ProofClose, msg.ProofHeight, msg.NextSequenceRecv); err != nil { - return nil, sdkerrors.Wrap(err, "timeout on close packet verification failed") - } - - // Perform application logic callback - // NOTE: MsgTimeout and MsgTimeoutOnClose use the same "OnTimeoutPacket" - // application logic callback. - res, err := cbs.OnTimeoutPacket(ctx, msg.Packet) - if err != nil { - return nil, sdkerrors.Wrap(err, "timeout packet callback failed") - } - - // Delete packet commitment - if err = k.ChannelKeeper.TimeoutExecuted(ctx, cap, msg.Packet); err != nil { - return nil, err - } - - defer func() { - telemetry.IncrCounterWithLabels( - []string{"ibc", "timeout", "packet"}, - 1, - []metrics.Label{ - telemetry.NewLabel("source-port", msg.Packet.SourcePort), - telemetry.NewLabel("source-channel", msg.Packet.SourceChannel), - telemetry.NewLabel("destination-port", msg.Packet.DestinationPort), - telemetry.NewLabel("destination-channel", msg.Packet.DestinationChannel), - telemetry.NewLabel("timeout-type", "channel-closed"), - }, - ) - }() - - return res, nil + res, err := msgServer.TimeoutOnClose(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) default: return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized IBC message type: %T", msg) diff --git a/x/ibc/core/keeper/msg_server.go b/x/ibc/core/keeper/msg_server.go index 8094173deac3..8af052172d0b 100644 --- a/x/ibc/core/keeper/msg_server.go +++ b/x/ibc/core/keeper/msg_server.go @@ -3,10 +3,15 @@ package keeper import ( "context" + "github.com/armon/go-metrics" + "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" connectiontypes "github.com/cosmos/cosmos-sdk/x/ibc/core/03-connection/types" + channel "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel" + channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel/types" + porttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/05-port/types" ) type MsgServer struct { @@ -241,3 +246,362 @@ func (k MsgServer) ConnectionOpenConfirm(goCtx context.Context, msg *connectiont return &connectiontypes.MsgConnectionOpenConfirmResponse{}, nil } + +func (k MsgServer) ChannelOpenInit(goCtx context.Context, msg *channeltypes.MsgChannelOpenInit) (*channeltypes.MsgChannelOpenInitResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // Lookup module by port capability + module, portCap, err := k.PortKeeper.LookupModuleByPort(ctx, msg.PortId) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + _, cap, err := channel.HandleMsgChannelOpenInit(ctx, k.ChannelKeeper, portCap, msg) + if err != nil { + return nil, err + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + if err = cbs.OnChanOpenInit(ctx, msg.Channel.Ordering, msg.Channel.ConnectionHops, msg.PortId, msg.ChannelId, cap, msg.Channel.Counterparty, msg.Channel.Version); err != nil { + return nil, sdkerrors.Wrap(err, "channel open init callback failed") + } + + return &channeltypes.MsgChannelOpenInitResponse{}, nil +} + +func (k MsgServer) ChannelOpenTry(goCtx context.Context, msg *channeltypes.MsgChannelOpenTry) (*channeltypes.MsgChannelOpenTryResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + // Lookup module by port capability + module, portCap, err := k.PortKeeper.LookupModuleByPort(ctx, msg.PortId) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + _, cap, err := channel.HandleMsgChannelOpenTry(ctx, k.ChannelKeeper, portCap, msg) + if err != nil { + return nil, err + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + if err = cbs.OnChanOpenTry(ctx, msg.Channel.Ordering, msg.Channel.ConnectionHops, msg.PortId, msg.DesiredChannelId, cap, msg.Channel.Counterparty, msg.Channel.Version, msg.CounterpartyVersion); err != nil { + return nil, sdkerrors.Wrap(err, "channel open try callback failed") + } + + return &channeltypes.MsgChannelOpenTryResponse{}, nil +} + +func (k MsgServer) ChannelOpenAck(goCtx context.Context, msg *channeltypes.MsgChannelOpenAck) (*channeltypes.MsgChannelOpenAckResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // Lookup module by channel capability + module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.PortId, msg.ChannelId) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + if err = cbs.OnChanOpenAck(ctx, msg.PortId, msg.ChannelId, msg.CounterpartyVersion); err != nil { + return nil, sdkerrors.Wrap(err, "channel open ack callback failed") + } + + _, err = channel.HandleMsgChannelOpenAck(ctx, k.ChannelKeeper, cap, msg) + if err != nil { + return nil, err + } + + return &channeltypes.MsgChannelOpenAckResponse{}, nil +} + +func (k MsgServer) ChannelOpenConfirm(goCtx context.Context, msg *channeltypes.MsgChannelOpenConfirm) (*channeltypes.MsgChannelOpenConfirmResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // Lookup module by channel capability + module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.PortId, msg.ChannelId) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + if err = cbs.OnChanOpenConfirm(ctx, msg.PortId, msg.ChannelId); err != nil { + return nil, sdkerrors.Wrap(err, "channel open confirm callback failed") + } + + _, err = channel.HandleMsgChannelOpenConfirm(ctx, k.ChannelKeeper, cap, msg) + if err != nil { + return nil, err + } + + return &channeltypes.MsgChannelOpenConfirmResponse{}, nil +} + +func (k MsgServer) ChannelCloseInit(goCtx context.Context, msg *channeltypes.MsgChannelCloseInit) (*channeltypes.MsgChannelCloseInitResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + // Lookup module by channel capability + module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.PortId, msg.ChannelId) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + if err = cbs.OnChanCloseInit(ctx, msg.PortId, msg.ChannelId); err != nil { + return nil, sdkerrors.Wrap(err, "channel close init callback failed") + } + + _, err = channel.HandleMsgChannelCloseInit(ctx, k.ChannelKeeper, cap, msg) + if err != nil { + return nil, err + } + + return &channeltypes.MsgChannelCloseInitResponse{}, nil +} + +func (k MsgServer) ChannelCloseConfirm(goCtx context.Context, msg *channeltypes.MsgChannelCloseConfirm) (*channeltypes.MsgChannelCloseConfirmResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // Lookup module by channel capability + module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.PortId, msg.ChannelId) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + if err = cbs.OnChanCloseConfirm(ctx, msg.PortId, msg.ChannelId); err != nil { + return nil, sdkerrors.Wrap(err, "channel close confirm callback failed") + } + + _, err = channel.HandleMsgChannelCloseConfirm(ctx, k.ChannelKeeper, cap, msg) + if err != nil { + return nil, err + } + + return &channeltypes.MsgChannelCloseConfirmResponse{}, nil +} + +func (k MsgServer) RecvPacket(goCtx context.Context, msg *channeltypes.MsgRecvPacket) (*channeltypes.MsgRecvPacketResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // Lookup module by channel capability + module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.Packet.DestinationPort, msg.Packet.DestinationChannel) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + // Perform TAO verification + if err := k.ChannelKeeper.RecvPacket(ctx, msg.Packet, msg.Proof, msg.ProofHeight); err != nil { + return nil, sdkerrors.Wrap(err, "receive packet verification failed") + } + + // Perform application logic callback + _, ack, err := cbs.OnRecvPacket(ctx, msg.Packet) + if err != nil { + return nil, sdkerrors.Wrap(err, "receive packet callback failed") + } + + if err := k.ChannelKeeper.WriteReceipt(ctx, cap, msg.Packet); err != nil { + return nil, err + } + + // Set packet acknowledgement only if the acknowledgement is not nil. + // NOTE: IBC applications modules may call the WriteAcknowledgement asynchronously if the + // acknowledgement is nil. + if ack != nil { + if err := k.ChannelKeeper.WriteAcknowledgement(ctx, msg.Packet, ack); err != nil { + return nil, err + } + } + + defer func() { + telemetry.IncrCounterWithLabels( + []string{"tx", "msg", "ibc", msg.Type()}, + 1, + []metrics.Label{ + telemetry.NewLabel("source-port", msg.Packet.SourcePort), + telemetry.NewLabel("source-channel", msg.Packet.SourceChannel), + telemetry.NewLabel("destination-port", msg.Packet.DestinationPort), + telemetry.NewLabel("destination-channel", msg.Packet.DestinationChannel), + }, + ) + }() + + return &channeltypes.MsgRecvPacketResponse{}, nil +} + +func (k MsgServer) Timeout(goCtx context.Context, msg *channeltypes.MsgTimeout) (*channeltypes.MsgTimeoutResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + // Lookup module by channel capability + module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.Packet.SourcePort, msg.Packet.SourceChannel) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + // Perform TAO verification + if err := k.ChannelKeeper.TimeoutPacket(ctx, msg.Packet, msg.Proof, msg.ProofHeight, msg.NextSequenceRecv); err != nil { + return nil, sdkerrors.Wrap(err, "timeout packet verification failed") + } + + // Perform application logic callback + _, err = cbs.OnTimeoutPacket(ctx, msg.Packet) + if err != nil { + return nil, sdkerrors.Wrap(err, "timeout packet callback failed") + } + + // Delete packet commitment + if err = k.ChannelKeeper.TimeoutExecuted(ctx, cap, msg.Packet); err != nil { + return nil, err + } + + defer func() { + telemetry.IncrCounterWithLabels( + []string{"ibc", "timeout", "packet"}, + 1, + []metrics.Label{ + telemetry.NewLabel("source-port", msg.Packet.SourcePort), + telemetry.NewLabel("source-channel", msg.Packet.SourceChannel), + telemetry.NewLabel("destination-port", msg.Packet.DestinationPort), + telemetry.NewLabel("destination-channel", msg.Packet.DestinationChannel), + telemetry.NewLabel("timeout-type", "height"), + }, + ) + }() + + return &channeltypes.MsgTimeoutResponse{}, nil +} + +func (k MsgServer) TimeoutOnClose(goCtx context.Context, msg *channeltypes.MsgTimeoutOnClose) (*channeltypes.MsgTimeoutOnCloseResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // Lookup module by channel capability + module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.Packet.SourcePort, msg.Packet.SourceChannel) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + // Perform TAO verification + if err := k.ChannelKeeper.TimeoutOnClose(ctx, cap, msg.Packet, msg.Proof, msg.ProofClose, msg.ProofHeight, msg.NextSequenceRecv); err != nil { + return nil, sdkerrors.Wrap(err, "timeout on close packet verification failed") + } + + // Perform application logic callback + // NOTE: MsgTimeout and MsgTimeoutOnClose use the same "OnTimeoutPacket" + // application logic callback. + _, err = cbs.OnTimeoutPacket(ctx, msg.Packet) + if err != nil { + return nil, sdkerrors.Wrap(err, "timeout packet callback failed") + } + + // Delete packet commitment + if err = k.ChannelKeeper.TimeoutExecuted(ctx, cap, msg.Packet); err != nil { + return nil, err + } + + defer func() { + telemetry.IncrCounterWithLabels( + []string{"ibc", "timeout", "packet"}, + 1, + []metrics.Label{ + telemetry.NewLabel("source-port", msg.Packet.SourcePort), + telemetry.NewLabel("source-channel", msg.Packet.SourceChannel), + telemetry.NewLabel("destination-port", msg.Packet.DestinationPort), + telemetry.NewLabel("destination-channel", msg.Packet.DestinationChannel), + telemetry.NewLabel("timeout-type", "channel-closed"), + }, + ) + }() + + return &channeltypes.MsgTimeoutOnCloseResponse{}, nil +} + +func (k MsgServer) Acknowledgement(goCtx context.Context, msg *channeltypes.MsgAcknowledgement) (*channeltypes.MsgAcknowledgementResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // Lookup module by channel capability + module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.Packet.SourcePort, msg.Packet.SourceChannel) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + // Perform TAO verification + if err := k.ChannelKeeper.AcknowledgePacket(ctx, msg.Packet, msg.Acknowledgement, msg.Proof, msg.ProofHeight); err != nil { + return nil, sdkerrors.Wrap(err, "acknowledge packet verification failed") + } + + // Perform application logic callback + _, err = cbs.OnAcknowledgementPacket(ctx, msg.Packet, msg.Acknowledgement) + if err != nil { + return nil, sdkerrors.Wrap(err, "acknowledge packet callback failed") + } + + // Delete packet commitment + if err = k.ChannelKeeper.AcknowledgementExecuted(ctx, cap, msg.Packet); err != nil { + return nil, err + } + + defer func() { + telemetry.IncrCounterWithLabels( + []string{"tx", "msg", "ibc", msg.Type()}, + 1, + []metrics.Label{ + telemetry.NewLabel("source-port", msg.Packet.SourcePort), + telemetry.NewLabel("source-channel", msg.Packet.SourceChannel), + telemetry.NewLabel("destination-port", msg.Packet.DestinationPort), + telemetry.NewLabel("destination-channel", msg.Packet.DestinationChannel), + }, + ) + }() + + return &channeltypes.MsgAcknowledgementResponse{}, nil +} From cb1747f070a751743738c505d0f0c85a5b2c0a63 Mon Sep 17 00:00:00 2001 From: atheesh Date: Fri, 16 Oct 2020 13:53:41 +0530 Subject: [PATCH 03/12] removed unsued --- x/ibc/core/03-connection/handler.go | 1 - 1 file changed, 1 deletion(-) delete mode 100644 x/ibc/core/03-connection/handler.go diff --git a/x/ibc/core/03-connection/handler.go b/x/ibc/core/03-connection/handler.go deleted file mode 100644 index c2b0392420df..000000000000 --- a/x/ibc/core/03-connection/handler.go +++ /dev/null @@ -1 +0,0 @@ -package connection From d07a7e5d9f515061d2ae2986e06d453af9e5203c Mon Sep 17 00:00:00 2001 From: atheesh Date: Fri, 16 Oct 2020 14:13:13 +0530 Subject: [PATCH 04/12] fix --- x/ibc/core/keeper/msg_server.go | 1 + 1 file changed, 1 insertion(+) diff --git a/x/ibc/core/keeper/msg_server.go b/x/ibc/core/keeper/msg_server.go index 8af052172d0b..0312a89ee75a 100644 --- a/x/ibc/core/keeper/msg_server.go +++ b/x/ibc/core/keeper/msg_server.go @@ -20,6 +20,7 @@ type MsgServer struct { var _ clienttypes.MsgServer = MsgServer{} var _ connectiontypes.MsgServer = MsgServer{} +var _ channeltypes.MsgServer = MsgServer{} func (k MsgServer) CreateClient(goCtx context.Context, msg *clienttypes.MsgCreateClient) (*clienttypes.MsgCreateClientResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) From d064c53b0bfb14e99268ce0b4e5c3ca36548c979 Mon Sep 17 00:00:00 2001 From: atheesh Date: Fri, 16 Oct 2020 21:43:24 +0530 Subject: [PATCH 05/12] Add proto service for ibc/transfer --- .../applications/transfer/v1/transfer.proto | 9 + x/ibc/applications/transfer/handler.go | 35 +-- .../transfer/keeper/msg_server.go | 40 +++ .../transfer/types/transfer.pb.go | 296 +++++++++++++++--- 4 files changed, 306 insertions(+), 74 deletions(-) create mode 100644 x/ibc/applications/transfer/keeper/msg_server.go diff --git a/proto/ibc/applications/transfer/v1/transfer.proto b/proto/ibc/applications/transfer/v1/transfer.proto index 28b7f9670451..1ebc884542dc 100644 --- a/proto/ibc/applications/transfer/v1/transfer.proto +++ b/proto/ibc/applications/transfer/v1/transfer.proto @@ -7,6 +7,12 @@ import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; import "ibc/core/client/v1/client.proto"; +// Msg defines the ibc/transfer Msg service. +service Msg { + // Transfer defines a rpc handler method for MsgTransfer. + rpc Transfer(MsgTransfer) returns (MsgTransferResponse); +} + // MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between // ICS20 enabled chains. See ICS Spec here: // https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures @@ -33,6 +39,9 @@ message MsgTransfer { uint64 timeout_timestamp = 7 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; } +// MsgTransferResponse defines the Msg/Transfer response type. +message MsgTransferResponse { } + // FungibleTokenPacketData defines a struct for the packet payload // See FungibleTokenPacketData spec: // https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures diff --git a/x/ibc/applications/transfer/handler.go b/x/ibc/applications/transfer/handler.go index 81d9d62d8600..2d487edc4586 100644 --- a/x/ibc/applications/transfer/handler.go +++ b/x/ibc/applications/transfer/handler.go @@ -14,40 +14,11 @@ func NewHandler(k keeper.Keeper) sdk.Handler { switch msg := msg.(type) { case *types.MsgTransfer: - return handleMsgTransfer(ctx, k, msg) + res, err := k.Transfer(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + default: return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized ICS-20 transfer message type: %T", msg) } } } - -// See createOutgoingPacket in spec:https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#packet-relay -func handleMsgTransfer(ctx sdk.Context, k keeper.Keeper, msg *types.MsgTransfer) (*sdk.Result, error) { - sender, err := sdk.AccAddressFromBech32(msg.Sender) - if err != nil { - return nil, err - } - if err := k.SendTransfer( - ctx, msg.SourcePort, msg.SourceChannel, msg.Token, sender, msg.Receiver, msg.TimeoutHeight, msg.TimeoutTimestamp, - ); err != nil { - return nil, err - } - - k.Logger(ctx).Info("IBC fungible token transfer", "token", msg.Token.Denom, "amount", msg.Token.Amount.String(), "sender", msg.Sender, "receiver", msg.Receiver) - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeTransfer, - sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), - sdk.NewAttribute(types.AttributeKeyReceiver, msg.Receiver), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), - ), - }) - - return &sdk.Result{ - Events: ctx.EventManager().Events().ToABCIEvents(), - }, nil -} diff --git a/x/ibc/applications/transfer/keeper/msg_server.go b/x/ibc/applications/transfer/keeper/msg_server.go new file mode 100644 index 000000000000..e7631581e9da --- /dev/null +++ b/x/ibc/applications/transfer/keeper/msg_server.go @@ -0,0 +1,40 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/ibc/applications/transfer/types" +) + +var _ types.MsgServer = Keeper{} + +func (k Keeper) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types.MsgTransferResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + sender, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return nil, err + } + if err := k.SendTransfer( + ctx, msg.SourcePort, msg.SourceChannel, msg.Token, sender, msg.Receiver, msg.TimeoutHeight, msg.TimeoutTimestamp, + ); err != nil { + return nil, err + } + + k.Logger(ctx).Info("IBC fungible token transfer", "token", msg.Token.Denom, "amount", msg.Token.Amount.String(), "sender", msg.Sender, "receiver", msg.Receiver) + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeTransfer, + sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), + sdk.NewAttribute(types.AttributeKeyReceiver, msg.Receiver), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), + ), + }) + + return &types.MsgTransferResponse{}, nil +} diff --git a/x/ibc/applications/transfer/types/transfer.pb.go b/x/ibc/applications/transfer/types/transfer.pb.go index 281b1fc9f6fa..db4e10f45c58 100644 --- a/x/ibc/applications/transfer/types/transfer.pb.go +++ b/x/ibc/applications/transfer/types/transfer.pb.go @@ -4,11 +4,16 @@ package types import ( + context "context" fmt "fmt" types "github.com/cosmos/cosmos-sdk/types" + grpc1 "github.com/gogo/protobuf/grpc" types1 "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/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" @@ -80,6 +85,43 @@ func (m *MsgTransfer) XXX_DiscardUnknown() { var xxx_messageInfo_MsgTransfer proto.InternalMessageInfo +// MsgTransferResponse defines the Msg/Transfer response type. +type MsgTransferResponse struct { +} + +func (m *MsgTransferResponse) Reset() { *m = MsgTransferResponse{} } +func (m *MsgTransferResponse) String() string { return proto.CompactTextString(m) } +func (*MsgTransferResponse) ProtoMessage() {} +func (*MsgTransferResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5041673e96e97901, []int{1} +} +func (m *MsgTransferResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTransferResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTransferResponse.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 *MsgTransferResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTransferResponse.Merge(m, src) +} +func (m *MsgTransferResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgTransferResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTransferResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTransferResponse proto.InternalMessageInfo + // FungibleTokenPacketData defines a struct for the packet payload // See FungibleTokenPacketData spec: // https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures @@ -98,7 +140,7 @@ func (m *FungibleTokenPacketData) Reset() { *m = FungibleTokenPacketData func (m *FungibleTokenPacketData) String() string { return proto.CompactTextString(m) } func (*FungibleTokenPacketData) ProtoMessage() {} func (*FungibleTokenPacketData) Descriptor() ([]byte, []int) { - return fileDescriptor_5041673e96e97901, []int{1} + return fileDescriptor_5041673e96e97901, []int{2} } func (m *FungibleTokenPacketData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -169,7 +211,7 @@ func (m *DenomTrace) Reset() { *m = DenomTrace{} } func (m *DenomTrace) String() string { return proto.CompactTextString(m) } func (*DenomTrace) ProtoMessage() {} func (*DenomTrace) Descriptor() ([]byte, []int) { - return fileDescriptor_5041673e96e97901, []int{2} + return fileDescriptor_5041673e96e97901, []int{3} } func (m *DenomTrace) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -229,7 +271,7 @@ func (m *Params) Reset() { *m = Params{} } func (m *Params) String() string { return proto.CompactTextString(m) } func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_5041673e96e97901, []int{3} + return fileDescriptor_5041673e96e97901, []int{4} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -274,6 +316,7 @@ func (m *Params) GetReceiveEnabled() bool { func init() { proto.RegisterType((*MsgTransfer)(nil), "ibc.applications.transfer.v1.MsgTransfer") + proto.RegisterType((*MsgTransferResponse)(nil), "ibc.applications.transfer.v1.MsgTransferResponse") proto.RegisterType((*FungibleTokenPacketData)(nil), "ibc.applications.transfer.v1.FungibleTokenPacketData") proto.RegisterType((*DenomTrace)(nil), "ibc.applications.transfer.v1.DenomTrace") proto.RegisterType((*Params)(nil), "ibc.applications.transfer.v1.Params") @@ -284,45 +327,129 @@ func init() { } var fileDescriptor_5041673e96e97901 = []byte{ - // 601 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x53, 0xcd, 0x6e, 0xd3, 0x4c, - 0x14, 0x8d, 0xdb, 0x34, 0x5f, 0x3b, 0xf9, 0x5a, 0x60, 0x28, 0xad, 0x1b, 0xb5, 0x76, 0xe5, 0x55, - 0x25, 0x84, 0xad, 0x80, 0x10, 0x52, 0x17, 0x80, 0xd2, 0x82, 0x60, 0x81, 0x54, 0x59, 0x59, 0x20, - 0x36, 0x61, 0x3c, 0x19, 0x9c, 0x51, 0xed, 0x19, 0x6b, 0x66, 0x12, 0x51, 0xf1, 0x02, 0xb0, 0xe3, - 0x11, 0xba, 0xe6, 0x49, 0xba, 0xec, 0x92, 0x95, 0x85, 0xda, 0x0d, 0xeb, 0x3c, 0x01, 0x9a, 0x9f, - 0x86, 0x04, 0xa9, 0x2b, 0xcf, 0xb9, 0xf7, 0x9c, 0x7b, 0xe6, 0xde, 0xeb, 0x01, 0x0f, 0x69, 0x86, - 0x13, 0x54, 0x55, 0x05, 0xc5, 0x48, 0x51, 0xce, 0x64, 0xa2, 0x04, 0x62, 0xf2, 0x13, 0x11, 0xc9, - 0xa4, 0x3b, 0x3b, 0xc7, 0x95, 0xe0, 0x8a, 0xc3, 0x5d, 0x9a, 0xe1, 0x78, 0x9e, 0x1c, 0xcf, 0x08, - 0x93, 0x6e, 0x67, 0x33, 0xe7, 0x39, 0x37, 0xc4, 0x44, 0x9f, 0xac, 0xa6, 0x13, 0x60, 0x2e, 0x4b, - 0x2e, 0x93, 0x0c, 0x49, 0x92, 0x4c, 0xba, 0x19, 0x51, 0xa8, 0x9b, 0x60, 0x4e, 0x99, 0xcb, 0x87, - 0xfa, 0x02, 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, 0x4a, 0x37, - 0x5c, 0xc4, 0x15, 0xe9, 0xbd, 0xbf, 0xb8, 0x0a, 0xbc, 0xcb, 0xab, 0xc0, 0xfb, 0x75, 0x15, 0x78, - 0xdf, 0xaf, 0x83, 0xc6, 0xe5, 0x75, 0xd0, 0xf8, 0x79, 0x1d, 0x34, 0x3e, 0x3c, 0xcf, 0xa9, 0x1a, - 0x8d, 0xb3, 0x18, 0xf3, 0x32, 0x71, 0x8f, 0xcb, 0x7e, 0x1e, 0xc9, 0xe1, 0x69, 0xf2, 0x39, 0xb9, - 0xfd, 0x45, 0xab, 0xb3, 0x8a, 0xc8, 0xac, 0x65, 0xde, 0xd5, 0x93, 0x3f, 0x01, 0x00, 0x00, 0xff, - 0xff, 0xed, 0xa5, 0xb5, 0x3a, 0xfb, 0x03, 0x00, 0x00, + // 638 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xcd, 0x6e, 0xd3, 0x40, + 0x10, 0x8e, 0x9b, 0x34, 0xa4, 0x1b, 0x5a, 0x60, 0xfb, 0xe7, 0x46, 0xad, 0x5d, 0xf9, 0x54, 0x84, + 0x58, 0x2b, 0x45, 0x08, 0xa9, 0x07, 0x40, 0x69, 0x41, 0x70, 0xa8, 0x54, 0x59, 0x39, 0x20, 0x2e, + 0x61, 0xbd, 0x59, 0x1c, 0xab, 0xf1, 0xae, 0xe5, 0xdd, 0x44, 0x54, 0xbc, 0x00, 0xdc, 0x78, 0x84, + 0x9e, 0x79, 0x92, 0x1e, 0x7b, 0xe4, 0x14, 0xa1, 0xf6, 0xc2, 0x39, 0x4f, 0x80, 0xf6, 0xa7, 0xc1, + 0x41, 0x2a, 0xe2, 0xe4, 0xfd, 0x66, 0xbe, 0x6f, 0x66, 0x67, 0x66, 0xc7, 0xe0, 0x51, 0x1a, 0x93, + 0x10, 0xe7, 0xf9, 0x30, 0x25, 0x58, 0xa6, 0x9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x00, 0x50, 0x23, 0xec, 0x99, 0x8b, 0xe8, 0x57, 0x11, 0x2d, + 0x29, 0x8b, 0xd6, 0x05, 0x5f, 0x1d, 0x50, 0x3f, 0xc1, 0x05, 0xce, 0x04, 0x3c, 0x00, 0x77, 0x55, + 0xc6, 0x1e, 0x65, 0x38, 0x1e, 0xd2, 0xbe, 0x8e, 0xd2, 0xe8, 0x6c, 0x4e, 0x27, 0xfe, 0xaa, 0x7d, + 0x41, 0x25, 0x6f, 0x10, 0x35, 0x15, 0x7c, 0x65, 0x10, 0x3c, 0x04, 0xf7, 0xec, 0x9d, 0x66, 0xf2, + 0x05, 0x2d, 0x6f, 0x4d, 0x27, 0xfe, 0x86, 0x91, 0xff, 0x45, 0x08, 0xa2, 0x15, 0x6b, 0xb1, 0x41, + 0xf6, 0x39, 0xa8, 0x1e, 0x8b, 0x04, 0x0e, 0x40, 0x63, 0xb6, 0x10, 0x0f, 0xd1, 0xbf, 0xd6, 0x12, + 0x95, 0xe6, 0xd1, 0x6a, 0xff, 0x37, 0xf5, 0x66, 0x74, 0x9d, 0x77, 0x17, 0x57, 0x9e, 0x73, 0x79, + 0xe5, 0x39, 0x3f, 0xaf, 0x3c, 0xe7, 0xdb, 0xb5, 0x57, 0xb9, 0xbc, 0xf6, 0x2a, 0x3f, 0xae, 0xbd, + 0xca, 0xfb, 0xe7, 0x49, 0x2a, 0x07, 0xa3, 0x18, 0x11, 0x9e, 0x85, 0x76, 0xc9, 0xcd, 0xe7, 0xb1, + 0xe8, 0x9f, 0x86, 0x9f, 0xc2, 0xdb, 0xff, 0x2c, 0xf2, 0x2c, 0xa7, 0x22, 0xae, 0xeb, 0xfd, 0x7e, + 0xf2, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x34, 0x4e, 0x38, 0x40, 0x83, 0x04, 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 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // Transfer defines a rpc handler method for MsgTransfer. + Transfer(ctx context.Context, in *MsgTransfer, opts ...grpc.CallOption) (*MsgTransferResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) Transfer(ctx context.Context, in *MsgTransfer, opts ...grpc.CallOption) (*MsgTransferResponse, error) { + out := new(MsgTransferResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.transfer.v1.Msg/Transfer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // Transfer defines a rpc handler method for MsgTransfer. + Transfer(context.Context, *MsgTransfer) (*MsgTransferResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) Transfer(ctx context.Context, req *MsgTransfer) (*MsgTransferResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Transfer not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_Transfer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgTransfer) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Transfer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.applications.transfer.v1.Msg/Transfer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Transfer(ctx, req.(*MsgTransfer)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ibc.applications.transfer.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Transfer", + Handler: _Msg_Transfer_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "ibc/applications/transfer/v1/transfer.proto", } func (m *MsgTransfer) Marshal() (dAtA []byte, err error) { @@ -401,6 +528,29 @@ func (m *MsgTransfer) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgTransferResponse) 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 *MsgTransferResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTransferResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *FungibleTokenPacketData) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -573,6 +723,15 @@ func (m *MsgTransfer) Size() (n int) { return n } +func (m *MsgTransferResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *FungibleTokenPacketData) Size() (n int) { if m == nil { return 0 @@ -901,6 +1060,59 @@ func (m *MsgTransfer) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgTransferResponse) 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 ErrIntOverflowTransfer + } + 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: MsgTransferResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTransferResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTransfer(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTransfer + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTransfer + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *FungibleTokenPacketData) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 From 4a9b99100d6f60abc00a8fdf1ae5ace1817d1f4d Mon Sep 17 00:00:00 2001 From: atheesh Date: Fri, 16 Oct 2020 21:50:15 +0530 Subject: [PATCH 06/12] lint --- x/ibc/applications/transfer/handler.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/x/ibc/applications/transfer/handler.go b/x/ibc/applications/transfer/handler.go index 2d487edc4586..7c992c920e72 100644 --- a/x/ibc/applications/transfer/handler.go +++ b/x/ibc/applications/transfer/handler.go @@ -3,12 +3,11 @@ package transfer import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/x/ibc/applications/transfer/keeper" "github.com/cosmos/cosmos-sdk/x/ibc/applications/transfer/types" ) // NewHandler returns sdk.Handler for IBC token transfer module messages -func NewHandler(k keeper.Keeper) sdk.Handler { +func NewHandler(k types.MsgServer) sdk.Handler { return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) From 5c65041780d31e45eda949ce0189c69d4ca1249d Mon Sep 17 00:00:00 2001 From: atheesh Date: Sat, 17 Oct 2020 13:46:03 +0530 Subject: [PATCH 07/12] remove old upgrade handler --- x/ibc/core/02-client/handler.go | 27 ---------------- x/ibc/core/02-client/handler_test.go | 5 ++- x/ibc/core/handler.go | 38 ++++++++++------------- x/ibc/core/keeper/msg_server.go | 46 +++++++++++++--------------- 4 files changed, 40 insertions(+), 76 deletions(-) diff --git a/x/ibc/core/02-client/handler.go b/x/ibc/core/02-client/handler.go index 65de90767ef8..befa95df642f 100644 --- a/x/ibc/core/02-client/handler.go +++ b/x/ibc/core/02-client/handler.go @@ -8,33 +8,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" ) -// HandleMsgUpgradeClient defines the sdk.Handler for MsgUpgradeClient -func HandleMsgUpgradeClient(ctx sdk.Context, k keeper.Keeper, msg *types.MsgUpgradeClient) (*sdk.Result, error) { - upgradedClient, err := types.UnpackClientState(msg.ClientState) - if err != nil { - return nil, err - } - - if err := upgradedClient.Validate(); err != nil { - return nil, err - } - - if err = k.UpgradeClient(ctx, msg.ClientId, upgradedClient, msg.UpgradeHeight, msg.ProofUpgrade); err != nil { - return nil, err - } - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - ) - - return &sdk.Result{ - Events: ctx.EventManager().Events().ToABCIEvents(), - }, nil -} - // NewClientUpdateProposalHandler defines the client update proposal handler func NewClientUpdateProposalHandler(k keeper.Keeper) govtypes.Handler { return func(ctx sdk.Context, content govtypes.Content) error { diff --git a/x/ibc/core/02-client/handler_test.go b/x/ibc/core/02-client/handler_test.go index 7aa7d5e7b8ca..6dcfb2734024 100644 --- a/x/ibc/core/02-client/handler_test.go +++ b/x/ibc/core/02-client/handler_test.go @@ -11,6 +11,7 @@ import ( clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" commitmenttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/23-commitment/types" "github.com/cosmos/cosmos-sdk/x/ibc/core/exported" + "github.com/cosmos/cosmos-sdk/x/ibc/core/keeper" ibctmtypes "github.com/cosmos/cosmos-sdk/x/ibc/light-clients/07-tendermint/types" ibctesting "github.com/cosmos/cosmos-sdk/x/ibc/testing" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" @@ -204,9 +205,7 @@ func (suite *ClientTestSuite) TestUpgradeClient() { tc.setup() - _, err := client.HandleMsgUpgradeClient( - suite.chainA.GetContext(), suite.chainA.App.IBCKeeper.ClientKeeper, msg, - ) + _, err := keeper.Keeper.UpgradeClient(*suite.chainA.App.IBCKeeper, sdk.WrapSDKContext(suite.chainA.GetContext()), msg) if tc.expPass { suite.Require().NoError(err, "upgrade handler failed on valid case: %s", tc.name) diff --git a/x/ibc/core/handler.go b/x/ibc/core/handler.go index dee950e0a4bf..d2ef7f7b6159 100644 --- a/x/ibc/core/handler.go +++ b/x/ibc/core/handler.go @@ -11,84 +11,80 @@ import ( // NewHandler defines the IBC handler func NewHandler(k keeper.Keeper) sdk.Handler { - var msgServer = keeper.MsgServer{ - Keeper: k, - } - return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) switch msg := msg.(type) { // IBC client msg interface types case *clienttypes.MsgCreateClient: - res, err := msgServer.CreateClient(sdk.WrapSDKContext(ctx), msg) + res, err := k.CreateClient(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) case *clienttypes.MsgUpdateClient: - res, err := msgServer.UpdateClient(sdk.WrapSDKContext(ctx), msg) + res, err := k.UpdateClient(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) case *clienttypes.MsgSubmitMisbehaviour: - res, err := msgServer.SubmitMisbehaviour(sdk.WrapSDKContext(ctx), msg) + res, err := k.SubmitMisbehaviour(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) // IBC connection msgs case *connectiontypes.MsgConnectionOpenInit: - res, err := msgServer.ConnectionOpenInit(sdk.WrapSDKContext(ctx), msg) + res, err := k.ConnectionOpenInit(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) case *connectiontypes.MsgConnectionOpenTry: - res, err := msgServer.ConnectionOpenTry(sdk.WrapSDKContext(ctx), msg) + res, err := k.ConnectionOpenTry(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) case *connectiontypes.MsgConnectionOpenAck: - res, err := msgServer.ConnectionOpenAck(sdk.WrapSDKContext(ctx), msg) + res, err := k.ConnectionOpenAck(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) case *connectiontypes.MsgConnectionOpenConfirm: - res, err := msgServer.ConnectionOpenConfirm(sdk.WrapSDKContext(ctx), msg) + res, err := k.ConnectionOpenConfirm(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) // IBC channel msgs case *channeltypes.MsgChannelOpenInit: - res, err := msgServer.ChannelOpenInit(sdk.WrapSDKContext(ctx), msg) + res, err := k.ChannelOpenInit(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgChannelOpenTry: - res, err := msgServer.ChannelOpenTry(sdk.WrapSDKContext(ctx), msg) + res, err := k.ChannelOpenTry(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgChannelOpenAck: - res, err := msgServer.ChannelOpenAck(sdk.WrapSDKContext(ctx), msg) + res, err := k.ChannelOpenAck(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgChannelOpenConfirm: - res, err := msgServer.ChannelOpenConfirm(sdk.WrapSDKContext(ctx), msg) + res, err := k.ChannelOpenConfirm(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgChannelCloseInit: - res, err := msgServer.ChannelCloseInit(sdk.WrapSDKContext(ctx), msg) + res, err := k.ChannelCloseInit(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgChannelCloseConfirm: - res, err := msgServer.ChannelCloseConfirm(sdk.WrapSDKContext(ctx), msg) + res, err := k.ChannelCloseConfirm(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) // IBC packet msgs get routed to the appropriate module callback case *channeltypes.MsgRecvPacket: - res, err := msgServer.RecvPacket(sdk.WrapSDKContext(ctx), msg) + res, err := k.RecvPacket(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgAcknowledgement: - res, err := msgServer.Acknowledgement(sdk.WrapSDKContext(ctx), msg) + res, err := k.Acknowledgement(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgTimeout: - res, err := msgServer.Timeout(sdk.WrapSDKContext(ctx), msg) + res, err := k.Timeout(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgTimeoutOnClose: - res, err := msgServer.TimeoutOnClose(sdk.WrapSDKContext(ctx), msg) + res, err := k.TimeoutOnClose(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) default: diff --git a/x/ibc/core/keeper/msg_server.go b/x/ibc/core/keeper/msg_server.go index 0312a89ee75a..350b3067e257 100644 --- a/x/ibc/core/keeper/msg_server.go +++ b/x/ibc/core/keeper/msg_server.go @@ -14,15 +14,11 @@ import ( porttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/05-port/types" ) -type MsgServer struct { - Keeper -} - -var _ clienttypes.MsgServer = MsgServer{} -var _ connectiontypes.MsgServer = MsgServer{} -var _ channeltypes.MsgServer = MsgServer{} +var _ clienttypes.MsgServer = Keeper{} +var _ connectiontypes.MsgServer = Keeper{} +var _ channeltypes.MsgServer = Keeper{} -func (k MsgServer) CreateClient(goCtx context.Context, msg *clienttypes.MsgCreateClient) (*clienttypes.MsgCreateClientResponse, error) { +func (k Keeper) CreateClient(goCtx context.Context, msg *clienttypes.MsgCreateClient) (*clienttypes.MsgCreateClientResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) clientState, err := clienttypes.UnpackClientState(msg.ClientState) @@ -55,7 +51,7 @@ func (k MsgServer) CreateClient(goCtx context.Context, msg *clienttypes.MsgCreat return &clienttypes.MsgCreateClientResponse{}, nil } -func (k MsgServer) UpdateClient(goCtx context.Context, msg *clienttypes.MsgUpdateClient) (*clienttypes.MsgUpdateClientResponse, error) { +func (k Keeper) UpdateClient(goCtx context.Context, msg *clienttypes.MsgUpdateClient) (*clienttypes.MsgUpdateClientResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) header, err := clienttypes.UnpackHeader(msg.Header) @@ -77,7 +73,7 @@ func (k MsgServer) UpdateClient(goCtx context.Context, msg *clienttypes.MsgUpdat return &clienttypes.MsgUpdateClientResponse{}, nil } -func (k MsgServer) UpgradeClient(goCtx context.Context, msg *clienttypes.MsgUpgradeClient) (*clienttypes.MsgUpgradeClientResponse, error) { +func (k Keeper) UpgradeClient(goCtx context.Context, msg *clienttypes.MsgUpgradeClient) (*clienttypes.MsgUpgradeClientResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) upgradedClient, err := clienttypes.UnpackClientState(msg.ClientState) @@ -103,7 +99,7 @@ func (k MsgServer) UpgradeClient(goCtx context.Context, msg *clienttypes.MsgUpgr return &clienttypes.MsgUpgradeClientResponse{}, nil } -func (k MsgServer) SubmitMisbehaviour(goCtx context.Context, msg *clienttypes.MsgSubmitMisbehaviour) (*clienttypes.MsgSubmitMisbehaviourResponse, error) { +func (k Keeper) SubmitMisbehaviour(goCtx context.Context, msg *clienttypes.MsgSubmitMisbehaviour) (*clienttypes.MsgSubmitMisbehaviourResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) misbehaviour, err := clienttypes.UnpackMisbehaviour(msg.Misbehaviour) @@ -127,7 +123,7 @@ func (k MsgServer) SubmitMisbehaviour(goCtx context.Context, msg *clienttypes.Ms return &clienttypes.MsgSubmitMisbehaviourResponse{}, nil } -func (k MsgServer) ConnectionOpenInit(goCtx context.Context, msg *connectiontypes.MsgConnectionOpenInit) (*connectiontypes.MsgConnectionOpenInitResponse, error) { +func (k Keeper) ConnectionOpenInit(goCtx context.Context, msg *connectiontypes.MsgConnectionOpenInit) (*connectiontypes.MsgConnectionOpenInitResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) if err := k.ConnectionKeeper.ConnOpenInit( @@ -153,7 +149,7 @@ func (k MsgServer) ConnectionOpenInit(goCtx context.Context, msg *connectiontype return &connectiontypes.MsgConnectionOpenInitResponse{}, nil } -func (k MsgServer) ConnectionOpenTry(goCtx context.Context, msg *connectiontypes.MsgConnectionOpenTry) (*connectiontypes.MsgConnectionOpenTryResponse, error) { +func (k Keeper) ConnectionOpenTry(goCtx context.Context, msg *connectiontypes.MsgConnectionOpenTry) (*connectiontypes.MsgConnectionOpenTryResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) targetClient, err := clienttypes.UnpackClientState(msg.ClientState) @@ -186,7 +182,7 @@ func (k MsgServer) ConnectionOpenTry(goCtx context.Context, msg *connectiontypes return &connectiontypes.MsgConnectionOpenTryResponse{}, nil } -func (k MsgServer) ConnectionOpenAck(goCtx context.Context, msg *connectiontypes.MsgConnectionOpenAck) (*connectiontypes.MsgConnectionOpenAckResponse, error) { +func (k Keeper) ConnectionOpenAck(goCtx context.Context, msg *connectiontypes.MsgConnectionOpenAck) (*connectiontypes.MsgConnectionOpenAckResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) targetClient, err := clienttypes.UnpackClientState(msg.ClientState) if err != nil { @@ -220,7 +216,7 @@ func (k MsgServer) ConnectionOpenAck(goCtx context.Context, msg *connectiontypes return &connectiontypes.MsgConnectionOpenAckResponse{}, nil } -func (k MsgServer) ConnectionOpenConfirm(goCtx context.Context, msg *connectiontypes.MsgConnectionOpenConfirm) (*connectiontypes.MsgConnectionOpenConfirmResponse, error) { +func (k Keeper) ConnectionOpenConfirm(goCtx context.Context, msg *connectiontypes.MsgConnectionOpenConfirm) (*connectiontypes.MsgConnectionOpenConfirmResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) if err := k.ConnectionKeeper.ConnOpenConfirm( @@ -248,7 +244,7 @@ func (k MsgServer) ConnectionOpenConfirm(goCtx context.Context, msg *connectiont return &connectiontypes.MsgConnectionOpenConfirmResponse{}, nil } -func (k MsgServer) ChannelOpenInit(goCtx context.Context, msg *channeltypes.MsgChannelOpenInit) (*channeltypes.MsgChannelOpenInitResponse, error) { +func (k Keeper) ChannelOpenInit(goCtx context.Context, msg *channeltypes.MsgChannelOpenInit) (*channeltypes.MsgChannelOpenInitResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) // Lookup module by port capability @@ -275,7 +271,7 @@ func (k MsgServer) ChannelOpenInit(goCtx context.Context, msg *channeltypes.MsgC return &channeltypes.MsgChannelOpenInitResponse{}, nil } -func (k MsgServer) ChannelOpenTry(goCtx context.Context, msg *channeltypes.MsgChannelOpenTry) (*channeltypes.MsgChannelOpenTryResponse, error) { +func (k Keeper) ChannelOpenTry(goCtx context.Context, msg *channeltypes.MsgChannelOpenTry) (*channeltypes.MsgChannelOpenTryResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) // Lookup module by port capability module, portCap, err := k.PortKeeper.LookupModuleByPort(ctx, msg.PortId) @@ -301,7 +297,7 @@ func (k MsgServer) ChannelOpenTry(goCtx context.Context, msg *channeltypes.MsgCh return &channeltypes.MsgChannelOpenTryResponse{}, nil } -func (k MsgServer) ChannelOpenAck(goCtx context.Context, msg *channeltypes.MsgChannelOpenAck) (*channeltypes.MsgChannelOpenAckResponse, error) { +func (k Keeper) ChannelOpenAck(goCtx context.Context, msg *channeltypes.MsgChannelOpenAck) (*channeltypes.MsgChannelOpenAckResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) // Lookup module by channel capability @@ -328,7 +324,7 @@ func (k MsgServer) ChannelOpenAck(goCtx context.Context, msg *channeltypes.MsgCh return &channeltypes.MsgChannelOpenAckResponse{}, nil } -func (k MsgServer) ChannelOpenConfirm(goCtx context.Context, msg *channeltypes.MsgChannelOpenConfirm) (*channeltypes.MsgChannelOpenConfirmResponse, error) { +func (k Keeper) ChannelOpenConfirm(goCtx context.Context, msg *channeltypes.MsgChannelOpenConfirm) (*channeltypes.MsgChannelOpenConfirmResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) // Lookup module by channel capability @@ -355,7 +351,7 @@ func (k MsgServer) ChannelOpenConfirm(goCtx context.Context, msg *channeltypes.M return &channeltypes.MsgChannelOpenConfirmResponse{}, nil } -func (k MsgServer) ChannelCloseInit(goCtx context.Context, msg *channeltypes.MsgChannelCloseInit) (*channeltypes.MsgChannelCloseInitResponse, error) { +func (k Keeper) ChannelCloseInit(goCtx context.Context, msg *channeltypes.MsgChannelCloseInit) (*channeltypes.MsgChannelCloseInitResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) // Lookup module by channel capability module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.PortId, msg.ChannelId) @@ -381,7 +377,7 @@ func (k MsgServer) ChannelCloseInit(goCtx context.Context, msg *channeltypes.Msg return &channeltypes.MsgChannelCloseInitResponse{}, nil } -func (k MsgServer) ChannelCloseConfirm(goCtx context.Context, msg *channeltypes.MsgChannelCloseConfirm) (*channeltypes.MsgChannelCloseConfirmResponse, error) { +func (k Keeper) ChannelCloseConfirm(goCtx context.Context, msg *channeltypes.MsgChannelCloseConfirm) (*channeltypes.MsgChannelCloseConfirmResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) // Lookup module by channel capability @@ -408,7 +404,7 @@ func (k MsgServer) ChannelCloseConfirm(goCtx context.Context, msg *channeltypes. return &channeltypes.MsgChannelCloseConfirmResponse{}, nil } -func (k MsgServer) RecvPacket(goCtx context.Context, msg *channeltypes.MsgRecvPacket) (*channeltypes.MsgRecvPacketResponse, error) { +func (k Keeper) RecvPacket(goCtx context.Context, msg *channeltypes.MsgRecvPacket) (*channeltypes.MsgRecvPacketResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) // Lookup module by channel capability @@ -463,7 +459,7 @@ func (k MsgServer) RecvPacket(goCtx context.Context, msg *channeltypes.MsgRecvPa return &channeltypes.MsgRecvPacketResponse{}, nil } -func (k MsgServer) Timeout(goCtx context.Context, msg *channeltypes.MsgTimeout) (*channeltypes.MsgTimeoutResponse, error) { +func (k Keeper) Timeout(goCtx context.Context, msg *channeltypes.MsgTimeout) (*channeltypes.MsgTimeoutResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) // Lookup module by channel capability module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.Packet.SourcePort, msg.Packet.SourceChannel) @@ -510,7 +506,7 @@ func (k MsgServer) Timeout(goCtx context.Context, msg *channeltypes.MsgTimeout) return &channeltypes.MsgTimeoutResponse{}, nil } -func (k MsgServer) TimeoutOnClose(goCtx context.Context, msg *channeltypes.MsgTimeoutOnClose) (*channeltypes.MsgTimeoutOnCloseResponse, error) { +func (k Keeper) TimeoutOnClose(goCtx context.Context, msg *channeltypes.MsgTimeoutOnClose) (*channeltypes.MsgTimeoutOnCloseResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) // Lookup module by channel capability @@ -560,7 +556,7 @@ func (k MsgServer) TimeoutOnClose(goCtx context.Context, msg *channeltypes.MsgTi return &channeltypes.MsgTimeoutOnCloseResponse{}, nil } -func (k MsgServer) Acknowledgement(goCtx context.Context, msg *channeltypes.MsgAcknowledgement) (*channeltypes.MsgAcknowledgementResponse, error) { +func (k Keeper) Acknowledgement(goCtx context.Context, msg *channeltypes.MsgAcknowledgement) (*channeltypes.MsgAcknowledgementResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) // Lookup module by channel capability From 4f3e42d57bd9f665eee10dc280759154319fc68f Mon Sep 17 00:00:00 2001 From: atheesh Date: Mon, 19 Oct 2020 14:37:07 +0530 Subject: [PATCH 08/12] added doc --- .../applications/transfer/keeper/msg_server.go | 3 +++ x/ibc/core/keeper/msg_server.go | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/x/ibc/applications/transfer/keeper/msg_server.go b/x/ibc/applications/transfer/keeper/msg_server.go index e7631581e9da..dd2999af341e 100644 --- a/x/ibc/applications/transfer/keeper/msg_server.go +++ b/x/ibc/applications/transfer/keeper/msg_server.go @@ -9,6 +9,9 @@ import ( var _ types.MsgServer = Keeper{} +// See createOutgoingPacket in spec:https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#packet-relay + +// Transfer defines a rpc handler method for MsgTransfer. func (k Keeper) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types.MsgTransferResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) diff --git a/x/ibc/core/keeper/msg_server.go b/x/ibc/core/keeper/msg_server.go index 350b3067e257..15af7348462e 100644 --- a/x/ibc/core/keeper/msg_server.go +++ b/x/ibc/core/keeper/msg_server.go @@ -18,6 +18,7 @@ var _ clienttypes.MsgServer = Keeper{} var _ connectiontypes.MsgServer = Keeper{} var _ channeltypes.MsgServer = Keeper{} +// CreateClient defines a rpc handler method for MsgCreateClient. func (k Keeper) CreateClient(goCtx context.Context, msg *clienttypes.MsgCreateClient) (*clienttypes.MsgCreateClientResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) @@ -51,6 +52,7 @@ func (k Keeper) CreateClient(goCtx context.Context, msg *clienttypes.MsgCreateCl return &clienttypes.MsgCreateClientResponse{}, nil } +// UpdateClient defines a rpc handler method for MsgUpdateClient. func (k Keeper) UpdateClient(goCtx context.Context, msg *clienttypes.MsgUpdateClient) (*clienttypes.MsgUpdateClientResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) @@ -73,6 +75,7 @@ func (k Keeper) UpdateClient(goCtx context.Context, msg *clienttypes.MsgUpdateCl return &clienttypes.MsgUpdateClientResponse{}, nil } +// UpgradeClient defines a rpc handler method for MsgUpgradeClient. func (k Keeper) UpgradeClient(goCtx context.Context, msg *clienttypes.MsgUpgradeClient) (*clienttypes.MsgUpgradeClientResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) @@ -99,6 +102,7 @@ func (k Keeper) UpgradeClient(goCtx context.Context, msg *clienttypes.MsgUpgrade return &clienttypes.MsgUpgradeClientResponse{}, nil } +// SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. func (k Keeper) SubmitMisbehaviour(goCtx context.Context, msg *clienttypes.MsgSubmitMisbehaviour) (*clienttypes.MsgSubmitMisbehaviourResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) @@ -123,6 +127,7 @@ func (k Keeper) SubmitMisbehaviour(goCtx context.Context, msg *clienttypes.MsgSu return &clienttypes.MsgSubmitMisbehaviourResponse{}, nil } +// ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. func (k Keeper) ConnectionOpenInit(goCtx context.Context, msg *connectiontypes.MsgConnectionOpenInit) (*connectiontypes.MsgConnectionOpenInitResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) @@ -149,6 +154,7 @@ func (k Keeper) ConnectionOpenInit(goCtx context.Context, msg *connectiontypes.M return &connectiontypes.MsgConnectionOpenInitResponse{}, nil } +// ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. func (k Keeper) ConnectionOpenTry(goCtx context.Context, msg *connectiontypes.MsgConnectionOpenTry) (*connectiontypes.MsgConnectionOpenTryResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) @@ -182,6 +188,7 @@ func (k Keeper) ConnectionOpenTry(goCtx context.Context, msg *connectiontypes.Ms return &connectiontypes.MsgConnectionOpenTryResponse{}, nil } +// ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. func (k Keeper) ConnectionOpenAck(goCtx context.Context, msg *connectiontypes.MsgConnectionOpenAck) (*connectiontypes.MsgConnectionOpenAckResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) targetClient, err := clienttypes.UnpackClientState(msg.ClientState) @@ -216,6 +223,7 @@ func (k Keeper) ConnectionOpenAck(goCtx context.Context, msg *connectiontypes.Ms return &connectiontypes.MsgConnectionOpenAckResponse{}, nil } +// ConnectionOpenConfirm defines a rpc handler method for MsgConnectionOpenConfirm. func (k Keeper) ConnectionOpenConfirm(goCtx context.Context, msg *connectiontypes.MsgConnectionOpenConfirm) (*connectiontypes.MsgConnectionOpenConfirmResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) @@ -244,6 +252,7 @@ func (k Keeper) ConnectionOpenConfirm(goCtx context.Context, msg *connectiontype return &connectiontypes.MsgConnectionOpenConfirmResponse{}, nil } +// ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. func (k Keeper) ChannelOpenInit(goCtx context.Context, msg *channeltypes.MsgChannelOpenInit) (*channeltypes.MsgChannelOpenInitResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) @@ -271,6 +280,7 @@ func (k Keeper) ChannelOpenInit(goCtx context.Context, msg *channeltypes.MsgChan return &channeltypes.MsgChannelOpenInitResponse{}, nil } +// ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. func (k Keeper) ChannelOpenTry(goCtx context.Context, msg *channeltypes.MsgChannelOpenTry) (*channeltypes.MsgChannelOpenTryResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) // Lookup module by port capability @@ -297,6 +307,7 @@ func (k Keeper) ChannelOpenTry(goCtx context.Context, msg *channeltypes.MsgChann return &channeltypes.MsgChannelOpenTryResponse{}, nil } +// ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. func (k Keeper) ChannelOpenAck(goCtx context.Context, msg *channeltypes.MsgChannelOpenAck) (*channeltypes.MsgChannelOpenAckResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) @@ -324,6 +335,7 @@ func (k Keeper) ChannelOpenAck(goCtx context.Context, msg *channeltypes.MsgChann return &channeltypes.MsgChannelOpenAckResponse{}, nil } +// ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. func (k Keeper) ChannelOpenConfirm(goCtx context.Context, msg *channeltypes.MsgChannelOpenConfirm) (*channeltypes.MsgChannelOpenConfirmResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) @@ -351,6 +363,7 @@ func (k Keeper) ChannelOpenConfirm(goCtx context.Context, msg *channeltypes.MsgC return &channeltypes.MsgChannelOpenConfirmResponse{}, nil } +// ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. func (k Keeper) ChannelCloseInit(goCtx context.Context, msg *channeltypes.MsgChannelCloseInit) (*channeltypes.MsgChannelCloseInitResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) // Lookup module by channel capability @@ -377,6 +390,7 @@ func (k Keeper) ChannelCloseInit(goCtx context.Context, msg *channeltypes.MsgCha return &channeltypes.MsgChannelCloseInitResponse{}, nil } +// ChannelCloseConfirm defines a rpc handler method for MsgChannelCloseConfirm. func (k Keeper) ChannelCloseConfirm(goCtx context.Context, msg *channeltypes.MsgChannelCloseConfirm) (*channeltypes.MsgChannelCloseConfirmResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) @@ -404,6 +418,7 @@ func (k Keeper) ChannelCloseConfirm(goCtx context.Context, msg *channeltypes.Msg return &channeltypes.MsgChannelCloseConfirmResponse{}, nil } +// RecvPacket defines a rpc handler method for MsgRecvPacket. func (k Keeper) RecvPacket(goCtx context.Context, msg *channeltypes.MsgRecvPacket) (*channeltypes.MsgRecvPacketResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) @@ -459,6 +474,7 @@ func (k Keeper) RecvPacket(goCtx context.Context, msg *channeltypes.MsgRecvPacke return &channeltypes.MsgRecvPacketResponse{}, nil } +// Timeout defines a rpc handler method for MsgTimeout. func (k Keeper) Timeout(goCtx context.Context, msg *channeltypes.MsgTimeout) (*channeltypes.MsgTimeoutResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) // Lookup module by channel capability @@ -506,6 +522,7 @@ func (k Keeper) Timeout(goCtx context.Context, msg *channeltypes.MsgTimeout) (*c return &channeltypes.MsgTimeoutResponse{}, nil } +// TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. func (k Keeper) TimeoutOnClose(goCtx context.Context, msg *channeltypes.MsgTimeoutOnClose) (*channeltypes.MsgTimeoutOnCloseResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) @@ -556,6 +573,7 @@ func (k Keeper) TimeoutOnClose(goCtx context.Context, msg *channeltypes.MsgTimeo return &channeltypes.MsgTimeoutOnCloseResponse{}, nil } +// Acknowledgement defines a rpc handler method for MsgAcknowledgement. func (k Keeper) Acknowledgement(goCtx context.Context, msg *channeltypes.MsgAcknowledgement) (*channeltypes.MsgAcknowledgementResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) From 002772ac2ac84f973c786a1dd050b1fc0992e997 Mon Sep 17 00:00:00 2001 From: atheesh Date: Mon, 19 Oct 2020 17:25:43 +0530 Subject: [PATCH 09/12] review changes --- x/ibc/core/02-client/handler_test.go | 219 ------------------ .../{handler.go => proposal_handler.go} | 0 x/ibc/core/02-client/proposal_handler_test.go | 75 ++++++ .../msg_server_test.go} | 171 ++++++++++++-- 4 files changed, 228 insertions(+), 237 deletions(-) delete mode 100644 x/ibc/core/02-client/handler_test.go rename x/ibc/core/02-client/{handler.go => proposal_handler.go} (100%) create mode 100644 x/ibc/core/02-client/proposal_handler_test.go rename x/ibc/core/{handler_test.go => keeper/msg_server_test.go} (77%) diff --git a/x/ibc/core/02-client/handler_test.go b/x/ibc/core/02-client/handler_test.go deleted file mode 100644 index 6dcfb2734024..000000000000 --- a/x/ibc/core/02-client/handler_test.go +++ /dev/null @@ -1,219 +0,0 @@ -package client_test - -import ( - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - client "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client" - "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" - clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" - commitmenttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/23-commitment/types" - "github.com/cosmos/cosmos-sdk/x/ibc/core/exported" - "github.com/cosmos/cosmos-sdk/x/ibc/core/keeper" - ibctmtypes "github.com/cosmos/cosmos-sdk/x/ibc/light-clients/07-tendermint/types" - ibctesting "github.com/cosmos/cosmos-sdk/x/ibc/testing" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" -) - -func (suite *ClientTestSuite) TestNewClientUpdateProposalHandler() { - var ( - content govtypes.Content - err error - ) - - testCases := []struct { - name string - malleate func() - expPass bool - }{ - { - "valid update client proposal", func() { - clientA, _ := suite.coordinator.SetupClients(suite.chainA, suite.chainB, ibctesting.Tendermint) - clientState := suite.chainA.GetClientState(clientA) - - tmClientState, ok := clientState.(*ibctmtypes.ClientState) - suite.Require().True(ok) - tmClientState.AllowUpdateAfterMisbehaviour = true - tmClientState.FrozenHeight = tmClientState.LatestHeight - suite.chainA.App.IBCKeeper.ClientKeeper.SetClientState(suite.chainA.GetContext(), clientA, tmClientState) - - // use next header for chainB to update the client on chainA - header, err := suite.chainA.ConstructUpdateTMClientHeader(suite.chainB, clientA) - suite.Require().NoError(err) - - content, err = clienttypes.NewClientUpdateProposal(ibctesting.Title, ibctesting.Description, clientA, header) - suite.Require().NoError(err) - }, true, - }, - { - "nil proposal", func() { - content = nil - }, false, - }, - { - "unsupported proposal type", func() { - content = distributiontypes.NewCommunityPoolSpendProposal(ibctesting.Title, ibctesting.Description, suite.chainA.SenderAccount.GetAddress(), sdk.NewCoins(sdk.NewCoin("communityfunds", sdk.NewInt(10)))) - }, false, - }, - } - - for _, tc := range testCases { - tc := tc - - suite.Run(tc.name, func() { - suite.SetupTest() // reset - - tc.malleate() - - proposalHandler := client.NewClientUpdateProposalHandler(suite.chainA.App.IBCKeeper.ClientKeeper) - - err = proposalHandler(suite.chainA.GetContext(), content) - - if tc.expPass { - suite.Require().NoError(err) - } else { - suite.Require().Error(err) - } - }) - } - -} - -func (suite *ClientTestSuite) TestUpgradeClient() { - var ( - clientA string - upgradedClient exported.ClientState - upgradeHeight exported.Height - msg *clienttypes.MsgUpgradeClient - ) - - newClientHeight := clienttypes.NewHeight(1, 1) - - cases := []struct { - name string - setup func() - expPass bool - }{ - { - name: "successful upgrade", - setup: func() { - - upgradedClient = ibctmtypes.NewClientState("newChainId", ibctmtypes.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod+ibctesting.TrustingPeriod, ibctesting.MaxClockDrift, newClientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false) - - // upgrade Height is at next block - upgradeHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) - - // zero custom fields and store in upgrade store - suite.chainB.App.UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(upgradeHeight.GetVersionHeight()), upgradedClient) - - // commit upgrade store changes and update clients - - suite.coordinator.CommitBlock(suite.chainB) - err := suite.coordinator.UpdateClient(suite.chainA, suite.chainB, clientA, ibctesting.Tendermint) - suite.Require().NoError(err) - - cs, found := suite.chainA.App.IBCKeeper.ClientKeeper.GetClientState(suite.chainA.GetContext(), clientA) - suite.Require().True(found) - - proofUpgrade, _ := suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(upgradeHeight.GetVersionHeight())), cs.GetLatestHeight().GetVersionHeight()) - - msg, err = clienttypes.NewMsgUpgradeClient(clientA, upgradedClient, upgradeHeight, proofUpgrade, suite.chainA.SenderAccount.GetAddress()) - suite.Require().NoError(err) - }, - expPass: true, - }, - { - name: "invalid upgrade: msg.ClientState does not contain valid clientstate", - setup: func() { - - cs, found := suite.chainA.App.IBCKeeper.ClientKeeper.GetClientState(suite.chainA.GetContext(), clientA) - suite.Require().True(found) - - // upgrade Height is at next block - upgradeHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) - - proofUpgrade, _ := suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(upgradeHeight.GetVersionHeight())), cs.GetLatestHeight().GetVersionHeight()) - - consState := ibctmtypes.NewConsensusState(time.Now(), commitmenttypes.NewMerkleRoot([]byte("app_hash")), []byte("next_vals_hash")) - consAny, err := clienttypes.PackConsensusState(consState) - suite.Require().NoError(err) - - height, _ := upgradeHeight.(types.Height) - - msg = &types.MsgUpgradeClient{ClientId: clientA, ClientState: consAny, UpgradeHeight: &height, ProofUpgrade: proofUpgrade, Signer: suite.chainA.SenderAccount.GetAddress().String()} - }, - expPass: false, - }, - { - name: "invalid clientstate", - setup: func() { - - upgradedClient = ibctmtypes.NewClientState("", ibctmtypes.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod+ibctesting.TrustingPeriod, ibctesting.MaxClockDrift, newClientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false) - - // upgrade Height is at next block - upgradeHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) - - // zero custom fields and store in upgrade store - suite.chainB.App.UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(upgradeHeight.GetVersionHeight()), upgradedClient) - - // commit upgrade store changes and update clients - - suite.coordinator.CommitBlock(suite.chainB) - err := suite.coordinator.UpdateClient(suite.chainA, suite.chainB, clientA, ibctesting.Tendermint) - suite.Require().NoError(err) - - cs, found := suite.chainA.App.IBCKeeper.ClientKeeper.GetClientState(suite.chainA.GetContext(), clientA) - suite.Require().True(found) - - proofUpgrade, _ := suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(upgradeHeight.GetVersionHeight())), cs.GetLatestHeight().GetVersionHeight()) - - msg, err = clienttypes.NewMsgUpgradeClient(clientA, upgradedClient, upgradeHeight, proofUpgrade, suite.chainA.SenderAccount.GetAddress()) - suite.Require().NoError(err) - }, - expPass: false, - }, - { - name: "VerifyUpgrade fails", - setup: func() { - - upgradedClient = ibctmtypes.NewClientState("newChainId", ibctmtypes.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod+ibctesting.TrustingPeriod, ibctesting.MaxClockDrift, newClientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false) - - // upgrade Height is at next block - upgradeHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) - - // zero custom fields and store in upgrade store - suite.chainB.App.UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(upgradeHeight.GetVersionHeight()), upgradedClient) - - // commit upgrade store changes and update clients - - suite.coordinator.CommitBlock(suite.chainB) - err := suite.coordinator.UpdateClient(suite.chainA, suite.chainB, clientA, ibctesting.Tendermint) - suite.Require().NoError(err) - - msg, err = clienttypes.NewMsgUpgradeClient(clientA, upgradedClient, upgradeHeight, nil, suite.chainA.SenderAccount.GetAddress()) - suite.Require().NoError(err) - }, - expPass: false, - }, - } - - for _, tc := range cases { - tc := tc - clientA, _ = suite.coordinator.SetupClients(suite.chainA, suite.chainB, ibctesting.Tendermint) - - tc.setup() - - _, err := keeper.Keeper.UpgradeClient(*suite.chainA.App.IBCKeeper, sdk.WrapSDKContext(suite.chainA.GetContext()), msg) - - if tc.expPass { - suite.Require().NoError(err, "upgrade handler failed on valid case: %s", tc.name) - newClient, ok := suite.chainA.App.IBCKeeper.ClientKeeper.GetClientState(suite.chainA.GetContext(), clientA) - suite.Require().True(ok) - suite.Require().Equal(upgradedClient, newClient) - } else { - suite.Require().Error(err, "upgrade handler passed on invalid case: %s", tc.name) - } - } -} diff --git a/x/ibc/core/02-client/handler.go b/x/ibc/core/02-client/proposal_handler.go similarity index 100% rename from x/ibc/core/02-client/handler.go rename to x/ibc/core/02-client/proposal_handler.go diff --git a/x/ibc/core/02-client/proposal_handler_test.go b/x/ibc/core/02-client/proposal_handler_test.go new file mode 100644 index 000000000000..839dd2e532ab --- /dev/null +++ b/x/ibc/core/02-client/proposal_handler_test.go @@ -0,0 +1,75 @@ +package client_test + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + client "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client" + clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" + ibctmtypes "github.com/cosmos/cosmos-sdk/x/ibc/light-clients/07-tendermint/types" + ibctesting "github.com/cosmos/cosmos-sdk/x/ibc/testing" +) + +func (suite *ClientTestSuite) TestNewClientUpdateProposalHandler() { + var ( + content govtypes.Content + err error + ) + + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "valid update client proposal", func() { + clientA, _ := suite.coordinator.SetupClients(suite.chainA, suite.chainB, ibctesting.Tendermint) + clientState := suite.chainA.GetClientState(clientA) + + tmClientState, ok := clientState.(*ibctmtypes.ClientState) + suite.Require().True(ok) + tmClientState.AllowUpdateAfterMisbehaviour = true + tmClientState.FrozenHeight = tmClientState.LatestHeight + suite.chainA.App.IBCKeeper.ClientKeeper.SetClientState(suite.chainA.GetContext(), clientA, tmClientState) + + // use next header for chainB to update the client on chainA + header, err := suite.chainA.ConstructUpdateTMClientHeader(suite.chainB, clientA) + suite.Require().NoError(err) + + content, err = clienttypes.NewClientUpdateProposal(ibctesting.Title, ibctesting.Description, clientA, header) + suite.Require().NoError(err) + }, true, + }, + { + "nil proposal", func() { + content = nil + }, false, + }, + { + "unsupported proposal type", func() { + content = distributiontypes.NewCommunityPoolSpendProposal(ibctesting.Title, ibctesting.Description, suite.chainA.SenderAccount.GetAddress(), sdk.NewCoins(sdk.NewCoin("communityfunds", sdk.NewInt(10)))) + }, false, + }, + } + + for _, tc := range testCases { + tc := tc + + suite.Run(tc.name, func() { + suite.SetupTest() // reset + + tc.malleate() + + proposalHandler := client.NewClientUpdateProposalHandler(suite.chainA.App.IBCKeeper.ClientKeeper) + + err = proposalHandler(suite.chainA.GetContext(), content) + + if tc.expPass { + suite.Require().NoError(err) + } else { + suite.Require().Error(err) + } + }) + } + +} diff --git a/x/ibc/core/handler_test.go b/x/ibc/core/keeper/msg_server_test.go similarity index 77% rename from x/ibc/core/handler_test.go rename to x/ibc/core/keeper/msg_server_test.go index 712811dbe1e3..88d9402fea12 100644 --- a/x/ibc/core/handler_test.go +++ b/x/ibc/core/keeper/msg_server_test.go @@ -1,15 +1,21 @@ -package ibc_test +package keeper_test import ( "testing" + "time" "github.com/stretchr/testify/suite" - ibc "github.com/cosmos/cosmos-sdk/x/ibc/core" + sdk "github.com/cosmos/cosmos-sdk/types" clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel/types" + commitmenttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/23-commitment/types" host "github.com/cosmos/cosmos-sdk/x/ibc/core/24-host" + "github.com/cosmos/cosmos-sdk/x/ibc/core/exported" + "github.com/cosmos/cosmos-sdk/x/ibc/core/keeper" + ibctmtypes "github.com/cosmos/cosmos-sdk/x/ibc/light-clients/07-tendermint/types" ibctesting "github.com/cosmos/cosmos-sdk/x/ibc/testing" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) const ( @@ -143,8 +149,6 @@ func (suite *IBCTestSuite) TestHandleRecvPacket() { suite.Run(tc.name, func() { suite.SetupTest() // reset - handler := ibc.NewHandler(*suite.chainB.App.IBCKeeper) - tc.malleate() // get proof of packet commitment from chainA @@ -154,13 +158,13 @@ func (suite *IBCTestSuite) TestHandleRecvPacket() { msg := channeltypes.NewMsgRecvPacket(packet, proof, proofHeight, suite.chainB.SenderAccount.GetAddress()) // ante-handle RecvPacket - _, err := handler(suite.chainB.GetContext(), msg) + _, err := keeper.Keeper.RecvPacket(*suite.chainB.App.IBCKeeper, sdk.WrapSDKContext(suite.chainB.GetContext()), msg) if tc.expPass { suite.Require().NoError(err) // replay should fail since state changes occur - _, err := handler(suite.chainB.GetContext(), msg) + _, err := keeper.Keeper.RecvPacket(*suite.chainB.App.IBCKeeper, sdk.WrapSDKContext(suite.chainB.GetContext()), msg) suite.Require().Error(err) // verify ack was written @@ -303,8 +307,6 @@ func (suite *IBCTestSuite) TestHandleAcknowledgePacket() { suite.SetupTest() // reset ibctesting.TestHash = ibctesting.MockAcknowledgement - handler := ibc.NewHandler(*suite.chainA.App.IBCKeeper) - tc.malleate() packetKey := host.KeyPacketAcknowledgement(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence()) @@ -312,13 +314,13 @@ func (suite *IBCTestSuite) TestHandleAcknowledgePacket() { msg := channeltypes.NewMsgAcknowledgement(packet, ibctesting.MockAcknowledgement, proof, proofHeight, suite.chainA.SenderAccount.GetAddress()) - _, err := handler(suite.chainA.GetContext(), msg) + _, err := keeper.Keeper.Acknowledgement(*suite.chainA.App.IBCKeeper, sdk.WrapSDKContext(suite.chainA.GetContext()), msg) if tc.expPass { suite.Require().NoError(err) // replay should an error - _, err := handler(suite.chainA.GetContext(), msg) + _, err := keeper.Keeper.Acknowledgement(*suite.chainA.App.IBCKeeper, sdk.WrapSDKContext(suite.chainA.GetContext()), msg) suite.Require().Error(err) // verify packet commitment was deleted on source chain @@ -427,21 +429,19 @@ func (suite *IBCTestSuite) TestHandleTimeoutPacket() { suite.Run(tc.name, func() { suite.SetupTest() // reset - handler := ibc.NewHandler(*suite.chainA.App.IBCKeeper) - tc.malleate() proof, proofHeight := suite.chainB.QueryProof(packetKey) msg := channeltypes.NewMsgTimeout(packet, 1, proof, proofHeight, suite.chainA.SenderAccount.GetAddress()) - _, err := handler(suite.chainA.GetContext(), msg) + _, err := keeper.Keeper.Timeout(*suite.chainA.App.IBCKeeper, sdk.WrapSDKContext(suite.chainA.GetContext()), msg) if tc.expPass { suite.Require().NoError(err) // replay should return an error - _, err := handler(suite.chainA.GetContext(), msg) + _, err := keeper.Keeper.Timeout(*suite.chainA.App.IBCKeeper, sdk.WrapSDKContext(suite.chainA.GetContext()), msg) suite.Require().Error(err) // verify packet commitment was deleted on source chain @@ -608,8 +608,6 @@ func (suite *IBCTestSuite) TestHandleTimeoutOnClosePacket() { suite.Run(tc.name, func() { suite.SetupTest() // reset - handler := ibc.NewHandler(*suite.chainA.App.IBCKeeper) - tc.malleate() proof, proofHeight := suite.chainB.QueryProof(packetKey) @@ -619,13 +617,13 @@ func (suite *IBCTestSuite) TestHandleTimeoutOnClosePacket() { msg := channeltypes.NewMsgTimeoutOnClose(packet, 1, proof, proofClosed, proofHeight, suite.chainA.SenderAccount.GetAddress()) - _, err := handler(suite.chainA.GetContext(), msg) + _, err := keeper.Keeper.TimeoutOnClose(*suite.chainA.App.IBCKeeper, sdk.WrapSDKContext(suite.chainA.GetContext()), msg) if tc.expPass { suite.Require().NoError(err) // replay should return an error - _, err := handler(suite.chainA.GetContext(), msg) + _, err := keeper.Keeper.TimeoutOnClose(*suite.chainA.App.IBCKeeper, sdk.WrapSDKContext(suite.chainA.GetContext()), msg) suite.Require().Error(err) // verify packet commitment was deleted on source chain @@ -638,3 +636,140 @@ func (suite *IBCTestSuite) TestHandleTimeoutOnClosePacket() { }) } } + +func (suite *IBCTestSuite) TestUpgradeClient() { + var ( + clientA string + upgradedClient exported.ClientState + upgradeHeight exported.Height + msg *clienttypes.MsgUpgradeClient + ) + + newClientHeight := clienttypes.NewHeight(1, 1) + + cases := []struct { + name string + setup func() + expPass bool + }{ + { + name: "successful upgrade", + setup: func() { + + upgradedClient = ibctmtypes.NewClientState("newChainId", ibctmtypes.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod+ibctesting.TrustingPeriod, ibctesting.MaxClockDrift, newClientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false) + + // upgrade Height is at next block + upgradeHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) + + // zero custom fields and store in upgrade store + suite.chainB.App.UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(upgradeHeight.GetVersionHeight()), upgradedClient) + + // commit upgrade store changes and update clients + + suite.coordinator.CommitBlock(suite.chainB) + err := suite.coordinator.UpdateClient(suite.chainA, suite.chainB, clientA, ibctesting.Tendermint) + suite.Require().NoError(err) + + cs, found := suite.chainA.App.IBCKeeper.ClientKeeper.GetClientState(suite.chainA.GetContext(), clientA) + suite.Require().True(found) + + proofUpgrade, _ := suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(upgradeHeight.GetVersionHeight())), cs.GetLatestHeight().GetVersionHeight()) + + msg, err = clienttypes.NewMsgUpgradeClient(clientA, upgradedClient, upgradeHeight, proofUpgrade, suite.chainA.SenderAccount.GetAddress()) + suite.Require().NoError(err) + }, + expPass: true, + }, + { + name: "invalid upgrade: msg.ClientState does not contain valid clientstate", + setup: func() { + + cs, found := suite.chainA.App.IBCKeeper.ClientKeeper.GetClientState(suite.chainA.GetContext(), clientA) + suite.Require().True(found) + + // upgrade Height is at next block + upgradeHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) + + proofUpgrade, _ := suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(upgradeHeight.GetVersionHeight())), cs.GetLatestHeight().GetVersionHeight()) + + consState := ibctmtypes.NewConsensusState(time.Now(), commitmenttypes.NewMerkleRoot([]byte("app_hash")), []byte("next_vals_hash")) + consAny, err := clienttypes.PackConsensusState(consState) + suite.Require().NoError(err) + + height, _ := upgradeHeight.(clienttypes.Height) + + msg = &clienttypes.MsgUpgradeClient{ClientId: clientA, ClientState: consAny, UpgradeHeight: &height, ProofUpgrade: proofUpgrade, Signer: suite.chainA.SenderAccount.GetAddress().String()} + }, + expPass: false, + }, + { + name: "invalid clientstate", + setup: func() { + + upgradedClient = ibctmtypes.NewClientState("", ibctmtypes.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod+ibctesting.TrustingPeriod, ibctesting.MaxClockDrift, newClientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false) + + // upgrade Height is at next block + upgradeHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) + + // zero custom fields and store in upgrade store + suite.chainB.App.UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(upgradeHeight.GetVersionHeight()), upgradedClient) + + // commit upgrade store changes and update clients + + suite.coordinator.CommitBlock(suite.chainB) + err := suite.coordinator.UpdateClient(suite.chainA, suite.chainB, clientA, ibctesting.Tendermint) + suite.Require().NoError(err) + + cs, found := suite.chainA.App.IBCKeeper.ClientKeeper.GetClientState(suite.chainA.GetContext(), clientA) + suite.Require().True(found) + + proofUpgrade, _ := suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(upgradeHeight.GetVersionHeight())), cs.GetLatestHeight().GetVersionHeight()) + + msg, err = clienttypes.NewMsgUpgradeClient(clientA, upgradedClient, upgradeHeight, proofUpgrade, suite.chainA.SenderAccount.GetAddress()) + suite.Require().NoError(err) + }, + expPass: false, + }, + { + name: "VerifyUpgrade fails", + setup: func() { + + upgradedClient = ibctmtypes.NewClientState("newChainId", ibctmtypes.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod+ibctesting.TrustingPeriod, ibctesting.MaxClockDrift, newClientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false) + + // upgrade Height is at next block + upgradeHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) + + // zero custom fields and store in upgrade store + suite.chainB.App.UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(upgradeHeight.GetVersionHeight()), upgradedClient) + + // commit upgrade store changes and update clients + + suite.coordinator.CommitBlock(suite.chainB) + err := suite.coordinator.UpdateClient(suite.chainA, suite.chainB, clientA, ibctesting.Tendermint) + suite.Require().NoError(err) + + msg, err = clienttypes.NewMsgUpgradeClient(clientA, upgradedClient, upgradeHeight, nil, suite.chainA.SenderAccount.GetAddress()) + suite.Require().NoError(err) + }, + expPass: false, + }, + } + + for _, tc := range cases { + tc := tc + clientA, _ = suite.coordinator.SetupClients(suite.chainA, suite.chainB, ibctesting.Tendermint) + + tc.setup() + + _, err := keeper.Keeper.UpgradeClient(*suite.chainA.App.IBCKeeper, sdk.WrapSDKContext(suite.chainA.GetContext()), msg) + + if tc.expPass { + suite.Require().NoError(err, "upgrade handler failed on valid case: %s", tc.name) + newClient, ok := suite.chainA.App.IBCKeeper.ClientKeeper.GetClientState(suite.chainA.GetContext(), clientA) + suite.Require().True(ok) + suite.Require().Equal(upgradedClient, newClient) + } else { + suite.Require().Error(err, "upgrade handler passed on invalid case: %s", tc.name) + } + } +} From 1223c2da301eaa09e0605c023c20ed4d66e176e3 Mon Sep 17 00:00:00 2001 From: atheesh Date: Mon, 19 Oct 2020 21:22:43 +0530 Subject: [PATCH 10/12] fix tests --- x/ibc/core/genesis_test.go | 40 ++++++++++++++++++++++++++++ x/ibc/core/keeper/msg_server_test.go | 28 ++++++------------- 2 files changed, 48 insertions(+), 20 deletions(-) diff --git a/x/ibc/core/genesis_test.go b/x/ibc/core/genesis_test.go index ffc6912d20d2..3a3bbaf167cf 100644 --- a/x/ibc/core/genesis_test.go +++ b/x/ibc/core/genesis_test.go @@ -2,7 +2,9 @@ package ibc_test import ( "fmt" + "testing" + "github.com/stretchr/testify/suite" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/codec" @@ -20,6 +22,44 @@ import ( ibctesting "github.com/cosmos/cosmos-sdk/x/ibc/testing" ) +const ( + connectionID = "connectionidone" + clientID = "clientidone" + connectionID2 = "connectionidtwo" + clientID2 = "clientidtwo" + + port1 = "firstport" + port2 = "secondport" + + channel1 = "firstchannel" + channel2 = "secondchannel" +) + +var ( + clientHeight = clienttypes.NewHeight(0, 10) +) + +type IBCTestSuite struct { + suite.Suite + + coordinator *ibctesting.Coordinator + + chainA *ibctesting.TestChain + chainB *ibctesting.TestChain +} + +// SetupTest creates a coordinator with 2 test chains. +func (suite *IBCTestSuite) SetupTest() { + suite.coordinator = ibctesting.NewCoordinator(suite.T(), 2) + + suite.chainA = suite.coordinator.GetChain(ibctesting.GetChainID(0)) + suite.chainB = suite.coordinator.GetChain(ibctesting.GetChainID(1)) +} + +func TestIBCTestSuite(t *testing.T) { + suite.Run(t, new(IBCTestSuite)) +} + func (suite *IBCTestSuite) TestValidateGenesis() { header := suite.chainA.CreateTMClientHeader(suite.chainA.ChainID, suite.chainA.CurrentHeader.Height, clienttypes.NewHeight(0, uint64(suite.chainA.CurrentHeader.Height-1)), suite.chainA.CurrentHeader.Time, suite.chainA.Vals, suite.chainA.Vals, suite.chainA.Signers) diff --git a/x/ibc/core/keeper/msg_server_test.go b/x/ibc/core/keeper/msg_server_test.go index 88d9402fea12..9a4069af2edd 100644 --- a/x/ibc/core/keeper/msg_server_test.go +++ b/x/ibc/core/keeper/msg_server_test.go @@ -19,27 +19,15 @@ import ( ) const ( - connectionID = "connectionidone" - clientID = "clientidone" - connectionID2 = "connectionidtwo" - clientID2 = "clientidtwo" - - port1 = "firstport" - port2 = "secondport" - - channel1 = "firstchannel" - channel2 = "secondchannel" - height = 10 ) var ( timeoutHeight = clienttypes.NewHeight(0, 10000) maxSequence = uint64(10) - clientHeight = clienttypes.NewHeight(0, 10) ) -type IBCTestSuite struct { +type KeeperTestSuite struct { suite.Suite coordinator *ibctesting.Coordinator @@ -49,7 +37,7 @@ type IBCTestSuite struct { } // SetupTest creates a coordinator with 2 test chains. -func (suite *IBCTestSuite) SetupTest() { +func (suite *KeeperTestSuite) SetupTest() { suite.coordinator = ibctesting.NewCoordinator(suite.T(), 2) suite.chainA = suite.coordinator.GetChain(ibctesting.GetChainID(0)) @@ -57,7 +45,7 @@ func (suite *IBCTestSuite) SetupTest() { } func TestIBCTestSuite(t *testing.T) { - suite.Run(t, new(IBCTestSuite)) + suite.Run(t, new(KeeperTestSuite)) } // tests the IBC handler receiving a packet on ordered and unordered channels. @@ -65,7 +53,7 @@ func TestIBCTestSuite(t *testing.T) { // tests high level properties like ordering and basic sanity checks. More // rigorous testing of 'RecvPacket' and 'WriteReceipt' can be found in the // 04-channel/keeper/packet_test.go. -func (suite *IBCTestSuite) TestHandleRecvPacket() { +func (suite *KeeperTestSuite) TestHandleRecvPacket() { var ( packet channeltypes.Packet ) @@ -183,7 +171,7 @@ func (suite *IBCTestSuite) TestHandleRecvPacket() { // occurs. It test high level properties like ordering and basic sanity // checks. More rigorous testing of 'AcknowledgePacket' and 'AcknowledgementExecuted' // can be found in the 04-channel/keeper/packet_test.go. -func (suite *IBCTestSuite) TestHandleAcknowledgePacket() { +func (suite *KeeperTestSuite) TestHandleAcknowledgePacket() { var ( packet channeltypes.Packet ) @@ -339,7 +327,7 @@ func (suite *IBCTestSuite) TestHandleAcknowledgePacket() { // high level properties like ordering and basic sanity checks. More // rigorous testing of 'TimeoutPacket' and 'TimeoutExecuted' can be found in // the 04-channel/keeper/timeout_test.go. -func (suite *IBCTestSuite) TestHandleTimeoutPacket() { +func (suite *KeeperTestSuite) TestHandleTimeoutPacket() { var ( packet channeltypes.Packet packetKey []byte @@ -460,7 +448,7 @@ func (suite *IBCTestSuite) TestHandleTimeoutPacket() { // commitment occurs. It tests high level properties like ordering and basic // sanity checks. More rigorous testing of 'TimeoutOnClose' and //'TimeoutExecuted' can be found in the 04-channel/keeper/timeout_test.go. -func (suite *IBCTestSuite) TestHandleTimeoutOnClosePacket() { +func (suite *KeeperTestSuite) TestHandleTimeoutOnClosePacket() { var ( packet channeltypes.Packet packetKey []byte @@ -637,7 +625,7 @@ func (suite *IBCTestSuite) TestHandleTimeoutOnClosePacket() { } } -func (suite *IBCTestSuite) TestUpgradeClient() { +func (suite *KeeperTestSuite) TestUpgradeClient() { var ( clientA string upgradedClient exported.ClientState From b927c0d507b15587d473d12b2abfcb9c7d917aac Mon Sep 17 00:00:00 2001 From: atheesh Date: Mon, 19 Oct 2020 21:36:31 +0530 Subject: [PATCH 11/12] formatter --- x/ibc/core/genesis_test.go | 4 +--- x/ibc/core/keeper/msg_server_test.go | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/x/ibc/core/genesis_test.go b/x/ibc/core/genesis_test.go index 3a3bbaf167cf..6dc06a5de80f 100644 --- a/x/ibc/core/genesis_test.go +++ b/x/ibc/core/genesis_test.go @@ -35,9 +35,7 @@ const ( channel2 = "secondchannel" ) -var ( - clientHeight = clienttypes.NewHeight(0, 10) -) +var clientHeight = clienttypes.NewHeight(0, 10) type IBCTestSuite struct { suite.Suite diff --git a/x/ibc/core/keeper/msg_server_test.go b/x/ibc/core/keeper/msg_server_test.go index 9a4069af2edd..2f3910fe71df 100644 --- a/x/ibc/core/keeper/msg_server_test.go +++ b/x/ibc/core/keeper/msg_server_test.go @@ -18,9 +18,7 @@ import ( upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) -const ( - height = 10 -) +const height = 10 var ( timeoutHeight = clienttypes.NewHeight(0, 10000) From bac9f1af8c780d9c90f4e69c325a6be4d9816144 Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Mon, 19 Oct 2020 13:51:45 -0400 Subject: [PATCH 12/12] Add MsgServer wiring in RegisterServices --- x/ibc/applications/transfer/module.go | 4 ++-- x/ibc/core/module.go | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/x/ibc/applications/transfer/module.go b/x/ibc/applications/transfer/module.go index 4d73f693cd2a..99478288095d 100644 --- a/x/ibc/applications/transfer/module.go +++ b/x/ibc/applications/transfer/module.go @@ -120,9 +120,9 @@ func (am AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { return nil } -// RegisterQueryService registers a GRPC query service to respond to the -// module-specific GRPC queries. +// RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), am.keeper) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } diff --git a/x/ibc/core/module.go b/x/ibc/core/module.go index 35a734ccf959..4590556be95a 100644 --- a/x/ibc/core/module.go +++ b/x/ibc/core/module.go @@ -130,8 +130,11 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd return nil } -// RegisterQueryService registers the gRPC query service for the ibc module. +// RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { + clienttypes.RegisterMsgServer(cfg.MsgServer(), am.keeper) + connectiontypes.RegisterMsgServer(cfg.MsgServer(), am.keeper) + channeltypes.RegisterMsgServer(cfg.MsgServer(), am.keeper) types.RegisterQueryService(cfg.QueryServer(), am.keeper) }