diff --git a/proto/ibc/applications/transfer/v1/events.proto b/proto/ibc/applications/transfer/v1/events.proto new file mode 100644 index 000000000000..f5623c740f17 --- /dev/null +++ b/proto/ibc/applications/transfer/v1/events.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package ibc.applications.transfer.v1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/applications/transfer/types"; + +import "gogoproto/gogo.proto"; + +// EventTransfer is a typed event emitted on ibc transfer +message EventTransfer { + string sender = 1; + + string receiver = 2; +} + +// EventAcknowledgementSuccess is a typed event emitted on packet acknowledgement success +message EventAcknowledgementSuccess { + bytes success = 1; +} + +// EventAcknowledgementError is a typed event emitted on packet acknowledgement error +message EventAcknowledgementError { + string error = 1; +} + +// EventDenominationTrace is a typed event for denomination trace +message EventDenominationTrace { + string trace_hash = 1 [(gogoproto.moretags) = "yaml:\"trace_hash\""]; + + string denom = 2; +} diff --git a/proto/ibc/core/channel/v1/events.proto b/proto/ibc/core/channel/v1/events.proto new file mode 100644 index 000000000000..8323c10f7b9b --- /dev/null +++ b/proto/ibc/core/channel/v1/events.proto @@ -0,0 +1,196 @@ +syntax = "proto3"; +package ibc.core.channel.v1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel/types"; + +import "ibc/core/channel/v1/channel.proto"; +import "gogoproto/gogo.proto"; +import "ibc/core/client/v1/client.proto"; + +// EventChannelOpenInit is a typed event emitted on channel open init +message EventChannelOpenInit { + string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + + string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + + string counterparty_port_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_port_id\""]; + + string connection_id = 5 [(gogoproto.moretags) = "yaml:\"connection_id\""]; +} + +// EventChannelOpenTry is a typed event emitted on channel open try +message EventChannelOpenTry { + string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + + string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + + string counterparty_port_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_port_id\""]; + + string counterparty_channel_id = 4 [(gogoproto.moretags) = "yaml:\"counterparty_channel_id\""]; + + string connection_id = 5 [(gogoproto.moretags) = "yaml:\"connection_id\""]; +} + +// EventChannelOpenAck is a typed event emitted on channel open acknowledgement +message EventChannelOpenAck { + string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + + string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + + string counterparty_port_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_port_id\""]; + + string counterparty_channel_id = 4 [(gogoproto.moretags) = "yaml:\"counterparty_channel_id\""]; + + string connection_id = 5 [(gogoproto.moretags) = "yaml:\"connection_id\""]; +} + +// EventChannelOpenConfirm is a typed event emitted on channel open confirm +message EventChannelOpenConfirm { + string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + + string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + + string counterparty_port_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_port_id\""]; + + string counterparty_channel_id = 4 [(gogoproto.moretags) = "yaml:\"counterparty_channel_id\""]; + + string connection_id = 5 [(gogoproto.moretags) = "yaml:\"connection_id\""]; +} + +// EventChannelCloseInit is a typed event emitted on channel close init +message EventChannelCloseInit { + string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + + string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + + string counterparty_port_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_port_id\""]; + + string counterparty_channel_id = 4 [(gogoproto.moretags) = "yaml:\"counterparty_channel_id\""]; + + string connection_id = 5 [(gogoproto.moretags) = "yaml:\"connection_id\""]; +} + +// EventChannelCloseConfirm is a typed event emitted on channel close confirm +message EventChannelCloseConfirm { + string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + + string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + + string counterparty_port_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_port_id\""]; + + string counterparty_channel_id = 4 [(gogoproto.moretags) = "yaml:\"counterparty_channel_id\""]; + + string connection_id = 5 [(gogoproto.moretags) = "yaml:\"connection_id\""]; +} + +// EventChannelSendPacket is a typed event emitted when packet is sent +message EventChannelSendPacket { + bytes data = 1; + + ibc.core.client.v1.Height timeout_height = 2 + [(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false]; + + uint64 timeout_timestamp = 3 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; + + uint64 sequence = 4; + + string src_port = 5 [(gogoproto.moretags) = "yaml:\"src_port\""]; + + string src_channel = 6 [(gogoproto.moretags) = "yaml:\"src_channel\""]; + + string dst_port = 7 [(gogoproto.moretags) = "yaml:\"dst_port\""]; + + string dst_channel = 8 [(gogoproto.moretags) = "yaml:\"dst_channel\""]; + + Order channel_ordering = 9 [(gogoproto.moretags) = "yaml:\"channel_ordering\""]; +} + +// EventChannelRecvPacket is a typed event emitted when packet is received in channel +message EventChannelRecvPacket { + bytes data = 1; + + ibc.core.client.v1.Height timeout_height = 2 + [(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false]; + + uint64 timeout_timestamp = 3 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; + + uint64 sequence = 4; + + string src_port = 5 [(gogoproto.moretags) = "yaml:\"src_port\""]; + + string src_channel = 6 [(gogoproto.moretags) = "yaml:\"src_channel\""]; + + string dst_port = 7 [(gogoproto.moretags) = "yaml:\"dst_port\""]; + + string dst_channel = 8 [(gogoproto.moretags) = "yaml:\"dst_channel\""]; + + Order channel_ordering = 9 [(gogoproto.moretags) = "yaml:\"channel_ordering\""]; +} + +// EventChannelWriteAck is a typed event emitted on write acknowledgement +message EventChannelWriteAck { + bytes data = 1; + + ibc.core.client.v1.Height timeout_height = 2 + [(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false]; + + uint64 timeout_timestamp = 3 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; + + uint64 sequence = 4; + + string src_port = 5 [(gogoproto.moretags) = "yaml:\"src_port\""]; + + string src_channel = 6 [(gogoproto.moretags) = "yaml:\"src_channel\""]; + + string dst_port = 7 [(gogoproto.moretags) = "yaml:\"dst_port\""]; + + string dst_channel = 8 [(gogoproto.moretags) = "yaml:\"dst_channel\""]; + + bytes acknowledgement = 9; +} + +// EventChannelAckPacket is a typed event emitted when packet acknowledgement is executed +message EventChannelAckPacket { + bytes data = 1; + + ibc.core.client.v1.Height timeout_height = 2 + [(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false]; + + uint64 timeout_timestamp = 3 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; + + uint64 sequence = 4; + + string src_port = 5 [(gogoproto.moretags) = "yaml:\"src_port\""]; + + string src_channel = 6 [(gogoproto.moretags) = "yaml:\"src_channel\""]; + + string dst_port = 7 [(gogoproto.moretags) = "yaml:\"dst_port\""]; + + string dst_channel = 8 [(gogoproto.moretags) = "yaml:\"dst_channel\""]; + + Order channel_ordering = 9 [(gogoproto.moretags) = "yaml:\"channel_ordering\""]; + + bytes acknowledgement = 10; +} + +// EventChannelTimeoutPacket is a typed event emitted when packet is timeout +message EventChannelTimeoutPacket { + bytes data = 1; + + ibc.core.client.v1.Height timeout_height = 2 + [(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false]; + + uint64 timeout_timestamp = 3 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; + + uint64 sequence = 4; + + string src_port = 5 [(gogoproto.moretags) = "yaml:\"src_port\""]; + + string src_channel = 6 [(gogoproto.moretags) = "yaml:\"src_channel\""]; + + string dst_port = 7 [(gogoproto.moretags) = "yaml:\"dst_port\""]; + + string dst_channel = 8 [(gogoproto.moretags) = "yaml:\"dst_channel\""]; + + Order channel_ordering = 9 [(gogoproto.moretags) = "yaml:\"channel_ordering\""]; +} diff --git a/proto/ibc/core/client/v1/events.proto b/proto/ibc/core/client/v1/events.proto new file mode 100644 index 000000000000..9ce191a067ff --- /dev/null +++ b/proto/ibc/core/client/v1/events.proto @@ -0,0 +1,57 @@ +syntax = "proto3"; +package ibc.core.client.v1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types"; + +import "gogoproto/gogo.proto"; +import "ibc/core/client/v1/client.proto"; + +// EventCreateClient is a typed event emitted on creating client +message EventCreateClient { + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + + string client_type = 2 [(gogoproto.moretags) = "yaml:\"client_type\""]; + + ibc.core.client.v1.Height consensus_height = 3 + [(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false]; +} + +// EventUpdateClient is a typed event emitted on updating client +message EventUpdateClient { + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + + string client_type = 2 [(gogoproto.moretags) = "yaml:\"client_type\""]; + + ibc.core.client.v1.Height consensus_height = 3 + [(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false]; +} + +// EventUpgradeClient is a typed event emitted on upgrading client +message EventUpgradeClient { + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + + string client_type = 2 [(gogoproto.moretags) = "yaml:\"client_type\""]; + + ibc.core.client.v1.Height consensus_height = 3 + [(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false]; +} + +// EventUpdateClientProposal is a typed event emitted on updating client proposal +message EventUpdateClientProposal { + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + + string client_type = 2 [(gogoproto.moretags) = "yaml:\"client_type\""]; + + ibc.core.client.v1.Height consensus_height = 3 + [(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false]; +} + +// EventClientMisbehaviour is a typed event emitted when misbehaviour is submitted +message EventClientMisbehaviour { + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + + string client_type = 2 [(gogoproto.moretags) = "yaml:\"client_type\""]; + + ibc.core.client.v1.Height consensus_height = 3 + [(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false]; +} diff --git a/proto/ibc/core/connection/v1/events.proto b/proto/ibc/core/connection/v1/events.proto new file mode 100644 index 000000000000..471c154859f8 --- /dev/null +++ b/proto/ibc/core/connection/v1/events.proto @@ -0,0 +1,48 @@ +syntax = "proto3"; +package ibc.core.connection.v1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/core/03-connection/types"; + +import "gogoproto/gogo.proto"; + +// EventConnectionOpenInit is a typed event emitted on connection open init +message EventConnectionOpenInit { + string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + + string client_id = 2 [(gogoproto.moretags) = "yaml:\"client_id\""]; + + string counterparty_client_id = 4 [(gogoproto.moretags) = "yaml:\"counterparty_client_id\""]; +} + +// EventConnectionOpenTry is a typed event emitted on connection open try +message EventConnectionOpenTry { + string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + + string client_id = 2 [(gogoproto.moretags) = "yaml:\"client_id\""]; + + string counterparty_connection_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_connection_id\""]; + + string counterparty_client_id = 4 [(gogoproto.moretags) = "yaml:\"counterparty_client_id\""]; +} + +// EventConnectionOpenAck is a typed event emitted on connection open acknowledgement +message EventConnectionOpenAck { + string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + + string client_id = 2 [(gogoproto.moretags) = "yaml:\"client_id\""]; + + string counterparty_connection_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_connection_id\""]; + + string counterparty_client_id = 4 [(gogoproto.moretags) = "yaml:\"counterparty_client_id\""]; +} + +// EventConnectionOpenConfirm is a typed event emitted on connection open init +message EventConnectionOpenConfirm { + string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + + string client_id = 2 [(gogoproto.moretags) = "yaml:\"client_id\""]; + + string counterparty_connection_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_connection_id\""]; + + string counterparty_client_id = 4 [(gogoproto.moretags) = "yaml:\"counterparty_client_id\""]; +} diff --git a/types/events.go b/types/events.go index 44d48d9cd5b8..89baae2c118c 100644 --- a/types/events.go +++ b/types/events.go @@ -11,6 +11,13 @@ import ( "github.com/gogo/protobuf/jsonpb" proto "github.com/gogo/protobuf/proto" abci "github.com/tendermint/tendermint/abci/types" + ctypes "github.com/tendermint/tendermint/rpc/core/types" + tmtypes "github.com/tendermint/tendermint/types" +) + +var ( + txEvents = "tm.event='Tx'" + blEvents = "tm.event='NewBlock'" ) // ---------------------------------------------------------------------------- @@ -74,13 +81,14 @@ func (em *EventManager) EmitTypedEvents(tevs ...proto.Message) error { // TypedEventToEvent takes typed event and converts to Event object func TypedEventToEvent(tev proto.Message) (Event, error) { - evtType := proto.MessageName(tev) + // Replace "." in event type with "-" to fix tm event query issue + evtType := strings.ReplaceAll(proto.MessageName(tev), ".", "-") evtJSON, err := codec.ProtoMarshalJSON(tev, nil) if err != nil { return Event{}, err } - var attrMap map[string]json.RawMessage + var attrMap map[string]interface{} err = json.Unmarshal(evtJSON, &attrMap) if err != nil { return Event{}, err @@ -88,9 +96,21 @@ func TypedEventToEvent(tev proto.Message) (Event, error) { attrs := make([]abci.EventAttribute, 0, len(attrMap)) for k, v := range attrMap { + var valueBz []byte + switch v := v.(type) { + case string: + valueBz = []byte(v) + default: + var err error + valueBz, err = json.Marshal(v) + if err != nil { + return Event{}, err + } + } + attrs = append(attrs, abci.EventAttribute{ Key: []byte(k), - Value: v, + Value: valueBz, }) } @@ -102,7 +122,9 @@ func TypedEventToEvent(tev proto.Message) (Event, error) { // ParseTypedEvent converts abci.Event back to typed event func ParseTypedEvent(event abci.Event) (proto.Message, error) { - concreteGoType := proto.MessageType(event.Type) + // Revert changes in event type name by replacing "-" with "." + evtType := strings.ReplaceAll(event.Type, "-", ".") + concreteGoType := proto.MessageType(evtType) if concreteGoType == nil { return nil, fmt.Errorf("failed to retrieve the message of type %q", event.Type) } @@ -119,9 +141,15 @@ func ParseTypedEvent(event abci.Event) (proto.Message, error) { return nil, fmt.Errorf("%q does not implement proto.Message", event.Type) } - attrMap := make(map[string]json.RawMessage) + attrMap := make(map[string]interface{}) for _, attr := range event.Attributes { - attrMap[string(attr.Key)] = attr.Value + var value interface{} + err := json.Unmarshal(attr.Value, &value) + if err != nil { + value = string(attr.Value) + } + + attrMap[string(attr.Key)] = value } attrBytes, err := json.Marshal(attrMap) @@ -137,6 +165,37 @@ func ParseTypedEvent(event abci.Event) (proto.Message, error) { return protoMsg, nil } +// ResultEventToABCIEvent takes the ctypes.ResultEvent and casts it to abci.TxResult, extracting the []abci.Event +func ResultEventToABCIEvent(rev ctypes.ResultEvent) ([]abci.Event, error) { + switch rev.Query { + case txEvents: + var txResult abci.TxResult + txResBytes, err := json.Marshal(rev.Data) + if err != nil { + return nil, err + } + if err := json.Unmarshal(txResBytes, &txResult); err != nil { + return nil, fmt.Errorf("failed to unmarshall into abci.TxResult: %s", string(txResBytes)) + } + return txResult.Result.Events, nil + case blEvents: + var blResult tmtypes.EventDataNewBlock + bl, err := json.Marshal(rev.Data) + if err != nil { + return nil, err + } + if err := json.Unmarshal(bl, &blResult); err != nil { + return nil, fmt.Errorf("failed to unmarshal into tmtypes.EventDataNewBlock: %s", string(bl)) + } + out := []abci.Event{} + out = append(out, blResult.ResultBeginBlock.Events...) + out = append(out, blResult.ResultEndBlock.Events...) + return out, nil + default: + return nil, fmt.Errorf("neither tx nor new block event: %s", rev.Query) + } +} + // ---------------------------------------------------------------------------- // Events // ---------------------------------------------------------------------------- diff --git a/types/query/query.pb.go b/types/query/query.pb.go index c04a6bde32b6..266d337002e8 100644 --- a/types/query/query.pb.go +++ b/types/query/query.pb.go @@ -783,7 +783,7 @@ type Module struct { Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` // module version Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - //checksum + // checksum Sum string `protobuf:"bytes,3,opt,name=sum,proto3" json:"sum,omitempty"` } diff --git a/x/ibc/applications/transfer/keeper/msg_server.go b/x/ibc/applications/transfer/keeper/msg_server.go index dd2999af341e..1ae750064151 100644 --- a/x/ibc/applications/transfer/keeper/msg_server.go +++ b/x/ibc/applications/transfer/keeper/msg_server.go @@ -27,17 +27,14 @@ func (k Keeper) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types. 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), - ), - }) + if err := ctx.EventManager().EmitTypedEvent( + &types.EventTransfer{ + Sender: msg.Sender, + Receiver: msg.Receiver, + }, + ); err != nil { + return nil, err + } return &types.MsgTransferResponse{}, nil } diff --git a/x/ibc/applications/transfer/keeper/relay.go b/x/ibc/applications/transfer/keeper/relay.go index 1d0f5c216649..b7ab467086b3 100644 --- a/x/ibc/applications/transfer/keeper/relay.go +++ b/x/ibc/applications/transfer/keeper/relay.go @@ -265,13 +265,14 @@ func (k Keeper) OnRecvPacket(ctx sdk.Context, packet channeltypes.Packet, data t } voucherDenom := denomTrace.IBCDenom() - ctx.EventManager().EmitEvent( - sdk.NewEvent( - types.EventTypeDenomTrace, - sdk.NewAttribute(types.AttributeKeyTraceHash, traceHash.String()), - sdk.NewAttribute(types.AttributeKeyDenom, voucherDenom), - ), - ) + if err := ctx.EventManager().EmitTypedEvent( + &types.EventDenominationTrace{ + TraceHash: traceHash.String(), + Denom: voucherDenom, + }, + ); err != nil { + return err + } voucher := sdk.NewCoin(voucherDenom, sdk.NewIntFromUint64(data.Amount)) diff --git a/x/ibc/applications/transfer/module.go b/x/ibc/applications/transfer/module.go index bf324e2c9b36..57e2e6106297 100644 --- a/x/ibc/applications/transfer/module.go +++ b/x/ibc/applications/transfer/module.go @@ -334,17 +334,6 @@ func (am AppModule) OnRecvPacket( acknowledgement = channeltypes.NewErrorAcknowledgement(err.Error()) } - ctx.EventManager().EmitEvent( - sdk.NewEvent( - types.EventTypePacket, - sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), - sdk.NewAttribute(types.AttributeKeyReceiver, data.Receiver), - sdk.NewAttribute(types.AttributeKeyDenom, data.Denom), - sdk.NewAttribute(types.AttributeKeyAmount, fmt.Sprintf("%d", data.Amount)), - sdk.NewAttribute(types.AttributeKeyAckSuccess, fmt.Sprintf("%t", err != nil)), - ), - ) - // NOTE: acknowledgement will be written synchronously during IBC handler execution. return &sdk.Result{ Events: ctx.EventManager().Events().ToABCIEvents(), @@ -370,32 +359,23 @@ func (am AppModule) OnAcknowledgementPacket( return nil, err } - ctx.EventManager().EmitEvent( - sdk.NewEvent( - types.EventTypePacket, - sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), - sdk.NewAttribute(types.AttributeKeyReceiver, data.Receiver), - sdk.NewAttribute(types.AttributeKeyDenom, data.Denom), - sdk.NewAttribute(types.AttributeKeyAmount, fmt.Sprintf("%d", data.Amount)), - sdk.NewAttribute(types.AttributeKeyAck, fmt.Sprintf("%v", ack)), - ), - ) - switch resp := ack.Response.(type) { case *channeltypes.Acknowledgement_Result: - ctx.EventManager().EmitEvent( - sdk.NewEvent( - types.EventTypePacket, - sdk.NewAttribute(types.AttributeKeyAckSuccess, string(resp.Result)), - ), - ) + if err := ctx.EventManager().EmitTypedEvent( + &types.EventAcknowledgementSuccess{ + Success: resp.Result, + }, + ); err != nil { + return nil, err + } case *channeltypes.Acknowledgement_Error: - ctx.EventManager().EmitEvent( - sdk.NewEvent( - types.EventTypePacket, - sdk.NewAttribute(types.AttributeKeyAckError, resp.Error), - ), - ) + if err := ctx.EventManager().EmitTypedEvent( + &types.EventAcknowledgementError{ + Error: resp.Error, + }, + ); err != nil { + return nil, err + } } return &sdk.Result{ @@ -417,16 +397,6 @@ func (am AppModule) OnTimeoutPacket( return nil, err } - ctx.EventManager().EmitEvent( - sdk.NewEvent( - types.EventTypeTimeout, - sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), - sdk.NewAttribute(types.AttributeKeyRefundReceiver, data.Sender), - sdk.NewAttribute(types.AttributeKeyRefundDenom, data.Denom), - sdk.NewAttribute(types.AttributeKeyRefundAmount, fmt.Sprintf("%d", data.Amount)), - ), - ) - return &sdk.Result{ Events: ctx.EventManager().Events().ToABCIEvents(), }, nil diff --git a/x/ibc/applications/transfer/spec/05_events.md b/x/ibc/applications/transfer/spec/05_events.md index 51b49da4602d..0850dbcd026c 100644 --- a/x/ibc/applications/transfer/spec/05_events.md +++ b/x/ibc/applications/transfer/spec/05_events.md @@ -6,39 +6,21 @@ order: 5 ## MsgTransfer -| Type | Attribute Key | Attribute Value | -|--------------|---------------|-----------------| -| ibc_transfer | sender | {sender} | -| ibc_transfer | receiver | {receiver} | -| message | action | transfer | -| message | module | transfer | +| Type | Attribute Key | Attribute Value | +|--------------------------------------------|---------------|-----------------| +| ibc-applications-transfer-v1-EventTransfer | sender | {sender} | +| ibc-applications-transfer-v1-EventTransfer | receiver | {receiver} | +| message | action | transfer | ## OnRecvPacket callback -| Type | Attribute Key | Attribute Value | -|-----------------------|---------------|-----------------| -| fungible_token_packet | module | transfer | -| fungible_token_packet | receiver | {receiver} | -| fungible_token_packet | denom | {denom} | -| fungible_token_packet | amount | {amount} | -| fungible_token_packet | success | {ackSuccess} | -| denomination_trace | trace_hash | {hex_hash} | +| Type | Attribute Key | Attribute Value | +|-----------------------------------------------------|---------------|-----------------| +| ibc-applications-transfer-v1-EventDenominationTrace | trace_hash | {hex_hash} | -## OnAcknowledgePacket callback +## OnAcknowledgePacket callback (emitted any one of the below events) -| Type | Attribute Key | Attribute Value | -|-----------------------|-----------------|-------------------| -| fungible_token_packet | module | transfer | -| fungible_token_packet | receiver | {receiver} | -| fungible_token_packet | denom | {denom} | -| fungible_token_packet | amount | {amount} | -| fungible_token_packet | success | error | {ack.Response} | - -## OnTimeoutPacket callback - -| Type | Attribute Key | Attribute Value | -|-----------------------|-----------------|-----------------| -| fungible_token_packet | module | transfer | -| fungible_token_packet | refund_receiver | {receiver} | -| fungible_token_packet | denom | {denom} | -| fungible_token_packet | amount | {amount} | +| Type | Attribute Key | Attribute Value | +|----------------------------------------------------------|---------------|-------------------| +| ibc-applications-transfer-v1-EventAcknowledgementSuccess | success | {ack.Response} | +| ibc-applications-transfer-v1-EventAcknowledgementError | error | {ack.Response} | diff --git a/x/ibc/applications/transfer/types/events.pb.go b/x/ibc/applications/transfer/types/events.pb.go new file mode 100644 index 000000000000..cf96d525618d --- /dev/null +++ b/x/ibc/applications/transfer/types/events.pb.go @@ -0,0 +1,958 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ibc/applications/transfer/v1/events.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// EventTransfer is a typed event emitted on ibc transfer +type EventTransfer struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Receiver string `protobuf:"bytes,2,opt,name=receiver,proto3" json:"receiver,omitempty"` +} + +func (m *EventTransfer) Reset() { *m = EventTransfer{} } +func (m *EventTransfer) String() string { return proto.CompactTextString(m) } +func (*EventTransfer) ProtoMessage() {} +func (*EventTransfer) Descriptor() ([]byte, []int) { + return fileDescriptor_0d04a14abeba54b9, []int{0} +} +func (m *EventTransfer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventTransfer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventTransfer.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 *EventTransfer) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventTransfer.Merge(m, src) +} +func (m *EventTransfer) XXX_Size() int { + return m.Size() +} +func (m *EventTransfer) XXX_DiscardUnknown() { + xxx_messageInfo_EventTransfer.DiscardUnknown(m) +} + +var xxx_messageInfo_EventTransfer proto.InternalMessageInfo + +func (m *EventTransfer) GetSender() string { + if m != nil { + return m.Sender + } + return "" +} + +func (m *EventTransfer) GetReceiver() string { + if m != nil { + return m.Receiver + } + return "" +} + +// EventAcknowledgementSuccess is a typed event emitted on packet acknowledgement success +type EventAcknowledgementSuccess struct { + Success []byte `protobuf:"bytes,1,opt,name=success,proto3" json:"success,omitempty"` +} + +func (m *EventAcknowledgementSuccess) Reset() { *m = EventAcknowledgementSuccess{} } +func (m *EventAcknowledgementSuccess) String() string { return proto.CompactTextString(m) } +func (*EventAcknowledgementSuccess) ProtoMessage() {} +func (*EventAcknowledgementSuccess) Descriptor() ([]byte, []int) { + return fileDescriptor_0d04a14abeba54b9, []int{1} +} +func (m *EventAcknowledgementSuccess) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventAcknowledgementSuccess) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventAcknowledgementSuccess.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 *EventAcknowledgementSuccess) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventAcknowledgementSuccess.Merge(m, src) +} +func (m *EventAcknowledgementSuccess) XXX_Size() int { + return m.Size() +} +func (m *EventAcknowledgementSuccess) XXX_DiscardUnknown() { + xxx_messageInfo_EventAcknowledgementSuccess.DiscardUnknown(m) +} + +var xxx_messageInfo_EventAcknowledgementSuccess proto.InternalMessageInfo + +func (m *EventAcknowledgementSuccess) GetSuccess() []byte { + if m != nil { + return m.Success + } + return nil +} + +// EventAcknowledgementError is a typed event emitted on packet acknowledgement error +type EventAcknowledgementError struct { + Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` +} + +func (m *EventAcknowledgementError) Reset() { *m = EventAcknowledgementError{} } +func (m *EventAcknowledgementError) String() string { return proto.CompactTextString(m) } +func (*EventAcknowledgementError) ProtoMessage() {} +func (*EventAcknowledgementError) Descriptor() ([]byte, []int) { + return fileDescriptor_0d04a14abeba54b9, []int{2} +} +func (m *EventAcknowledgementError) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventAcknowledgementError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventAcknowledgementError.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 *EventAcknowledgementError) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventAcknowledgementError.Merge(m, src) +} +func (m *EventAcknowledgementError) XXX_Size() int { + return m.Size() +} +func (m *EventAcknowledgementError) XXX_DiscardUnknown() { + xxx_messageInfo_EventAcknowledgementError.DiscardUnknown(m) +} + +var xxx_messageInfo_EventAcknowledgementError proto.InternalMessageInfo + +func (m *EventAcknowledgementError) GetError() string { + if m != nil { + return m.Error + } + return "" +} + +// EventDenominationTrace is a typed event for denomination trace +type EventDenominationTrace struct { + TraceHash string `protobuf:"bytes,1,opt,name=trace_hash,json=traceHash,proto3" json:"trace_hash,omitempty" yaml:"trace_hash"` + Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` +} + +func (m *EventDenominationTrace) Reset() { *m = EventDenominationTrace{} } +func (m *EventDenominationTrace) String() string { return proto.CompactTextString(m) } +func (*EventDenominationTrace) ProtoMessage() {} +func (*EventDenominationTrace) Descriptor() ([]byte, []int) { + return fileDescriptor_0d04a14abeba54b9, []int{3} +} +func (m *EventDenominationTrace) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventDenominationTrace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventDenominationTrace.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 *EventDenominationTrace) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventDenominationTrace.Merge(m, src) +} +func (m *EventDenominationTrace) XXX_Size() int { + return m.Size() +} +func (m *EventDenominationTrace) XXX_DiscardUnknown() { + xxx_messageInfo_EventDenominationTrace.DiscardUnknown(m) +} + +var xxx_messageInfo_EventDenominationTrace proto.InternalMessageInfo + +func (m *EventDenominationTrace) GetTraceHash() string { + if m != nil { + return m.TraceHash + } + return "" +} + +func (m *EventDenominationTrace) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func init() { + proto.RegisterType((*EventTransfer)(nil), "ibc.applications.transfer.v1.EventTransfer") + proto.RegisterType((*EventAcknowledgementSuccess)(nil), "ibc.applications.transfer.v1.EventAcknowledgementSuccess") + proto.RegisterType((*EventAcknowledgementError)(nil), "ibc.applications.transfer.v1.EventAcknowledgementError") + proto.RegisterType((*EventDenominationTrace)(nil), "ibc.applications.transfer.v1.EventDenominationTrace") +} + +func init() { + proto.RegisterFile("ibc/applications/transfer/v1/events.proto", fileDescriptor_0d04a14abeba54b9) +} + +var fileDescriptor_0d04a14abeba54b9 = []byte{ + // 329 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0x41, 0x4b, 0xc3, 0x30, + 0x18, 0x86, 0x57, 0xc1, 0xe9, 0x82, 0x1e, 0x2c, 0x73, 0xcc, 0x29, 0x55, 0x7a, 0xd2, 0x83, 0x0d, + 0x43, 0x41, 0xf0, 0x20, 0x38, 0x1d, 0x78, 0x9e, 0x3b, 0x88, 0x17, 0x49, 0xd3, 0xcf, 0x36, 0x6c, + 0x4d, 0x4a, 0xbe, 0xac, 0xba, 0x7f, 0xe1, 0xcf, 0xf2, 0xb8, 0xa3, 0x27, 0x91, 0xed, 0x1f, 0xf8, + 0x0b, 0xa4, 0x69, 0xa7, 0x1e, 0xf4, 0xd4, 0xf7, 0xe1, 0x7b, 0xdf, 0xb7, 0xf9, 0x12, 0x72, 0x24, + 0x42, 0x4e, 0x59, 0x96, 0x8d, 0x05, 0x67, 0x46, 0x28, 0x89, 0xd4, 0x68, 0x26, 0xf1, 0x11, 0x34, + 0xcd, 0xbb, 0x14, 0x72, 0x90, 0x06, 0x83, 0x4c, 0x2b, 0xa3, 0xdc, 0x3d, 0x11, 0xf2, 0xe0, 0xb7, + 0x35, 0x58, 0x5a, 0x83, 0xbc, 0xdb, 0x69, 0xc6, 0x2a, 0x56, 0xd6, 0x48, 0x0b, 0x55, 0x66, 0xfc, + 0x2b, 0xb2, 0xd9, 0x2f, 0x3a, 0x86, 0x95, 0xd3, 0x6d, 0x91, 0x3a, 0x82, 0x8c, 0x40, 0xb7, 0x9d, + 0x03, 0xe7, 0xb0, 0x31, 0xa8, 0xc8, 0xed, 0x90, 0x75, 0x0d, 0x1c, 0x44, 0x0e, 0xba, 0xbd, 0x62, + 0x27, 0xdf, 0xec, 0x9f, 0x91, 0x5d, 0x5b, 0x72, 0xc9, 0x47, 0x52, 0x3d, 0x8d, 0x21, 0x8a, 0x21, + 0x05, 0x69, 0x6e, 0x27, 0x9c, 0x03, 0xa2, 0xdb, 0x26, 0x6b, 0x58, 0x4a, 0xdb, 0xb9, 0x31, 0x58, + 0xa2, 0xdf, 0x25, 0x3b, 0x7f, 0x05, 0xfb, 0x5a, 0x2b, 0xed, 0x36, 0xc9, 0x2a, 0x14, 0xa2, 0x3a, + 0x48, 0x09, 0x7e, 0x44, 0x5a, 0x36, 0x72, 0x0d, 0x52, 0xa5, 0x42, 0xda, 0x45, 0x87, 0x9a, 0x71, + 0x70, 0x4f, 0x09, 0x31, 0x85, 0x78, 0x48, 0x18, 0x26, 0x65, 0xa8, 0xb7, 0xfd, 0xf9, 0xbe, 0xbf, + 0x35, 0x65, 0xe9, 0xf8, 0xdc, 0xff, 0x99, 0xf9, 0x83, 0x86, 0x85, 0x1b, 0x86, 0x49, 0xf1, 0x97, + 0xa8, 0xa8, 0xaa, 0x96, 0x2a, 0xa1, 0x77, 0xf7, 0x3a, 0xf7, 0x9c, 0xd9, 0xdc, 0x73, 0x3e, 0xe6, + 0x9e, 0xf3, 0xb2, 0xf0, 0x6a, 0xb3, 0x85, 0x57, 0x7b, 0x5b, 0x78, 0xb5, 0xfb, 0x8b, 0x58, 0x98, + 0x64, 0x12, 0x06, 0x5c, 0xa5, 0x94, 0x2b, 0x4c, 0x15, 0x56, 0x9f, 0x63, 0x8c, 0x46, 0xf4, 0x99, + 0xfe, 0xff, 0x5c, 0x66, 0x9a, 0x01, 0x86, 0x75, 0x7b, 0xef, 0x27, 0x5f, 0x01, 0x00, 0x00, 0xff, + 0xff, 0xba, 0x67, 0xe5, 0xac, 0xd8, 0x01, 0x00, 0x00, +} + +func (m *EventTransfer) 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 *EventTransfer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventTransfer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Receiver) > 0 { + i -= len(m.Receiver) + copy(dAtA[i:], m.Receiver) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Receiver))) + i-- + dAtA[i] = 0x12 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventAcknowledgementSuccess) 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 *EventAcknowledgementSuccess) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventAcknowledgementSuccess) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Success) > 0 { + i -= len(m.Success) + copy(dAtA[i:], m.Success) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Success))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventAcknowledgementError) 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 *EventAcknowledgementError) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventAcknowledgementError) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Error) > 0 { + i -= len(m.Error) + copy(dAtA[i:], m.Error) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Error))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventDenominationTrace) 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 *EventDenominationTrace) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventDenominationTrace) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0x12 + } + if len(m.TraceHash) > 0 { + i -= len(m.TraceHash) + copy(dAtA[i:], m.TraceHash) + i = encodeVarintEvents(dAtA, i, uint64(len(m.TraceHash))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { + offset -= sovEvents(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EventTransfer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.Receiver) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventAcknowledgementSuccess) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Success) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventAcknowledgementError) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Error) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventDenominationTrace) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.TraceHash) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func sovEvents(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvents(x uint64) (n int) { + return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EventTransfer) 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 ErrIntOverflowEvents + } + 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: EventTransfer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventTransfer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Receiver", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Receiver = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventAcknowledgementSuccess) 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 ErrIntOverflowEvents + } + 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: EventAcknowledgementSuccess: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventAcknowledgementSuccess: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Success", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Success = append(m.Success[:0], dAtA[iNdEx:postIndex]...) + if m.Success == nil { + m.Success = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventAcknowledgementError) 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 ErrIntOverflowEvents + } + 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: EventAcknowledgementError: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventAcknowledgementError: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Error = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventDenominationTrace) 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 ErrIntOverflowEvents + } + 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: EventDenominationTrace: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventDenominationTrace: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TraceHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TraceHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvents(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthEvents + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvents + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvents + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/ibc/core/02-client/keeper/client.go b/x/ibc/core/02-client/keeper/client.go index ddb742563c1d..0f2f54d0830b 100644 --- a/x/ibc/core/02-client/keeper/client.go +++ b/x/ibc/core/02-client/keeper/client.go @@ -93,14 +93,15 @@ func (k Keeper) UpdateClient(ctx sdk.Context, clientID string, header exported.H }() // emitting events in the keeper emits for both begin block and handler client updates - ctx.EventManager().EmitEvent( - sdk.NewEvent( - types.EventTypeUpdateClient, - sdk.NewAttribute(types.AttributeKeyClientID, clientID), - sdk.NewAttribute(types.AttributeKeyClientType, clientState.ClientType()), - sdk.NewAttribute(types.AttributeKeyConsensusHeight, consensusHeight.String()), - ), - ) + if err := ctx.EventManager().EmitTypedEvent( + &types.EventUpdateClient{ + ClientId: clientID, + ClientType: clientState.ClientType(), + ConsensusHeight: consensusHeight.(types.Height), + }, + ); err != nil { + return err + } return nil } @@ -142,14 +143,15 @@ func (k Keeper) UpgradeClient(ctx sdk.Context, clientID string, upgradedClient e }() // emitting events in the keeper emits for client upgrades - ctx.EventManager().EmitEvent( - sdk.NewEvent( - types.EventTypeUpgradeClient, - sdk.NewAttribute(types.AttributeKeyClientID, clientID), - sdk.NewAttribute(types.AttributeKeyClientType, updatedClientState.ClientType()), - sdk.NewAttribute(types.AttributeKeyConsensusHeight, updatedClientState.GetLatestHeight().String()), - ), - ) + if err := ctx.EventManager().EmitTypedEvent( + &types.EventUpgradeClient{ + ClientId: clientID, + ClientType: updatedClientState.ClientType(), + ConsensusHeight: updatedClientState.GetLatestHeight().(types.Height), + }, + ); err != nil { + return err + } return nil } diff --git a/x/ibc/core/02-client/keeper/proposal.go b/x/ibc/core/02-client/keeper/proposal.go index 6b17278e09dd..9c1b8aa2e9da 100644 --- a/x/ibc/core/02-client/keeper/proposal.go +++ b/x/ibc/core/02-client/keeper/proposal.go @@ -50,14 +50,15 @@ func (k Keeper) ClientUpdateProposal(ctx sdk.Context, p *types.ClientUpdatePropo }() // emitting events in the keeper for proposal updates to clients - ctx.EventManager().EmitEvent( - sdk.NewEvent( - types.EventTypeUpdateClientProposal, - sdk.NewAttribute(types.AttributeKeyClientID, p.ClientId), - sdk.NewAttribute(types.AttributeKeyClientType, clientState.ClientType()), - sdk.NewAttribute(types.AttributeKeyConsensusHeight, header.GetHeight().String()), - ), - ) + if err := ctx.EventManager().EmitTypedEvent( + &types.EventUpdateClientProposal{ + ClientId: p.ClientId, + ClientType: clientState.ClientType(), + ConsensusHeight: header.GetHeight().(types.Height), + }, + ); err != nil { + return err + } return nil } diff --git a/x/ibc/core/02-client/types/events.pb.go b/x/ibc/core/02-client/types/events.pb.go new file mode 100644 index 000000000000..f1353e4958e9 --- /dev/null +++ b/x/ibc/core/02-client/types/events.pb.go @@ -0,0 +1,1548 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ibc/core/client/v1/events.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// EventCreateClient is a typed event emitted on creating client +type EventCreateClient struct { + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` + ClientType string `protobuf:"bytes,2,opt,name=client_type,json=clientType,proto3" json:"client_type,omitempty" yaml:"client_type"` + ConsensusHeight Height `protobuf:"bytes,3,opt,name=consensus_height,json=consensusHeight,proto3" json:"consensus_height" yaml:"consensus_height"` +} + +func (m *EventCreateClient) Reset() { *m = EventCreateClient{} } +func (m *EventCreateClient) String() string { return proto.CompactTextString(m) } +func (*EventCreateClient) ProtoMessage() {} +func (*EventCreateClient) Descriptor() ([]byte, []int) { + return fileDescriptor_3279dcdded75b691, []int{0} +} +func (m *EventCreateClient) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventCreateClient) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventCreateClient.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 *EventCreateClient) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventCreateClient.Merge(m, src) +} +func (m *EventCreateClient) XXX_Size() int { + return m.Size() +} +func (m *EventCreateClient) XXX_DiscardUnknown() { + xxx_messageInfo_EventCreateClient.DiscardUnknown(m) +} + +var xxx_messageInfo_EventCreateClient proto.InternalMessageInfo + +func (m *EventCreateClient) GetClientId() string { + if m != nil { + return m.ClientId + } + return "" +} + +func (m *EventCreateClient) GetClientType() string { + if m != nil { + return m.ClientType + } + return "" +} + +func (m *EventCreateClient) GetConsensusHeight() Height { + if m != nil { + return m.ConsensusHeight + } + return Height{} +} + +// EventUpdateClient is a typed event emitted on updating client +type EventUpdateClient struct { + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` + ClientType string `protobuf:"bytes,2,opt,name=client_type,json=clientType,proto3" json:"client_type,omitempty" yaml:"client_type"` + ConsensusHeight Height `protobuf:"bytes,3,opt,name=consensus_height,json=consensusHeight,proto3" json:"consensus_height" yaml:"consensus_height"` +} + +func (m *EventUpdateClient) Reset() { *m = EventUpdateClient{} } +func (m *EventUpdateClient) String() string { return proto.CompactTextString(m) } +func (*EventUpdateClient) ProtoMessage() {} +func (*EventUpdateClient) Descriptor() ([]byte, []int) { + return fileDescriptor_3279dcdded75b691, []int{1} +} +func (m *EventUpdateClient) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventUpdateClient) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventUpdateClient.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 *EventUpdateClient) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventUpdateClient.Merge(m, src) +} +func (m *EventUpdateClient) XXX_Size() int { + return m.Size() +} +func (m *EventUpdateClient) XXX_DiscardUnknown() { + xxx_messageInfo_EventUpdateClient.DiscardUnknown(m) +} + +var xxx_messageInfo_EventUpdateClient proto.InternalMessageInfo + +func (m *EventUpdateClient) GetClientId() string { + if m != nil { + return m.ClientId + } + return "" +} + +func (m *EventUpdateClient) GetClientType() string { + if m != nil { + return m.ClientType + } + return "" +} + +func (m *EventUpdateClient) GetConsensusHeight() Height { + if m != nil { + return m.ConsensusHeight + } + return Height{} +} + +// EventUpgradeClient is a typed event emitted on upgrading client +type EventUpgradeClient struct { + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` + ClientType string `protobuf:"bytes,2,opt,name=client_type,json=clientType,proto3" json:"client_type,omitempty" yaml:"client_type"` + ConsensusHeight Height `protobuf:"bytes,3,opt,name=consensus_height,json=consensusHeight,proto3" json:"consensus_height" yaml:"consensus_height"` +} + +func (m *EventUpgradeClient) Reset() { *m = EventUpgradeClient{} } +func (m *EventUpgradeClient) String() string { return proto.CompactTextString(m) } +func (*EventUpgradeClient) ProtoMessage() {} +func (*EventUpgradeClient) Descriptor() ([]byte, []int) { + return fileDescriptor_3279dcdded75b691, []int{2} +} +func (m *EventUpgradeClient) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventUpgradeClient) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventUpgradeClient.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 *EventUpgradeClient) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventUpgradeClient.Merge(m, src) +} +func (m *EventUpgradeClient) XXX_Size() int { + return m.Size() +} +func (m *EventUpgradeClient) XXX_DiscardUnknown() { + xxx_messageInfo_EventUpgradeClient.DiscardUnknown(m) +} + +var xxx_messageInfo_EventUpgradeClient proto.InternalMessageInfo + +func (m *EventUpgradeClient) GetClientId() string { + if m != nil { + return m.ClientId + } + return "" +} + +func (m *EventUpgradeClient) GetClientType() string { + if m != nil { + return m.ClientType + } + return "" +} + +func (m *EventUpgradeClient) GetConsensusHeight() Height { + if m != nil { + return m.ConsensusHeight + } + return Height{} +} + +// EventUpdateClientProposal is a typed event emitted on updating client proposal +type EventUpdateClientProposal struct { + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` + ClientType string `protobuf:"bytes,2,opt,name=client_type,json=clientType,proto3" json:"client_type,omitempty" yaml:"client_type"` + ConsensusHeight Height `protobuf:"bytes,3,opt,name=consensus_height,json=consensusHeight,proto3" json:"consensus_height" yaml:"consensus_height"` +} + +func (m *EventUpdateClientProposal) Reset() { *m = EventUpdateClientProposal{} } +func (m *EventUpdateClientProposal) String() string { return proto.CompactTextString(m) } +func (*EventUpdateClientProposal) ProtoMessage() {} +func (*EventUpdateClientProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_3279dcdded75b691, []int{3} +} +func (m *EventUpdateClientProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventUpdateClientProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventUpdateClientProposal.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 *EventUpdateClientProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventUpdateClientProposal.Merge(m, src) +} +func (m *EventUpdateClientProposal) XXX_Size() int { + return m.Size() +} +func (m *EventUpdateClientProposal) XXX_DiscardUnknown() { + xxx_messageInfo_EventUpdateClientProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_EventUpdateClientProposal proto.InternalMessageInfo + +func (m *EventUpdateClientProposal) GetClientId() string { + if m != nil { + return m.ClientId + } + return "" +} + +func (m *EventUpdateClientProposal) GetClientType() string { + if m != nil { + return m.ClientType + } + return "" +} + +func (m *EventUpdateClientProposal) GetConsensusHeight() Height { + if m != nil { + return m.ConsensusHeight + } + return Height{} +} + +// EventClientMisbehaviour is a typed event emitted when misbehaviour is submitted +type EventClientMisbehaviour struct { + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` + ClientType string `protobuf:"bytes,2,opt,name=client_type,json=clientType,proto3" json:"client_type,omitempty" yaml:"client_type"` + ConsensusHeight Height `protobuf:"bytes,3,opt,name=consensus_height,json=consensusHeight,proto3" json:"consensus_height" yaml:"consensus_height"` +} + +func (m *EventClientMisbehaviour) Reset() { *m = EventClientMisbehaviour{} } +func (m *EventClientMisbehaviour) String() string { return proto.CompactTextString(m) } +func (*EventClientMisbehaviour) ProtoMessage() {} +func (*EventClientMisbehaviour) Descriptor() ([]byte, []int) { + return fileDescriptor_3279dcdded75b691, []int{4} +} +func (m *EventClientMisbehaviour) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventClientMisbehaviour) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventClientMisbehaviour.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 *EventClientMisbehaviour) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventClientMisbehaviour.Merge(m, src) +} +func (m *EventClientMisbehaviour) XXX_Size() int { + return m.Size() +} +func (m *EventClientMisbehaviour) XXX_DiscardUnknown() { + xxx_messageInfo_EventClientMisbehaviour.DiscardUnknown(m) +} + +var xxx_messageInfo_EventClientMisbehaviour proto.InternalMessageInfo + +func (m *EventClientMisbehaviour) GetClientId() string { + if m != nil { + return m.ClientId + } + return "" +} + +func (m *EventClientMisbehaviour) GetClientType() string { + if m != nil { + return m.ClientType + } + return "" +} + +func (m *EventClientMisbehaviour) GetConsensusHeight() Height { + if m != nil { + return m.ConsensusHeight + } + return Height{} +} + +func init() { + proto.RegisterType((*EventCreateClient)(nil), "ibc.core.client.v1.EventCreateClient") + proto.RegisterType((*EventUpdateClient)(nil), "ibc.core.client.v1.EventUpdateClient") + proto.RegisterType((*EventUpgradeClient)(nil), "ibc.core.client.v1.EventUpgradeClient") + proto.RegisterType((*EventUpdateClientProposal)(nil), "ibc.core.client.v1.EventUpdateClientProposal") + proto.RegisterType((*EventClientMisbehaviour)(nil), "ibc.core.client.v1.EventClientMisbehaviour") +} + +func init() { proto.RegisterFile("ibc/core/client/v1/events.proto", fileDescriptor_3279dcdded75b691) } + +var fileDescriptor_3279dcdded75b691 = []byte{ + // 367 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x94, 0xcd, 0x4a, 0xeb, 0x40, + 0x14, 0xc7, 0x33, 0xf7, 0xc2, 0xe5, 0x76, 0xba, 0xb8, 0xbd, 0xa1, 0xd8, 0xda, 0x45, 0x52, 0xb2, + 0xea, 0xa6, 0x33, 0xb6, 0x2e, 0x0a, 0x2e, 0x5b, 0x04, 0x5d, 0x08, 0x5a, 0x74, 0xe3, 0xa6, 0x24, + 0x93, 0x31, 0x19, 0x6c, 0x33, 0x21, 0x33, 0x0d, 0xf6, 0x2d, 0x7c, 0xac, 0x2e, 0xbb, 0x74, 0x15, + 0xa4, 0x5d, 0xe8, 0x46, 0x84, 0x3e, 0x81, 0x64, 0x26, 0x54, 0xb4, 0x3e, 0x41, 0x56, 0x39, 0x39, + 0xff, 0x0f, 0xf8, 0x11, 0x72, 0xa0, 0xcd, 0x3c, 0x82, 0x09, 0x4f, 0x28, 0x26, 0x53, 0x46, 0x23, + 0x89, 0xd3, 0x1e, 0xa6, 0x29, 0x8d, 0xa4, 0x40, 0x71, 0xc2, 0x25, 0x37, 0x4d, 0xe6, 0x11, 0x94, + 0x1b, 0x90, 0x36, 0xa0, 0xb4, 0xd7, 0xaa, 0x07, 0x3c, 0xe0, 0x4a, 0xc6, 0xf9, 0xa4, 0x9d, 0xad, + 0x9f, 0xaa, 0x8a, 0x8c, 0x32, 0x38, 0x2f, 0x00, 0xfe, 0x3f, 0xcd, 0xbb, 0x47, 0x09, 0x75, 0x25, + 0x1d, 0x29, 0xcd, 0xec, 0xc1, 0x8a, 0x76, 0x4d, 0x98, 0xdf, 0x04, 0x6d, 0xd0, 0xa9, 0x0c, 0xeb, + 0xdb, 0xcc, 0xae, 0x2d, 0xdc, 0xd9, 0xf4, 0xc4, 0xd9, 0x49, 0xce, 0xf8, 0xaf, 0x9e, 0xcf, 0x7d, + 0x73, 0x00, 0xab, 0xc5, 0x5e, 0x2e, 0x62, 0xda, 0xfc, 0xa5, 0x42, 0x07, 0xdb, 0xcc, 0x36, 0xbf, + 0x84, 0x72, 0xd1, 0x19, 0x43, 0xfd, 0x76, 0xbd, 0x88, 0xa9, 0x79, 0x07, 0x6b, 0x84, 0x47, 0x82, + 0x46, 0x62, 0x2e, 0x26, 0x21, 0x65, 0x41, 0x28, 0x9b, 0xbf, 0xdb, 0xa0, 0x53, 0xed, 0xb7, 0xd0, + 0x3e, 0x27, 0x3a, 0x53, 0x8e, 0xa1, 0xbd, 0xcc, 0x6c, 0x63, 0x9b, 0xd9, 0x8d, 0xa2, 0xfd, 0x5b, + 0x83, 0x33, 0xfe, 0xb7, 0x5b, 0xe9, 0xc4, 0x27, 0xe9, 0x4d, 0xec, 0x97, 0x9b, 0xf4, 0x15, 0x40, + 0xb3, 0x20, 0x0d, 0x12, 0xd7, 0x2f, 0x33, 0xea, 0x3b, 0x80, 0x87, 0x7b, 0x1f, 0xf5, 0x32, 0xe1, + 0x31, 0x17, 0xee, 0xb4, 0x94, 0xc4, 0x6f, 0x00, 0x36, 0xf4, 0x0f, 0xab, 0xba, 0x2e, 0x98, 0xf0, + 0x68, 0xe8, 0xa6, 0x8c, 0xcf, 0x93, 0x32, 0xf2, 0x0e, 0xaf, 0x96, 0x6b, 0x0b, 0xac, 0xd6, 0x16, + 0x78, 0x5e, 0x5b, 0xe0, 0x71, 0x63, 0x19, 0xab, 0x8d, 0x65, 0x3c, 0x6d, 0x2c, 0xe3, 0x76, 0x10, + 0x30, 0x19, 0xce, 0x3d, 0x44, 0xf8, 0x0c, 0x13, 0x2e, 0x66, 0x5c, 0x14, 0x8f, 0xae, 0xf0, 0xef, + 0xf1, 0x03, 0xde, 0x9d, 0xbe, 0xa3, 0x7e, 0xb7, 0xb8, 0x7e, 0x39, 0x86, 0xf0, 0xfe, 0xa8, 0xd3, + 0x77, 0xfc, 0x11, 0x00, 0x00, 0xff, 0xff, 0xb0, 0xa8, 0x1e, 0x9f, 0x68, 0x05, 0x00, 0x00, +} + +func (m *EventCreateClient) 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 *EventCreateClient) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventCreateClient) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.ConsensusHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.ClientType) > 0 { + i -= len(m.ClientType) + copy(dAtA[i:], m.ClientType) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ClientType))) + i-- + dAtA[i] = 0x12 + } + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventUpdateClient) 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 *EventUpdateClient) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventUpdateClient) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.ConsensusHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.ClientType) > 0 { + i -= len(m.ClientType) + copy(dAtA[i:], m.ClientType) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ClientType))) + i-- + dAtA[i] = 0x12 + } + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventUpgradeClient) 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 *EventUpgradeClient) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventUpgradeClient) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.ConsensusHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.ClientType) > 0 { + i -= len(m.ClientType) + copy(dAtA[i:], m.ClientType) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ClientType))) + i-- + dAtA[i] = 0x12 + } + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventUpdateClientProposal) 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 *EventUpdateClientProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventUpdateClientProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.ConsensusHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.ClientType) > 0 { + i -= len(m.ClientType) + copy(dAtA[i:], m.ClientType) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ClientType))) + i-- + dAtA[i] = 0x12 + } + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventClientMisbehaviour) 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 *EventClientMisbehaviour) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventClientMisbehaviour) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.ConsensusHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.ClientType) > 0 { + i -= len(m.ClientType) + copy(dAtA[i:], m.ClientType) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ClientType))) + i-- + dAtA[i] = 0x12 + } + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { + offset -= sovEvents(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EventCreateClient) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.ClientType) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = m.ConsensusHeight.Size() + n += 1 + l + sovEvents(uint64(l)) + return n +} + +func (m *EventUpdateClient) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.ClientType) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = m.ConsensusHeight.Size() + n += 1 + l + sovEvents(uint64(l)) + return n +} + +func (m *EventUpgradeClient) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.ClientType) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = m.ConsensusHeight.Size() + n += 1 + l + sovEvents(uint64(l)) + return n +} + +func (m *EventUpdateClientProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.ClientType) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = m.ConsensusHeight.Size() + n += 1 + l + sovEvents(uint64(l)) + return n +} + +func (m *EventClientMisbehaviour) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.ClientType) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = m.ConsensusHeight.Size() + n += 1 + l + sovEvents(uint64(l)) + return n +} + +func sovEvents(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvents(x uint64) (n int) { + return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EventCreateClient) 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 ErrIntOverflowEvents + } + 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: EventCreateClient: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventCreateClient: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ConsensusHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventUpdateClient) 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 ErrIntOverflowEvents + } + 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: EventUpdateClient: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventUpdateClient: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ConsensusHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventUpgradeClient) 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 ErrIntOverflowEvents + } + 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: EventUpgradeClient: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventUpgradeClient: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ConsensusHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventUpdateClientProposal) 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 ErrIntOverflowEvents + } + 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: EventUpdateClientProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventUpdateClientProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ConsensusHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventClientMisbehaviour) 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 ErrIntOverflowEvents + } + 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: EventClientMisbehaviour: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventClientMisbehaviour: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ConsensusHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvents(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthEvents + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvents + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvents + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/ibc/core/03-connection/types/events.pb.go b/x/ibc/core/03-connection/types/events.pb.go new file mode 100644 index 000000000000..6ee2b7d0abd3 --- /dev/null +++ b/x/ibc/core/03-connection/types/events.pb.go @@ -0,0 +1,1417 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ibc/core/connection/v1/events.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// EventConnectionOpenInit is a typed event emitted on connection open init +type EventConnectionOpenInit struct { + ConnectionId string `protobuf:"bytes,1,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" yaml:"connection_id"` + ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` + CounterpartyClientId string `protobuf:"bytes,4,opt,name=counterparty_client_id,json=counterpartyClientId,proto3" json:"counterparty_client_id,omitempty" yaml:"counterparty_client_id"` +} + +func (m *EventConnectionOpenInit) Reset() { *m = EventConnectionOpenInit{} } +func (m *EventConnectionOpenInit) String() string { return proto.CompactTextString(m) } +func (*EventConnectionOpenInit) ProtoMessage() {} +func (*EventConnectionOpenInit) Descriptor() ([]byte, []int) { + return fileDescriptor_407d31e4511baa72, []int{0} +} +func (m *EventConnectionOpenInit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventConnectionOpenInit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventConnectionOpenInit.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 *EventConnectionOpenInit) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventConnectionOpenInit.Merge(m, src) +} +func (m *EventConnectionOpenInit) XXX_Size() int { + return m.Size() +} +func (m *EventConnectionOpenInit) XXX_DiscardUnknown() { + xxx_messageInfo_EventConnectionOpenInit.DiscardUnknown(m) +} + +var xxx_messageInfo_EventConnectionOpenInit proto.InternalMessageInfo + +func (m *EventConnectionOpenInit) GetConnectionId() string { + if m != nil { + return m.ConnectionId + } + return "" +} + +func (m *EventConnectionOpenInit) GetClientId() string { + if m != nil { + return m.ClientId + } + return "" +} + +func (m *EventConnectionOpenInit) GetCounterpartyClientId() string { + if m != nil { + return m.CounterpartyClientId + } + return "" +} + +// EventConnectionOpenTry is a typed event emitted on connection open try +type EventConnectionOpenTry struct { + ConnectionId string `protobuf:"bytes,1,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" yaml:"connection_id"` + ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` + CounterpartyConnectionId string `protobuf:"bytes,3,opt,name=counterparty_connection_id,json=counterpartyConnectionId,proto3" json:"counterparty_connection_id,omitempty" yaml:"counterparty_connection_id"` + CounterpartyClientId string `protobuf:"bytes,4,opt,name=counterparty_client_id,json=counterpartyClientId,proto3" json:"counterparty_client_id,omitempty" yaml:"counterparty_client_id"` +} + +func (m *EventConnectionOpenTry) Reset() { *m = EventConnectionOpenTry{} } +func (m *EventConnectionOpenTry) String() string { return proto.CompactTextString(m) } +func (*EventConnectionOpenTry) ProtoMessage() {} +func (*EventConnectionOpenTry) Descriptor() ([]byte, []int) { + return fileDescriptor_407d31e4511baa72, []int{1} +} +func (m *EventConnectionOpenTry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventConnectionOpenTry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventConnectionOpenTry.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 *EventConnectionOpenTry) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventConnectionOpenTry.Merge(m, src) +} +func (m *EventConnectionOpenTry) XXX_Size() int { + return m.Size() +} +func (m *EventConnectionOpenTry) XXX_DiscardUnknown() { + xxx_messageInfo_EventConnectionOpenTry.DiscardUnknown(m) +} + +var xxx_messageInfo_EventConnectionOpenTry proto.InternalMessageInfo + +func (m *EventConnectionOpenTry) GetConnectionId() string { + if m != nil { + return m.ConnectionId + } + return "" +} + +func (m *EventConnectionOpenTry) GetClientId() string { + if m != nil { + return m.ClientId + } + return "" +} + +func (m *EventConnectionOpenTry) GetCounterpartyConnectionId() string { + if m != nil { + return m.CounterpartyConnectionId + } + return "" +} + +func (m *EventConnectionOpenTry) GetCounterpartyClientId() string { + if m != nil { + return m.CounterpartyClientId + } + return "" +} + +// EventConnectionOpenAck is a typed event emitted on connection open acknowledgement +type EventConnectionOpenAck struct { + ConnectionId string `protobuf:"bytes,1,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" yaml:"connection_id"` + ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` + CounterpartyConnectionId string `protobuf:"bytes,3,opt,name=counterparty_connection_id,json=counterpartyConnectionId,proto3" json:"counterparty_connection_id,omitempty" yaml:"counterparty_connection_id"` + CounterpartyClientId string `protobuf:"bytes,4,opt,name=counterparty_client_id,json=counterpartyClientId,proto3" json:"counterparty_client_id,omitempty" yaml:"counterparty_client_id"` +} + +func (m *EventConnectionOpenAck) Reset() { *m = EventConnectionOpenAck{} } +func (m *EventConnectionOpenAck) String() string { return proto.CompactTextString(m) } +func (*EventConnectionOpenAck) ProtoMessage() {} +func (*EventConnectionOpenAck) Descriptor() ([]byte, []int) { + return fileDescriptor_407d31e4511baa72, []int{2} +} +func (m *EventConnectionOpenAck) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventConnectionOpenAck) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventConnectionOpenAck.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 *EventConnectionOpenAck) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventConnectionOpenAck.Merge(m, src) +} +func (m *EventConnectionOpenAck) XXX_Size() int { + return m.Size() +} +func (m *EventConnectionOpenAck) XXX_DiscardUnknown() { + xxx_messageInfo_EventConnectionOpenAck.DiscardUnknown(m) +} + +var xxx_messageInfo_EventConnectionOpenAck proto.InternalMessageInfo + +func (m *EventConnectionOpenAck) GetConnectionId() string { + if m != nil { + return m.ConnectionId + } + return "" +} + +func (m *EventConnectionOpenAck) GetClientId() string { + if m != nil { + return m.ClientId + } + return "" +} + +func (m *EventConnectionOpenAck) GetCounterpartyConnectionId() string { + if m != nil { + return m.CounterpartyConnectionId + } + return "" +} + +func (m *EventConnectionOpenAck) GetCounterpartyClientId() string { + if m != nil { + return m.CounterpartyClientId + } + return "" +} + +// EventConnectionOpenConfirm is a typed event emitted on connection open init +type EventConnectionOpenConfirm struct { + ConnectionId string `protobuf:"bytes,1,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" yaml:"connection_id"` + ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` + CounterpartyConnectionId string `protobuf:"bytes,3,opt,name=counterparty_connection_id,json=counterpartyConnectionId,proto3" json:"counterparty_connection_id,omitempty" yaml:"counterparty_connection_id"` + CounterpartyClientId string `protobuf:"bytes,4,opt,name=counterparty_client_id,json=counterpartyClientId,proto3" json:"counterparty_client_id,omitempty" yaml:"counterparty_client_id"` +} + +func (m *EventConnectionOpenConfirm) Reset() { *m = EventConnectionOpenConfirm{} } +func (m *EventConnectionOpenConfirm) String() string { return proto.CompactTextString(m) } +func (*EventConnectionOpenConfirm) ProtoMessage() {} +func (*EventConnectionOpenConfirm) Descriptor() ([]byte, []int) { + return fileDescriptor_407d31e4511baa72, []int{3} +} +func (m *EventConnectionOpenConfirm) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventConnectionOpenConfirm) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventConnectionOpenConfirm.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 *EventConnectionOpenConfirm) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventConnectionOpenConfirm.Merge(m, src) +} +func (m *EventConnectionOpenConfirm) XXX_Size() int { + return m.Size() +} +func (m *EventConnectionOpenConfirm) XXX_DiscardUnknown() { + xxx_messageInfo_EventConnectionOpenConfirm.DiscardUnknown(m) +} + +var xxx_messageInfo_EventConnectionOpenConfirm proto.InternalMessageInfo + +func (m *EventConnectionOpenConfirm) GetConnectionId() string { + if m != nil { + return m.ConnectionId + } + return "" +} + +func (m *EventConnectionOpenConfirm) GetClientId() string { + if m != nil { + return m.ClientId + } + return "" +} + +func (m *EventConnectionOpenConfirm) GetCounterpartyConnectionId() string { + if m != nil { + return m.CounterpartyConnectionId + } + return "" +} + +func (m *EventConnectionOpenConfirm) GetCounterpartyClientId() string { + if m != nil { + return m.CounterpartyClientId + } + return "" +} + +func init() { + proto.RegisterType((*EventConnectionOpenInit)(nil), "ibc.core.connection.v1.EventConnectionOpenInit") + proto.RegisterType((*EventConnectionOpenTry)(nil), "ibc.core.connection.v1.EventConnectionOpenTry") + proto.RegisterType((*EventConnectionOpenAck)(nil), "ibc.core.connection.v1.EventConnectionOpenAck") + proto.RegisterType((*EventConnectionOpenConfirm)(nil), "ibc.core.connection.v1.EventConnectionOpenConfirm") +} + +func init() { + proto.RegisterFile("ibc/core/connection/v1/events.proto", fileDescriptor_407d31e4511baa72) +} + +var fileDescriptor_407d31e4511baa72 = []byte{ + // 358 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xce, 0x4c, 0x4a, 0xd6, + 0x4f, 0xce, 0x2f, 0x4a, 0xd5, 0x4f, 0xce, 0xcf, 0xcb, 0x4b, 0x4d, 0x2e, 0xc9, 0xcc, 0xcf, 0xd3, + 0x2f, 0x33, 0xd4, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0x29, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, + 0x12, 0xcb, 0x4c, 0x4a, 0xd6, 0x03, 0x29, 0xd2, 0x43, 0x28, 0xd2, 0x2b, 0x33, 0x94, 0x12, 0x49, + 0xcf, 0x4f, 0xcf, 0x07, 0x2b, 0xd1, 0x07, 0xb1, 0x20, 0xaa, 0x95, 0x9e, 0x30, 0x72, 0x89, 0xbb, + 0x82, 0xb4, 0x3b, 0xc3, 0x15, 0xfb, 0x17, 0xa4, 0xe6, 0x79, 0xe6, 0x65, 0x96, 0x08, 0xd9, 0x72, + 0xf1, 0x22, 0x8c, 0x88, 0xcf, 0x4c, 0x91, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x74, 0x92, 0xf8, 0x74, + 0x4f, 0x5e, 0xa4, 0x32, 0x31, 0x37, 0xc7, 0x4a, 0x09, 0x45, 0x5a, 0x29, 0x88, 0x07, 0xc1, 0xf7, + 0x4c, 0x11, 0x32, 0xe4, 0xe2, 0x4c, 0xce, 0xc9, 0x4c, 0xcd, 0x2b, 0x01, 0x69, 0x65, 0x02, 0x6b, + 0x15, 0xf9, 0x74, 0x4f, 0x5e, 0x00, 0xaa, 0x15, 0x26, 0xa5, 0x14, 0xc4, 0x01, 0x61, 0x7b, 0xa6, + 0x08, 0x85, 0x73, 0x89, 0x25, 0xe7, 0x97, 0xe6, 0x95, 0xa4, 0x16, 0x15, 0x24, 0x16, 0x95, 0x54, + 0xc6, 0x23, 0xf4, 0xb3, 0x80, 0xf5, 0x2b, 0x7e, 0xba, 0x27, 0x2f, 0x0b, 0xb3, 0x1a, 0x9b, 0x3a, + 0xa5, 0x20, 0x11, 0x64, 0x09, 0x67, 0xa8, 0xc1, 0x4a, 0x27, 0x98, 0xb8, 0xc4, 0xb0, 0x78, 0x33, + 0xa4, 0xa8, 0x72, 0x00, 0x7c, 0x99, 0xcc, 0x25, 0x85, 0xea, 0x7a, 0x14, 0xeb, 0x99, 0xc1, 0x66, + 0xa8, 0x7e, 0xba, 0x27, 0xaf, 0x88, 0xcd, 0xa7, 0xa8, 0x6e, 0x91, 0x40, 0xf1, 0x2d, 0xb2, 0xbb, + 0xe8, 0x1d, 0x94, 0x8e, 0xc9, 0xd9, 0xa3, 0x41, 0x49, 0x62, 0x50, 0x9e, 0x61, 0xe2, 0x92, 0xc2, + 0x12, 0x94, 0xce, 0xf9, 0x79, 0x69, 0x99, 0x45, 0xb9, 0xa3, 0xc1, 0x49, 0x5a, 0x70, 0x3a, 0x85, + 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, + 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x75, 0x7a, 0x66, 0x49, 0x46, + 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x72, 0x7e, 0x71, 0x6e, 0x7e, 0x31, 0x94, 0xd2, 0x2d, + 0x4e, 0xc9, 0xd6, 0xaf, 0xd0, 0x87, 0x97, 0xab, 0x06, 0xc6, 0xba, 0x48, 0x45, 0x6b, 0x49, 0x65, + 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xb8, 0xa4, 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x31, 0xb5, + 0x86, 0xfd, 0x7e, 0x05, 0x00, 0x00, +} + +func (m *EventConnectionOpenInit) 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 *EventConnectionOpenInit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventConnectionOpenInit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CounterpartyClientId) > 0 { + i -= len(m.CounterpartyClientId) + copy(dAtA[i:], m.CounterpartyClientId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.CounterpartyClientId))) + i-- + dAtA[i] = 0x22 + } + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0x12 + } + if len(m.ConnectionId) > 0 { + i -= len(m.ConnectionId) + copy(dAtA[i:], m.ConnectionId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ConnectionId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventConnectionOpenTry) 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 *EventConnectionOpenTry) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventConnectionOpenTry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CounterpartyClientId) > 0 { + i -= len(m.CounterpartyClientId) + copy(dAtA[i:], m.CounterpartyClientId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.CounterpartyClientId))) + i-- + dAtA[i] = 0x22 + } + if len(m.CounterpartyConnectionId) > 0 { + i -= len(m.CounterpartyConnectionId) + copy(dAtA[i:], m.CounterpartyConnectionId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.CounterpartyConnectionId))) + i-- + dAtA[i] = 0x1a + } + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0x12 + } + if len(m.ConnectionId) > 0 { + i -= len(m.ConnectionId) + copy(dAtA[i:], m.ConnectionId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ConnectionId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventConnectionOpenAck) 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 *EventConnectionOpenAck) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventConnectionOpenAck) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CounterpartyClientId) > 0 { + i -= len(m.CounterpartyClientId) + copy(dAtA[i:], m.CounterpartyClientId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.CounterpartyClientId))) + i-- + dAtA[i] = 0x22 + } + if len(m.CounterpartyConnectionId) > 0 { + i -= len(m.CounterpartyConnectionId) + copy(dAtA[i:], m.CounterpartyConnectionId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.CounterpartyConnectionId))) + i-- + dAtA[i] = 0x1a + } + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0x12 + } + if len(m.ConnectionId) > 0 { + i -= len(m.ConnectionId) + copy(dAtA[i:], m.ConnectionId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ConnectionId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventConnectionOpenConfirm) 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 *EventConnectionOpenConfirm) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventConnectionOpenConfirm) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CounterpartyClientId) > 0 { + i -= len(m.CounterpartyClientId) + copy(dAtA[i:], m.CounterpartyClientId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.CounterpartyClientId))) + i-- + dAtA[i] = 0x22 + } + if len(m.CounterpartyConnectionId) > 0 { + i -= len(m.CounterpartyConnectionId) + copy(dAtA[i:], m.CounterpartyConnectionId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.CounterpartyConnectionId))) + i-- + dAtA[i] = 0x1a + } + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0x12 + } + if len(m.ConnectionId) > 0 { + i -= len(m.ConnectionId) + copy(dAtA[i:], m.ConnectionId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ConnectionId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { + offset -= sovEvents(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EventConnectionOpenInit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ConnectionId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.CounterpartyClientId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventConnectionOpenTry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ConnectionId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.CounterpartyConnectionId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.CounterpartyClientId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventConnectionOpenAck) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ConnectionId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.CounterpartyConnectionId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.CounterpartyClientId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventConnectionOpenConfirm) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ConnectionId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.CounterpartyConnectionId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.CounterpartyClientId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func sovEvents(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvents(x uint64) (n int) { + return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EventConnectionOpenInit) 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 ErrIntOverflowEvents + } + 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: EventConnectionOpenInit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventConnectionOpenInit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConnectionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyClientId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterpartyClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventConnectionOpenTry) 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 ErrIntOverflowEvents + } + 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: EventConnectionOpenTry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventConnectionOpenTry: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConnectionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyConnectionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterpartyConnectionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyClientId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterpartyClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventConnectionOpenAck) 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 ErrIntOverflowEvents + } + 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: EventConnectionOpenAck: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventConnectionOpenAck: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConnectionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyConnectionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterpartyConnectionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyClientId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterpartyClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventConnectionOpenConfirm) 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 ErrIntOverflowEvents + } + 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: EventConnectionOpenConfirm: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventConnectionOpenConfirm: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConnectionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyConnectionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterpartyConnectionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyClientId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterpartyClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvents(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthEvents + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvents + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvents + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/ibc/core/04-channel/handler.go b/x/ibc/core/04-channel/handler.go index 375c35263ec1..2b9b3c2a72ee 100644 --- a/x/ibc/core/04-channel/handler.go +++ b/x/ibc/core/04-channel/handler.go @@ -18,20 +18,16 @@ func HandleMsgChannelOpenInit(ctx sdk.Context, k keeper.Keeper, portCap *capabil return nil, "", nil, sdkerrors.Wrap(err, "channel handshake open init failed") } - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeChannelOpenInit, - sdk.NewAttribute(types.AttributeKeyPortID, msg.PortId), - sdk.NewAttribute(types.AttributeKeyChannelID, channelID), - sdk.NewAttribute(types.AttributeCounterpartyPortID, msg.Channel.Counterparty.PortId), - sdk.NewAttribute(types.AttributeCounterpartyChannelID, msg.Channel.Counterparty.ChannelId), - sdk.NewAttribute(types.AttributeKeyConnectionID, msg.Channel.ConnectionHops[0]), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - }) + if err := ctx.EventManager().EmitTypedEvent( + &types.EventChannelOpenInit{ + PortId: msg.PortId, + ChannelId: channelID, + CounterpartyPortId: msg.Channel.Counterparty.PortId, + ConnectionId: msg.Channel.ConnectionHops[0], + }, + ); err != nil { + return nil, "", nil, err + } return &sdk.Result{ Events: ctx.EventManager().Events().ToABCIEvents(), @@ -47,20 +43,17 @@ func HandleMsgChannelOpenTry(ctx sdk.Context, k keeper.Keeper, portCap *capabili return nil, "", nil, sdkerrors.Wrap(err, "channel handshake open try failed") } - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeChannelOpenTry, - sdk.NewAttribute(types.AttributeKeyPortID, msg.PortId), - sdk.NewAttribute(types.AttributeKeyChannelID, channelID), - sdk.NewAttribute(types.AttributeCounterpartyPortID, msg.Channel.Counterparty.PortId), - sdk.NewAttribute(types.AttributeCounterpartyChannelID, msg.Channel.Counterparty.ChannelId), - sdk.NewAttribute(types.AttributeKeyConnectionID, msg.Channel.ConnectionHops[0]), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - }) + if err := ctx.EventManager().EmitTypedEvent( + &types.EventChannelOpenTry{ + PortId: msg.PortId, + ChannelId: channelID, + CounterpartyPortId: msg.Channel.Counterparty.PortId, + CounterpartyChannelId: msg.Channel.Counterparty.ChannelId, + ConnectionId: msg.Channel.ConnectionHops[0], + }, + ); err != nil { + return nil, "", nil, err + } return &sdk.Result{ Events: ctx.EventManager().Events().ToABCIEvents(), @@ -78,20 +71,17 @@ func HandleMsgChannelOpenAck(ctx sdk.Context, k keeper.Keeper, channelCap *capab channel, _ := k.GetChannel(ctx, msg.PortId, msg.ChannelId) - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeChannelOpenAck, - sdk.NewAttribute(types.AttributeKeyPortID, msg.PortId), - sdk.NewAttribute(types.AttributeKeyChannelID, msg.ChannelId), - sdk.NewAttribute(types.AttributeCounterpartyPortID, channel.Counterparty.PortId), - sdk.NewAttribute(types.AttributeCounterpartyChannelID, channel.Counterparty.ChannelId), - sdk.NewAttribute(types.AttributeKeyConnectionID, channel.ConnectionHops[0]), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - }) + if err := ctx.EventManager().EmitTypedEvent( + &types.EventChannelOpenAck{ + PortId: msg.PortId, + ChannelId: msg.ChannelId, + CounterpartyPortId: channel.Counterparty.PortId, + CounterpartyChannelId: channel.Counterparty.ChannelId, + ConnectionId: channel.ConnectionHops[0], + }, + ); err != nil { + return nil, err + } return &sdk.Result{ Events: ctx.EventManager().Events().ToABCIEvents(), @@ -107,20 +97,17 @@ func HandleMsgChannelOpenConfirm(ctx sdk.Context, k keeper.Keeper, channelCap *c channel, _ := k.GetChannel(ctx, msg.PortId, msg.ChannelId) - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeChannelOpenConfirm, - sdk.NewAttribute(types.AttributeKeyPortID, msg.PortId), - sdk.NewAttribute(types.AttributeKeyChannelID, msg.ChannelId), - sdk.NewAttribute(types.AttributeCounterpartyPortID, channel.Counterparty.PortId), - sdk.NewAttribute(types.AttributeCounterpartyChannelID, channel.Counterparty.ChannelId), - sdk.NewAttribute(types.AttributeKeyConnectionID, channel.ConnectionHops[0]), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - }) + if err := ctx.EventManager().EmitTypedEvent( + &types.EventChannelOpenConfirm{ + PortId: msg.PortId, + ChannelId: msg.ChannelId, + CounterpartyPortId: channel.Counterparty.PortId, + CounterpartyChannelId: channel.Counterparty.ChannelId, + ConnectionId: channel.ConnectionHops[0], + }, + ); err != nil { + return nil, err + } return &sdk.Result{ Events: ctx.EventManager().Events().ToABCIEvents(), @@ -136,20 +123,17 @@ func HandleMsgChannelCloseInit(ctx sdk.Context, k keeper.Keeper, channelCap *cap channel, _ := k.GetChannel(ctx, msg.PortId, msg.ChannelId) - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeChannelCloseInit, - sdk.NewAttribute(types.AttributeKeyPortID, msg.PortId), - sdk.NewAttribute(types.AttributeKeyChannelID, msg.ChannelId), - sdk.NewAttribute(types.AttributeCounterpartyPortID, channel.Counterparty.PortId), - sdk.NewAttribute(types.AttributeCounterpartyChannelID, channel.Counterparty.ChannelId), - sdk.NewAttribute(types.AttributeKeyConnectionID, channel.ConnectionHops[0]), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - }) + if err := ctx.EventManager().EmitTypedEvent( + &types.EventChannelCloseInit{ + PortId: msg.PortId, + ChannelId: msg.ChannelId, + CounterpartyPortId: channel.Counterparty.PortId, + CounterpartyChannelId: channel.Counterparty.ChannelId, + ConnectionId: channel.ConnectionHops[0], + }, + ); err != nil { + return nil, err + } return &sdk.Result{ Events: ctx.EventManager().Events().ToABCIEvents(), @@ -165,20 +149,17 @@ func HandleMsgChannelCloseConfirm(ctx sdk.Context, k keeper.Keeper, channelCap * channel, _ := k.GetChannel(ctx, msg.PortId, msg.ChannelId) - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeChannelCloseConfirm, - sdk.NewAttribute(types.AttributeKeyPortID, msg.PortId), - sdk.NewAttribute(types.AttributeKeyChannelID, msg.ChannelId), - sdk.NewAttribute(types.AttributeCounterpartyPortID, channel.Counterparty.PortId), - sdk.NewAttribute(types.AttributeCounterpartyChannelID, channel.Counterparty.ChannelId), - sdk.NewAttribute(types.AttributeKeyConnectionID, channel.ConnectionHops[0]), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - }) + if err := ctx.EventManager().EmitTypedEvent( + &types.EventChannelCloseConfirm{ + PortId: msg.PortId, + ChannelId: msg.ChannelId, + CounterpartyPortId: channel.Counterparty.PortId, + CounterpartyChannelId: channel.Counterparty.ChannelId, + ConnectionId: channel.ConnectionHops[0], + }, + ); err != nil { + return nil, err + } return &sdk.Result{ Events: ctx.EventManager().Events().ToABCIEvents(), diff --git a/x/ibc/core/04-channel/keeper/packet.go b/x/ibc/core/04-channel/keeper/packet.go index 9af59745d549..67cf042c2e37 100644 --- a/x/ibc/core/04-channel/keeper/packet.go +++ b/x/ibc/core/04-channel/keeper/packet.go @@ -117,24 +117,21 @@ func (k Keeper) SendPacket( // Emit Event with Packet data along with other packet information for relayer to pick up // and relay to other chain - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeSendPacket, - sdk.NewAttribute(types.AttributeKeyData, string(packet.GetData())), - sdk.NewAttribute(types.AttributeKeyTimeoutHeight, timeoutHeight.String()), - sdk.NewAttribute(types.AttributeKeyTimeoutTimestamp, fmt.Sprintf("%d", packet.GetTimeoutTimestamp())), - sdk.NewAttribute(types.AttributeKeySequence, fmt.Sprintf("%d", packet.GetSequence())), - sdk.NewAttribute(types.AttributeKeySrcPort, packet.GetSourcePort()), - sdk.NewAttribute(types.AttributeKeySrcChannel, packet.GetSourceChannel()), - sdk.NewAttribute(types.AttributeKeyDstPort, packet.GetDestPort()), - sdk.NewAttribute(types.AttributeKeyDstChannel, packet.GetDestChannel()), - sdk.NewAttribute(types.AttributeKeyChannelOrdering, channel.Ordering.String()), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - }) + if err := ctx.EventManager().EmitTypedEvent( + &types.EventChannelSendPacket{ + Data: packet.GetData(), + TimeoutHeight: timeoutHeight.(clienttypes.Height), + TimeoutTimestamp: packet.GetTimeoutTimestamp(), + Sequence: packet.GetSequence(), + SrcPort: packet.GetSourcePort(), + SrcChannel: packet.GetSourceChannel(), + DstPort: packet.GetDestPort(), + DstChannel: packet.GetDestChannel(), + ChannelOrdering: channel.Ordering, + }, + ); err != nil { + return err + } k.Logger(ctx).Info("packet sent", "packet", fmt.Sprintf("%v", packet)) return nil @@ -277,24 +274,21 @@ func (k Keeper) RecvPacket( k.Logger(ctx).Info("packet received", "packet", fmt.Sprintf("%v", packet)) // emit an event that the relayer can query for - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeRecvPacket, - sdk.NewAttribute(types.AttributeKeyData, string(packet.GetData())), - sdk.NewAttribute(types.AttributeKeyTimeoutHeight, packet.GetTimeoutHeight().String()), - sdk.NewAttribute(types.AttributeKeyTimeoutTimestamp, fmt.Sprintf("%d", packet.GetTimeoutTimestamp())), - sdk.NewAttribute(types.AttributeKeySequence, fmt.Sprintf("%d", packet.GetSequence())), - sdk.NewAttribute(types.AttributeKeySrcPort, packet.GetSourcePort()), - sdk.NewAttribute(types.AttributeKeySrcChannel, packet.GetSourceChannel()), - sdk.NewAttribute(types.AttributeKeyDstPort, packet.GetDestPort()), - sdk.NewAttribute(types.AttributeKeyDstChannel, packet.GetDestChannel()), - sdk.NewAttribute(types.AttributeKeyChannelOrdering, channel.Ordering.String()), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - }) + if err := ctx.EventManager().EmitTypedEvent( + &types.EventChannelRecvPacket{ + Data: packet.GetData(), + TimeoutHeight: packet.GetTimeoutHeight().(clienttypes.Height), + TimeoutTimestamp: packet.GetTimeoutTimestamp(), + Sequence: packet.GetSequence(), + SrcPort: packet.GetSourcePort(), + SrcChannel: packet.GetSourceChannel(), + DstPort: packet.GetDestPort(), + DstChannel: packet.GetDestChannel(), + ChannelOrdering: channel.Ordering, + }, + ); err != nil { + return err + } return nil } @@ -358,24 +352,21 @@ func (k Keeper) WriteAcknowledgement( k.Logger(ctx).Info("acknowledged written", "packet", fmt.Sprintf("%v", packet)) // emit an event that the relayer can query for - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeWriteAck, - sdk.NewAttribute(types.AttributeKeyData, string(packet.GetData())), - sdk.NewAttribute(types.AttributeKeyTimeoutHeight, packet.GetTimeoutHeight().String()), - sdk.NewAttribute(types.AttributeKeyTimeoutTimestamp, fmt.Sprintf("%d", packet.GetTimeoutTimestamp())), - sdk.NewAttribute(types.AttributeKeySequence, fmt.Sprintf("%d", packet.GetSequence())), - sdk.NewAttribute(types.AttributeKeySrcPort, packet.GetSourcePort()), - sdk.NewAttribute(types.AttributeKeySrcChannel, packet.GetSourceChannel()), - sdk.NewAttribute(types.AttributeKeyDstPort, packet.GetDestPort()), - sdk.NewAttribute(types.AttributeKeyDstChannel, packet.GetDestChannel()), - sdk.NewAttribute(types.AttributeKeyAck, string(acknowledgement)), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - }) + if err := ctx.EventManager().EmitTypedEvent( + &types.EventChannelWriteAck{ + Data: packet.GetData(), + TimeoutHeight: packet.GetTimeoutHeight().(clienttypes.Height), + TimeoutTimestamp: packet.GetTimeoutTimestamp(), + Sequence: packet.GetSequence(), + SrcPort: packet.GetSourcePort(), + SrcChannel: packet.GetSourceChannel(), + DstPort: packet.GetDestPort(), + DstChannel: packet.GetDestChannel(), + Acknowledgement: acknowledgement, + }, + ); err != nil { + return err + } return nil } @@ -494,23 +485,22 @@ func (k Keeper) AcknowledgePacket( k.Logger(ctx).Info("packet acknowledged", "packet", fmt.Sprintf("%v", packet)) // emit an event marking that we have processed the acknowledgement - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeAcknowledgePacket, - sdk.NewAttribute(types.AttributeKeyTimeoutHeight, packet.GetTimeoutHeight().String()), - sdk.NewAttribute(types.AttributeKeyTimeoutTimestamp, fmt.Sprintf("%d", packet.GetTimeoutTimestamp())), - sdk.NewAttribute(types.AttributeKeySequence, fmt.Sprintf("%d", packet.GetSequence())), - sdk.NewAttribute(types.AttributeKeySrcPort, packet.GetSourcePort()), - sdk.NewAttribute(types.AttributeKeySrcChannel, packet.GetSourceChannel()), - sdk.NewAttribute(types.AttributeKeyDstPort, packet.GetDestPort()), - sdk.NewAttribute(types.AttributeKeyDstChannel, packet.GetDestChannel()), - sdk.NewAttribute(types.AttributeKeyChannelOrdering, channel.Ordering.String()), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - }) + if err := ctx.EventManager().EmitTypedEvent( + &types.EventChannelAckPacket{ + Data: packet.GetData(), + TimeoutHeight: packet.GetTimeoutHeight().(clienttypes.Height), + TimeoutTimestamp: packet.GetTimeoutTimestamp(), + Sequence: packet.GetSequence(), + SrcPort: packet.GetSourcePort(), + SrcChannel: packet.GetSourceChannel(), + DstPort: packet.GetDestPort(), + DstChannel: packet.GetDestChannel(), + ChannelOrdering: channel.Ordering, + Acknowledgement: acknowledgement, + }, + ); err != nil { + return err + } return nil } diff --git a/x/ibc/core/04-channel/keeper/timeout.go b/x/ibc/core/04-channel/keeper/timeout.go index 1f3dac918f67..223a68608fbc 100644 --- a/x/ibc/core/04-channel/keeper/timeout.go +++ b/x/ibc/core/04-channel/keeper/timeout.go @@ -7,6 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" connectiontypes "github.com/cosmos/cosmos-sdk/x/ibc/core/03-connection/types" "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel/types" host "github.com/cosmos/cosmos-sdk/x/ibc/core/24-host" @@ -151,23 +152,21 @@ func (k Keeper) TimeoutExecuted( k.Logger(ctx).Info("packet timed-out", "packet", fmt.Sprintf("%v", packet)) // emit an event marking that we have processed the timeout - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeTimeoutPacket, - sdk.NewAttribute(types.AttributeKeyTimeoutHeight, packet.GetTimeoutHeight().String()), - sdk.NewAttribute(types.AttributeKeyTimeoutTimestamp, fmt.Sprintf("%d", packet.GetTimeoutTimestamp())), - sdk.NewAttribute(types.AttributeKeySequence, fmt.Sprintf("%d", packet.GetSequence())), - sdk.NewAttribute(types.AttributeKeySrcPort, packet.GetSourcePort()), - sdk.NewAttribute(types.AttributeKeySrcChannel, packet.GetSourceChannel()), - sdk.NewAttribute(types.AttributeKeyDstPort, packet.GetDestPort()), - sdk.NewAttribute(types.AttributeKeyDstChannel, packet.GetDestChannel()), - sdk.NewAttribute(types.AttributeKeyChannelOrdering, channel.Ordering.String()), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - }) + if err := ctx.EventManager().EmitTypedEvent( + &types.EventChannelTimeoutPacket{ + Data: packet.GetData(), + TimeoutHeight: packet.GetTimeoutHeight().(clienttypes.Height), + TimeoutTimestamp: packet.GetTimeoutTimestamp(), + Sequence: packet.GetSequence(), + SrcPort: packet.GetSourcePort(), + SrcChannel: packet.GetSourceChannel(), + DstPort: packet.GetDestPort(), + DstChannel: packet.GetDestChannel(), + ChannelOrdering: channel.Ordering, + }, + ); err != nil { + return err + } return nil } diff --git a/x/ibc/core/04-channel/types/events.pb.go b/x/ibc/core/04-channel/types/events.pb.go new file mode 100644 index 000000000000..f93466f3a0a5 --- /dev/null +++ b/x/ibc/core/04-channel/types/events.pb.go @@ -0,0 +1,5163 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ibc/core/channel/v1/events.proto + +package types + +import ( + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// EventChannelOpenInit is a typed event emitted on channel open init +type EventChannelOpenInit struct { + PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` + CounterpartyPortId string `protobuf:"bytes,3,opt,name=counterparty_port_id,json=counterpartyPortId,proto3" json:"counterparty_port_id,omitempty" yaml:"counterparty_port_id"` + ConnectionId string `protobuf:"bytes,5,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" yaml:"connection_id"` +} + +func (m *EventChannelOpenInit) Reset() { *m = EventChannelOpenInit{} } +func (m *EventChannelOpenInit) String() string { return proto.CompactTextString(m) } +func (*EventChannelOpenInit) ProtoMessage() {} +func (*EventChannelOpenInit) Descriptor() ([]byte, []int) { + return fileDescriptor_d050c542de417654, []int{0} +} +func (m *EventChannelOpenInit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventChannelOpenInit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventChannelOpenInit.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 *EventChannelOpenInit) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventChannelOpenInit.Merge(m, src) +} +func (m *EventChannelOpenInit) XXX_Size() int { + return m.Size() +} +func (m *EventChannelOpenInit) XXX_DiscardUnknown() { + xxx_messageInfo_EventChannelOpenInit.DiscardUnknown(m) +} + +var xxx_messageInfo_EventChannelOpenInit proto.InternalMessageInfo + +func (m *EventChannelOpenInit) GetPortId() string { + if m != nil { + return m.PortId + } + return "" +} + +func (m *EventChannelOpenInit) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + +func (m *EventChannelOpenInit) GetCounterpartyPortId() string { + if m != nil { + return m.CounterpartyPortId + } + return "" +} + +func (m *EventChannelOpenInit) GetConnectionId() string { + if m != nil { + return m.ConnectionId + } + return "" +} + +// EventChannelOpenTry is a typed event emitted on channel open try +type EventChannelOpenTry struct { + PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` + CounterpartyPortId string `protobuf:"bytes,3,opt,name=counterparty_port_id,json=counterpartyPortId,proto3" json:"counterparty_port_id,omitempty" yaml:"counterparty_port_id"` + CounterpartyChannelId string `protobuf:"bytes,4,opt,name=counterparty_channel_id,json=counterpartyChannelId,proto3" json:"counterparty_channel_id,omitempty" yaml:"counterparty_channel_id"` + ConnectionId string `protobuf:"bytes,5,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" yaml:"connection_id"` +} + +func (m *EventChannelOpenTry) Reset() { *m = EventChannelOpenTry{} } +func (m *EventChannelOpenTry) String() string { return proto.CompactTextString(m) } +func (*EventChannelOpenTry) ProtoMessage() {} +func (*EventChannelOpenTry) Descriptor() ([]byte, []int) { + return fileDescriptor_d050c542de417654, []int{1} +} +func (m *EventChannelOpenTry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventChannelOpenTry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventChannelOpenTry.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 *EventChannelOpenTry) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventChannelOpenTry.Merge(m, src) +} +func (m *EventChannelOpenTry) XXX_Size() int { + return m.Size() +} +func (m *EventChannelOpenTry) XXX_DiscardUnknown() { + xxx_messageInfo_EventChannelOpenTry.DiscardUnknown(m) +} + +var xxx_messageInfo_EventChannelOpenTry proto.InternalMessageInfo + +func (m *EventChannelOpenTry) GetPortId() string { + if m != nil { + return m.PortId + } + return "" +} + +func (m *EventChannelOpenTry) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + +func (m *EventChannelOpenTry) GetCounterpartyPortId() string { + if m != nil { + return m.CounterpartyPortId + } + return "" +} + +func (m *EventChannelOpenTry) GetCounterpartyChannelId() string { + if m != nil { + return m.CounterpartyChannelId + } + return "" +} + +func (m *EventChannelOpenTry) GetConnectionId() string { + if m != nil { + return m.ConnectionId + } + return "" +} + +// EventChannelOpenAck is a typed event emitted on channel open acknowledgement +type EventChannelOpenAck struct { + PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` + CounterpartyPortId string `protobuf:"bytes,3,opt,name=counterparty_port_id,json=counterpartyPortId,proto3" json:"counterparty_port_id,omitempty" yaml:"counterparty_port_id"` + CounterpartyChannelId string `protobuf:"bytes,4,opt,name=counterparty_channel_id,json=counterpartyChannelId,proto3" json:"counterparty_channel_id,omitempty" yaml:"counterparty_channel_id"` + ConnectionId string `protobuf:"bytes,5,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" yaml:"connection_id"` +} + +func (m *EventChannelOpenAck) Reset() { *m = EventChannelOpenAck{} } +func (m *EventChannelOpenAck) String() string { return proto.CompactTextString(m) } +func (*EventChannelOpenAck) ProtoMessage() {} +func (*EventChannelOpenAck) Descriptor() ([]byte, []int) { + return fileDescriptor_d050c542de417654, []int{2} +} +func (m *EventChannelOpenAck) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventChannelOpenAck) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventChannelOpenAck.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 *EventChannelOpenAck) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventChannelOpenAck.Merge(m, src) +} +func (m *EventChannelOpenAck) XXX_Size() int { + return m.Size() +} +func (m *EventChannelOpenAck) XXX_DiscardUnknown() { + xxx_messageInfo_EventChannelOpenAck.DiscardUnknown(m) +} + +var xxx_messageInfo_EventChannelOpenAck proto.InternalMessageInfo + +func (m *EventChannelOpenAck) GetPortId() string { + if m != nil { + return m.PortId + } + return "" +} + +func (m *EventChannelOpenAck) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + +func (m *EventChannelOpenAck) GetCounterpartyPortId() string { + if m != nil { + return m.CounterpartyPortId + } + return "" +} + +func (m *EventChannelOpenAck) GetCounterpartyChannelId() string { + if m != nil { + return m.CounterpartyChannelId + } + return "" +} + +func (m *EventChannelOpenAck) GetConnectionId() string { + if m != nil { + return m.ConnectionId + } + return "" +} + +// EventChannelOpenConfirm is a typed event emitted on channel open confirm +type EventChannelOpenConfirm struct { + PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` + CounterpartyPortId string `protobuf:"bytes,3,opt,name=counterparty_port_id,json=counterpartyPortId,proto3" json:"counterparty_port_id,omitempty" yaml:"counterparty_port_id"` + CounterpartyChannelId string `protobuf:"bytes,4,opt,name=counterparty_channel_id,json=counterpartyChannelId,proto3" json:"counterparty_channel_id,omitempty" yaml:"counterparty_channel_id"` + ConnectionId string `protobuf:"bytes,5,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" yaml:"connection_id"` +} + +func (m *EventChannelOpenConfirm) Reset() { *m = EventChannelOpenConfirm{} } +func (m *EventChannelOpenConfirm) String() string { return proto.CompactTextString(m) } +func (*EventChannelOpenConfirm) ProtoMessage() {} +func (*EventChannelOpenConfirm) Descriptor() ([]byte, []int) { + return fileDescriptor_d050c542de417654, []int{3} +} +func (m *EventChannelOpenConfirm) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventChannelOpenConfirm) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventChannelOpenConfirm.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 *EventChannelOpenConfirm) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventChannelOpenConfirm.Merge(m, src) +} +func (m *EventChannelOpenConfirm) XXX_Size() int { + return m.Size() +} +func (m *EventChannelOpenConfirm) XXX_DiscardUnknown() { + xxx_messageInfo_EventChannelOpenConfirm.DiscardUnknown(m) +} + +var xxx_messageInfo_EventChannelOpenConfirm proto.InternalMessageInfo + +func (m *EventChannelOpenConfirm) GetPortId() string { + if m != nil { + return m.PortId + } + return "" +} + +func (m *EventChannelOpenConfirm) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + +func (m *EventChannelOpenConfirm) GetCounterpartyPortId() string { + if m != nil { + return m.CounterpartyPortId + } + return "" +} + +func (m *EventChannelOpenConfirm) GetCounterpartyChannelId() string { + if m != nil { + return m.CounterpartyChannelId + } + return "" +} + +func (m *EventChannelOpenConfirm) GetConnectionId() string { + if m != nil { + return m.ConnectionId + } + return "" +} + +// EventChannelCloseInit is a typed event emitted on channel close init +type EventChannelCloseInit struct { + PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` + CounterpartyPortId string `protobuf:"bytes,3,opt,name=counterparty_port_id,json=counterpartyPortId,proto3" json:"counterparty_port_id,omitempty" yaml:"counterparty_port_id"` + CounterpartyChannelId string `protobuf:"bytes,4,opt,name=counterparty_channel_id,json=counterpartyChannelId,proto3" json:"counterparty_channel_id,omitempty" yaml:"counterparty_channel_id"` + ConnectionId string `protobuf:"bytes,5,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" yaml:"connection_id"` +} + +func (m *EventChannelCloseInit) Reset() { *m = EventChannelCloseInit{} } +func (m *EventChannelCloseInit) String() string { return proto.CompactTextString(m) } +func (*EventChannelCloseInit) ProtoMessage() {} +func (*EventChannelCloseInit) Descriptor() ([]byte, []int) { + return fileDescriptor_d050c542de417654, []int{4} +} +func (m *EventChannelCloseInit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventChannelCloseInit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventChannelCloseInit.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 *EventChannelCloseInit) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventChannelCloseInit.Merge(m, src) +} +func (m *EventChannelCloseInit) XXX_Size() int { + return m.Size() +} +func (m *EventChannelCloseInit) XXX_DiscardUnknown() { + xxx_messageInfo_EventChannelCloseInit.DiscardUnknown(m) +} + +var xxx_messageInfo_EventChannelCloseInit proto.InternalMessageInfo + +func (m *EventChannelCloseInit) GetPortId() string { + if m != nil { + return m.PortId + } + return "" +} + +func (m *EventChannelCloseInit) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + +func (m *EventChannelCloseInit) GetCounterpartyPortId() string { + if m != nil { + return m.CounterpartyPortId + } + return "" +} + +func (m *EventChannelCloseInit) GetCounterpartyChannelId() string { + if m != nil { + return m.CounterpartyChannelId + } + return "" +} + +func (m *EventChannelCloseInit) GetConnectionId() string { + if m != nil { + return m.ConnectionId + } + return "" +} + +// EventChannelCloseConfirm is a typed event emitted on channel close confirm +type EventChannelCloseConfirm struct { + PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` + CounterpartyPortId string `protobuf:"bytes,3,opt,name=counterparty_port_id,json=counterpartyPortId,proto3" json:"counterparty_port_id,omitempty" yaml:"counterparty_port_id"` + CounterpartyChannelId string `protobuf:"bytes,4,opt,name=counterparty_channel_id,json=counterpartyChannelId,proto3" json:"counterparty_channel_id,omitempty" yaml:"counterparty_channel_id"` + ConnectionId string `protobuf:"bytes,5,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" yaml:"connection_id"` +} + +func (m *EventChannelCloseConfirm) Reset() { *m = EventChannelCloseConfirm{} } +func (m *EventChannelCloseConfirm) String() string { return proto.CompactTextString(m) } +func (*EventChannelCloseConfirm) ProtoMessage() {} +func (*EventChannelCloseConfirm) Descriptor() ([]byte, []int) { + return fileDescriptor_d050c542de417654, []int{5} +} +func (m *EventChannelCloseConfirm) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventChannelCloseConfirm) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventChannelCloseConfirm.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 *EventChannelCloseConfirm) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventChannelCloseConfirm.Merge(m, src) +} +func (m *EventChannelCloseConfirm) XXX_Size() int { + return m.Size() +} +func (m *EventChannelCloseConfirm) XXX_DiscardUnknown() { + xxx_messageInfo_EventChannelCloseConfirm.DiscardUnknown(m) +} + +var xxx_messageInfo_EventChannelCloseConfirm proto.InternalMessageInfo + +func (m *EventChannelCloseConfirm) GetPortId() string { + if m != nil { + return m.PortId + } + return "" +} + +func (m *EventChannelCloseConfirm) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + +func (m *EventChannelCloseConfirm) GetCounterpartyPortId() string { + if m != nil { + return m.CounterpartyPortId + } + return "" +} + +func (m *EventChannelCloseConfirm) GetCounterpartyChannelId() string { + if m != nil { + return m.CounterpartyChannelId + } + return "" +} + +func (m *EventChannelCloseConfirm) GetConnectionId() string { + if m != nil { + return m.ConnectionId + } + return "" +} + +// EventChannelSendPacket is a typed event emitted when packet is sent +type EventChannelSendPacket struct { + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + TimeoutHeight types.Height `protobuf:"bytes,2,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height" yaml:"timeout_height"` + TimeoutTimestamp uint64 `protobuf:"varint,3,opt,name=timeout_timestamp,json=timeoutTimestamp,proto3" json:"timeout_timestamp,omitempty" yaml:"timeout_timestamp"` + Sequence uint64 `protobuf:"varint,4,opt,name=sequence,proto3" json:"sequence,omitempty"` + SrcPort string `protobuf:"bytes,5,opt,name=src_port,json=srcPort,proto3" json:"src_port,omitempty" yaml:"src_port"` + SrcChannel string `protobuf:"bytes,6,opt,name=src_channel,json=srcChannel,proto3" json:"src_channel,omitempty" yaml:"src_channel"` + DstPort string `protobuf:"bytes,7,opt,name=dst_port,json=dstPort,proto3" json:"dst_port,omitempty" yaml:"dst_port"` + DstChannel string `protobuf:"bytes,8,opt,name=dst_channel,json=dstChannel,proto3" json:"dst_channel,omitempty" yaml:"dst_channel"` + ChannelOrdering Order `protobuf:"varint,9,opt,name=channel_ordering,json=channelOrdering,proto3,enum=ibc.core.channel.v1.Order" json:"channel_ordering,omitempty" yaml:"channel_ordering"` +} + +func (m *EventChannelSendPacket) Reset() { *m = EventChannelSendPacket{} } +func (m *EventChannelSendPacket) String() string { return proto.CompactTextString(m) } +func (*EventChannelSendPacket) ProtoMessage() {} +func (*EventChannelSendPacket) Descriptor() ([]byte, []int) { + return fileDescriptor_d050c542de417654, []int{6} +} +func (m *EventChannelSendPacket) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventChannelSendPacket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventChannelSendPacket.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 *EventChannelSendPacket) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventChannelSendPacket.Merge(m, src) +} +func (m *EventChannelSendPacket) XXX_Size() int { + return m.Size() +} +func (m *EventChannelSendPacket) XXX_DiscardUnknown() { + xxx_messageInfo_EventChannelSendPacket.DiscardUnknown(m) +} + +var xxx_messageInfo_EventChannelSendPacket proto.InternalMessageInfo + +func (m *EventChannelSendPacket) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +func (m *EventChannelSendPacket) GetTimeoutHeight() types.Height { + if m != nil { + return m.TimeoutHeight + } + return types.Height{} +} + +func (m *EventChannelSendPacket) GetTimeoutTimestamp() uint64 { + if m != nil { + return m.TimeoutTimestamp + } + return 0 +} + +func (m *EventChannelSendPacket) GetSequence() uint64 { + if m != nil { + return m.Sequence + } + return 0 +} + +func (m *EventChannelSendPacket) GetSrcPort() string { + if m != nil { + return m.SrcPort + } + return "" +} + +func (m *EventChannelSendPacket) GetSrcChannel() string { + if m != nil { + return m.SrcChannel + } + return "" +} + +func (m *EventChannelSendPacket) GetDstPort() string { + if m != nil { + return m.DstPort + } + return "" +} + +func (m *EventChannelSendPacket) GetDstChannel() string { + if m != nil { + return m.DstChannel + } + return "" +} + +func (m *EventChannelSendPacket) GetChannelOrdering() Order { + if m != nil { + return m.ChannelOrdering + } + return NONE +} + +// EventChannelRecvPacket is a typed event emitted when packet is received in channel +type EventChannelRecvPacket struct { + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + TimeoutHeight types.Height `protobuf:"bytes,2,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height" yaml:"timeout_height"` + TimeoutTimestamp uint64 `protobuf:"varint,3,opt,name=timeout_timestamp,json=timeoutTimestamp,proto3" json:"timeout_timestamp,omitempty" yaml:"timeout_timestamp"` + Sequence uint64 `protobuf:"varint,4,opt,name=sequence,proto3" json:"sequence,omitempty"` + SrcPort string `protobuf:"bytes,5,opt,name=src_port,json=srcPort,proto3" json:"src_port,omitempty" yaml:"src_port"` + SrcChannel string `protobuf:"bytes,6,opt,name=src_channel,json=srcChannel,proto3" json:"src_channel,omitempty" yaml:"src_channel"` + DstPort string `protobuf:"bytes,7,opt,name=dst_port,json=dstPort,proto3" json:"dst_port,omitempty" yaml:"dst_port"` + DstChannel string `protobuf:"bytes,8,opt,name=dst_channel,json=dstChannel,proto3" json:"dst_channel,omitempty" yaml:"dst_channel"` + ChannelOrdering Order `protobuf:"varint,9,opt,name=channel_ordering,json=channelOrdering,proto3,enum=ibc.core.channel.v1.Order" json:"channel_ordering,omitempty" yaml:"channel_ordering"` +} + +func (m *EventChannelRecvPacket) Reset() { *m = EventChannelRecvPacket{} } +func (m *EventChannelRecvPacket) String() string { return proto.CompactTextString(m) } +func (*EventChannelRecvPacket) ProtoMessage() {} +func (*EventChannelRecvPacket) Descriptor() ([]byte, []int) { + return fileDescriptor_d050c542de417654, []int{7} +} +func (m *EventChannelRecvPacket) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventChannelRecvPacket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventChannelRecvPacket.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 *EventChannelRecvPacket) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventChannelRecvPacket.Merge(m, src) +} +func (m *EventChannelRecvPacket) XXX_Size() int { + return m.Size() +} +func (m *EventChannelRecvPacket) XXX_DiscardUnknown() { + xxx_messageInfo_EventChannelRecvPacket.DiscardUnknown(m) +} + +var xxx_messageInfo_EventChannelRecvPacket proto.InternalMessageInfo + +func (m *EventChannelRecvPacket) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +func (m *EventChannelRecvPacket) GetTimeoutHeight() types.Height { + if m != nil { + return m.TimeoutHeight + } + return types.Height{} +} + +func (m *EventChannelRecvPacket) GetTimeoutTimestamp() uint64 { + if m != nil { + return m.TimeoutTimestamp + } + return 0 +} + +func (m *EventChannelRecvPacket) GetSequence() uint64 { + if m != nil { + return m.Sequence + } + return 0 +} + +func (m *EventChannelRecvPacket) GetSrcPort() string { + if m != nil { + return m.SrcPort + } + return "" +} + +func (m *EventChannelRecvPacket) GetSrcChannel() string { + if m != nil { + return m.SrcChannel + } + return "" +} + +func (m *EventChannelRecvPacket) GetDstPort() string { + if m != nil { + return m.DstPort + } + return "" +} + +func (m *EventChannelRecvPacket) GetDstChannel() string { + if m != nil { + return m.DstChannel + } + return "" +} + +func (m *EventChannelRecvPacket) GetChannelOrdering() Order { + if m != nil { + return m.ChannelOrdering + } + return NONE +} + +// EventChannelWriteAck is a typed event emitted on write acknowledgement +type EventChannelWriteAck struct { + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + TimeoutHeight types.Height `protobuf:"bytes,2,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height" yaml:"timeout_height"` + TimeoutTimestamp uint64 `protobuf:"varint,3,opt,name=timeout_timestamp,json=timeoutTimestamp,proto3" json:"timeout_timestamp,omitempty" yaml:"timeout_timestamp"` + Sequence uint64 `protobuf:"varint,4,opt,name=sequence,proto3" json:"sequence,omitempty"` + SrcPort string `protobuf:"bytes,5,opt,name=src_port,json=srcPort,proto3" json:"src_port,omitempty" yaml:"src_port"` + SrcChannel string `protobuf:"bytes,6,opt,name=src_channel,json=srcChannel,proto3" json:"src_channel,omitempty" yaml:"src_channel"` + DstPort string `protobuf:"bytes,7,opt,name=dst_port,json=dstPort,proto3" json:"dst_port,omitempty" yaml:"dst_port"` + DstChannel string `protobuf:"bytes,8,opt,name=dst_channel,json=dstChannel,proto3" json:"dst_channel,omitempty" yaml:"dst_channel"` + Acknowledgement []byte `protobuf:"bytes,9,opt,name=acknowledgement,proto3" json:"acknowledgement,omitempty"` +} + +func (m *EventChannelWriteAck) Reset() { *m = EventChannelWriteAck{} } +func (m *EventChannelWriteAck) String() string { return proto.CompactTextString(m) } +func (*EventChannelWriteAck) ProtoMessage() {} +func (*EventChannelWriteAck) Descriptor() ([]byte, []int) { + return fileDescriptor_d050c542de417654, []int{8} +} +func (m *EventChannelWriteAck) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventChannelWriteAck) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventChannelWriteAck.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 *EventChannelWriteAck) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventChannelWriteAck.Merge(m, src) +} +func (m *EventChannelWriteAck) XXX_Size() int { + return m.Size() +} +func (m *EventChannelWriteAck) XXX_DiscardUnknown() { + xxx_messageInfo_EventChannelWriteAck.DiscardUnknown(m) +} + +var xxx_messageInfo_EventChannelWriteAck proto.InternalMessageInfo + +func (m *EventChannelWriteAck) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +func (m *EventChannelWriteAck) GetTimeoutHeight() types.Height { + if m != nil { + return m.TimeoutHeight + } + return types.Height{} +} + +func (m *EventChannelWriteAck) GetTimeoutTimestamp() uint64 { + if m != nil { + return m.TimeoutTimestamp + } + return 0 +} + +func (m *EventChannelWriteAck) GetSequence() uint64 { + if m != nil { + return m.Sequence + } + return 0 +} + +func (m *EventChannelWriteAck) GetSrcPort() string { + if m != nil { + return m.SrcPort + } + return "" +} + +func (m *EventChannelWriteAck) GetSrcChannel() string { + if m != nil { + return m.SrcChannel + } + return "" +} + +func (m *EventChannelWriteAck) GetDstPort() string { + if m != nil { + return m.DstPort + } + return "" +} + +func (m *EventChannelWriteAck) GetDstChannel() string { + if m != nil { + return m.DstChannel + } + return "" +} + +func (m *EventChannelWriteAck) GetAcknowledgement() []byte { + if m != nil { + return m.Acknowledgement + } + return nil +} + +// EventChannelAckPacket is a typed event emitted when packet acknowledgement is executed +type EventChannelAckPacket struct { + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + TimeoutHeight types.Height `protobuf:"bytes,2,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height" yaml:"timeout_height"` + TimeoutTimestamp uint64 `protobuf:"varint,3,opt,name=timeout_timestamp,json=timeoutTimestamp,proto3" json:"timeout_timestamp,omitempty" yaml:"timeout_timestamp"` + Sequence uint64 `protobuf:"varint,4,opt,name=sequence,proto3" json:"sequence,omitempty"` + SrcPort string `protobuf:"bytes,5,opt,name=src_port,json=srcPort,proto3" json:"src_port,omitempty" yaml:"src_port"` + SrcChannel string `protobuf:"bytes,6,opt,name=src_channel,json=srcChannel,proto3" json:"src_channel,omitempty" yaml:"src_channel"` + DstPort string `protobuf:"bytes,7,opt,name=dst_port,json=dstPort,proto3" json:"dst_port,omitempty" yaml:"dst_port"` + DstChannel string `protobuf:"bytes,8,opt,name=dst_channel,json=dstChannel,proto3" json:"dst_channel,omitempty" yaml:"dst_channel"` + ChannelOrdering Order `protobuf:"varint,9,opt,name=channel_ordering,json=channelOrdering,proto3,enum=ibc.core.channel.v1.Order" json:"channel_ordering,omitempty" yaml:"channel_ordering"` + Acknowledgement []byte `protobuf:"bytes,10,opt,name=acknowledgement,proto3" json:"acknowledgement,omitempty"` +} + +func (m *EventChannelAckPacket) Reset() { *m = EventChannelAckPacket{} } +func (m *EventChannelAckPacket) String() string { return proto.CompactTextString(m) } +func (*EventChannelAckPacket) ProtoMessage() {} +func (*EventChannelAckPacket) Descriptor() ([]byte, []int) { + return fileDescriptor_d050c542de417654, []int{9} +} +func (m *EventChannelAckPacket) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventChannelAckPacket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventChannelAckPacket.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 *EventChannelAckPacket) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventChannelAckPacket.Merge(m, src) +} +func (m *EventChannelAckPacket) XXX_Size() int { + return m.Size() +} +func (m *EventChannelAckPacket) XXX_DiscardUnknown() { + xxx_messageInfo_EventChannelAckPacket.DiscardUnknown(m) +} + +var xxx_messageInfo_EventChannelAckPacket proto.InternalMessageInfo + +func (m *EventChannelAckPacket) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +func (m *EventChannelAckPacket) GetTimeoutHeight() types.Height { + if m != nil { + return m.TimeoutHeight + } + return types.Height{} +} + +func (m *EventChannelAckPacket) GetTimeoutTimestamp() uint64 { + if m != nil { + return m.TimeoutTimestamp + } + return 0 +} + +func (m *EventChannelAckPacket) GetSequence() uint64 { + if m != nil { + return m.Sequence + } + return 0 +} + +func (m *EventChannelAckPacket) GetSrcPort() string { + if m != nil { + return m.SrcPort + } + return "" +} + +func (m *EventChannelAckPacket) GetSrcChannel() string { + if m != nil { + return m.SrcChannel + } + return "" +} + +func (m *EventChannelAckPacket) GetDstPort() string { + if m != nil { + return m.DstPort + } + return "" +} + +func (m *EventChannelAckPacket) GetDstChannel() string { + if m != nil { + return m.DstChannel + } + return "" +} + +func (m *EventChannelAckPacket) GetChannelOrdering() Order { + if m != nil { + return m.ChannelOrdering + } + return NONE +} + +func (m *EventChannelAckPacket) GetAcknowledgement() []byte { + if m != nil { + return m.Acknowledgement + } + return nil +} + +// EventChannelTimeoutPacket is a typed event emitted when packet is timeout +type EventChannelTimeoutPacket struct { + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + TimeoutHeight types.Height `protobuf:"bytes,2,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height" yaml:"timeout_height"` + TimeoutTimestamp uint64 `protobuf:"varint,3,opt,name=timeout_timestamp,json=timeoutTimestamp,proto3" json:"timeout_timestamp,omitempty" yaml:"timeout_timestamp"` + Sequence uint64 `protobuf:"varint,4,opt,name=sequence,proto3" json:"sequence,omitempty"` + SrcPort string `protobuf:"bytes,5,opt,name=src_port,json=srcPort,proto3" json:"src_port,omitempty" yaml:"src_port"` + SrcChannel string `protobuf:"bytes,6,opt,name=src_channel,json=srcChannel,proto3" json:"src_channel,omitempty" yaml:"src_channel"` + DstPort string `protobuf:"bytes,7,opt,name=dst_port,json=dstPort,proto3" json:"dst_port,omitempty" yaml:"dst_port"` + DstChannel string `protobuf:"bytes,8,opt,name=dst_channel,json=dstChannel,proto3" json:"dst_channel,omitempty" yaml:"dst_channel"` + ChannelOrdering Order `protobuf:"varint,9,opt,name=channel_ordering,json=channelOrdering,proto3,enum=ibc.core.channel.v1.Order" json:"channel_ordering,omitempty" yaml:"channel_ordering"` +} + +func (m *EventChannelTimeoutPacket) Reset() { *m = EventChannelTimeoutPacket{} } +func (m *EventChannelTimeoutPacket) String() string { return proto.CompactTextString(m) } +func (*EventChannelTimeoutPacket) ProtoMessage() {} +func (*EventChannelTimeoutPacket) Descriptor() ([]byte, []int) { + return fileDescriptor_d050c542de417654, []int{10} +} +func (m *EventChannelTimeoutPacket) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventChannelTimeoutPacket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventChannelTimeoutPacket.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 *EventChannelTimeoutPacket) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventChannelTimeoutPacket.Merge(m, src) +} +func (m *EventChannelTimeoutPacket) XXX_Size() int { + return m.Size() +} +func (m *EventChannelTimeoutPacket) XXX_DiscardUnknown() { + xxx_messageInfo_EventChannelTimeoutPacket.DiscardUnknown(m) +} + +var xxx_messageInfo_EventChannelTimeoutPacket proto.InternalMessageInfo + +func (m *EventChannelTimeoutPacket) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +func (m *EventChannelTimeoutPacket) GetTimeoutHeight() types.Height { + if m != nil { + return m.TimeoutHeight + } + return types.Height{} +} + +func (m *EventChannelTimeoutPacket) GetTimeoutTimestamp() uint64 { + if m != nil { + return m.TimeoutTimestamp + } + return 0 +} + +func (m *EventChannelTimeoutPacket) GetSequence() uint64 { + if m != nil { + return m.Sequence + } + return 0 +} + +func (m *EventChannelTimeoutPacket) GetSrcPort() string { + if m != nil { + return m.SrcPort + } + return "" +} + +func (m *EventChannelTimeoutPacket) GetSrcChannel() string { + if m != nil { + return m.SrcChannel + } + return "" +} + +func (m *EventChannelTimeoutPacket) GetDstPort() string { + if m != nil { + return m.DstPort + } + return "" +} + +func (m *EventChannelTimeoutPacket) GetDstChannel() string { + if m != nil { + return m.DstChannel + } + return "" +} + +func (m *EventChannelTimeoutPacket) GetChannelOrdering() Order { + if m != nil { + return m.ChannelOrdering + } + return NONE +} + +func init() { + proto.RegisterType((*EventChannelOpenInit)(nil), "ibc.core.channel.v1.EventChannelOpenInit") + proto.RegisterType((*EventChannelOpenTry)(nil), "ibc.core.channel.v1.EventChannelOpenTry") + proto.RegisterType((*EventChannelOpenAck)(nil), "ibc.core.channel.v1.EventChannelOpenAck") + proto.RegisterType((*EventChannelOpenConfirm)(nil), "ibc.core.channel.v1.EventChannelOpenConfirm") + proto.RegisterType((*EventChannelCloseInit)(nil), "ibc.core.channel.v1.EventChannelCloseInit") + proto.RegisterType((*EventChannelCloseConfirm)(nil), "ibc.core.channel.v1.EventChannelCloseConfirm") + proto.RegisterType((*EventChannelSendPacket)(nil), "ibc.core.channel.v1.EventChannelSendPacket") + proto.RegisterType((*EventChannelRecvPacket)(nil), "ibc.core.channel.v1.EventChannelRecvPacket") + proto.RegisterType((*EventChannelWriteAck)(nil), "ibc.core.channel.v1.EventChannelWriteAck") + proto.RegisterType((*EventChannelAckPacket)(nil), "ibc.core.channel.v1.EventChannelAckPacket") + proto.RegisterType((*EventChannelTimeoutPacket)(nil), "ibc.core.channel.v1.EventChannelTimeoutPacket") +} + +func init() { proto.RegisterFile("ibc/core/channel/v1/events.proto", fileDescriptor_d050c542de417654) } + +var fileDescriptor_d050c542de417654 = []byte{ + // 774 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0x4d, 0x6f, 0xd3, 0x30, + 0x18, 0x6e, 0xbb, 0xb2, 0x6e, 0xde, 0xb7, 0xd7, 0x6e, 0xa5, 0x83, 0x66, 0xf8, 0x34, 0x09, 0x2d, + 0x61, 0x30, 0x09, 0x84, 0xc4, 0x61, 0xad, 0x90, 0xe8, 0x69, 0xc3, 0x4c, 0x42, 0xda, 0x65, 0xa4, + 0x8e, 0x69, 0xa3, 0xb6, 0x76, 0x49, 0xdc, 0x42, 0x7f, 0x03, 0x17, 0xfe, 0x07, 0x12, 0xbf, 0x63, + 0xc7, 0x1d, 0x38, 0x70, 0x8a, 0xd0, 0x26, 0x21, 0x04, 0x07, 0xa4, 0xfc, 0x02, 0x14, 0x27, 0x69, + 0x93, 0x92, 0xe3, 0x26, 0x31, 0x29, 0xa7, 0xd8, 0xef, 0xfb, 0xbc, 0x1f, 0x7a, 0xde, 0xa7, 0x96, + 0x6b, 0xb0, 0x6d, 0x36, 0x89, 0x46, 0xb8, 0x45, 0x35, 0xd2, 0xd6, 0x19, 0xa3, 0x5d, 0x6d, 0xb8, + 0xa7, 0xd1, 0x21, 0x65, 0xc2, 0x56, 0xfb, 0x16, 0x17, 0x1c, 0xae, 0x9b, 0x4d, 0xa2, 0x7a, 0x08, + 0x35, 0x40, 0xa8, 0xc3, 0xbd, 0xca, 0xbd, 0xa4, 0xb0, 0xd0, 0x2f, 0xe3, 0x2a, 0xc5, 0x16, 0x6f, + 0x71, 0xb9, 0xd4, 0xbc, 0x55, 0x60, 0x55, 0x26, 0x81, 0x5d, 0x93, 0x32, 0x21, 0xe3, 0xe4, 0xca, + 0x07, 0xa0, 0x8f, 0x39, 0x50, 0x7c, 0xee, 0xd5, 0xaf, 0xfb, 0xd9, 0x0e, 0xfb, 0x94, 0x35, 0x98, + 0x29, 0xe0, 0x7d, 0x50, 0xe8, 0x73, 0x4b, 0x9c, 0x9a, 0x46, 0x39, 0xbb, 0x9d, 0xdd, 0x99, 0xaf, + 0x41, 0xd7, 0x51, 0x96, 0x47, 0x7a, 0xaf, 0xfb, 0x14, 0x05, 0x0e, 0x84, 0x67, 0xbd, 0x55, 0xc3, + 0x80, 0xfb, 0x00, 0x04, 0xdd, 0x78, 0xf8, 0x9c, 0xc4, 0x97, 0x5c, 0x47, 0x59, 0xf3, 0xf1, 0x13, + 0x1f, 0xc2, 0xf3, 0xc1, 0xa6, 0x61, 0xc0, 0x97, 0xa0, 0x48, 0xf8, 0x80, 0x09, 0x6a, 0xf5, 0x75, + 0x4b, 0x8c, 0x4e, 0xc3, 0x7a, 0x33, 0x32, 0x5e, 0x71, 0x1d, 0x65, 0x2b, 0x88, 0x4f, 0x40, 0x21, + 0x0c, 0xa3, 0xe6, 0x23, 0xbf, 0x91, 0x67, 0x60, 0x89, 0x70, 0xc6, 0x28, 0x11, 0x26, 0x67, 0x5e, + 0xae, 0x5b, 0x32, 0x57, 0xd9, 0x75, 0x94, 0x62, 0x98, 0x2b, 0xe2, 0x46, 0x78, 0x71, 0xb2, 0x6f, + 0x18, 0xe8, 0x47, 0x0e, 0xac, 0x4f, 0xb3, 0x71, 0x6c, 0x8d, 0x6e, 0x28, 0x19, 0x27, 0x60, 0x33, + 0x06, 0x8e, 0x74, 0x95, 0x97, 0x59, 0x91, 0xeb, 0x28, 0xd5, 0x84, 0xac, 0xd1, 0x16, 0x4b, 0x51, + 0x4f, 0x7d, 0xdc, 0xee, 0x35, 0x10, 0x7d, 0x40, 0x3a, 0x29, 0xd1, 0x57, 0x4d, 0xf4, 0xaf, 0x1c, + 0xd8, 0x9c, 0x26, 0xba, 0xce, 0xd9, 0x5b, 0xd3, 0xea, 0xa5, 0x64, 0x5f, 0x35, 0xd9, 0x3f, 0x73, + 0xa0, 0x14, 0x25, 0xbb, 0xde, 0xe5, 0x36, 0xbd, 0xc1, 0xa7, 0xe9, 0x7f, 0x4c, 0xf5, 0xef, 0x1c, + 0x28, 0xff, 0x43, 0x75, 0x2a, 0xec, 0x6b, 0x62, 0xfb, 0x73, 0x1e, 0x6c, 0x44, 0xd9, 0x7e, 0x45, + 0x99, 0x71, 0xa4, 0x93, 0x0e, 0x15, 0x10, 0x82, 0xbc, 0xa1, 0x0b, 0x5d, 0x12, 0xbd, 0x88, 0xe5, + 0x1a, 0xbe, 0x01, 0xcb, 0xc2, 0xec, 0x51, 0x3e, 0x10, 0xa7, 0x6d, 0x6a, 0xb6, 0xda, 0x42, 0xd2, + 0xba, 0xf0, 0xb0, 0xa2, 0x4e, 0x2e, 0x37, 0xfe, 0x25, 0x64, 0xb8, 0xa7, 0xbe, 0x90, 0x88, 0xda, + 0xdd, 0x33, 0x47, 0xc9, 0xb8, 0x8e, 0x52, 0xf2, 0xdb, 0x89, 0xc7, 0x23, 0xbc, 0x14, 0x18, 0x7c, + 0x34, 0x6c, 0x80, 0xb5, 0x10, 0xe1, 0x7d, 0x6d, 0xa1, 0xf7, 0xfa, 0x92, 0xfb, 0x7c, 0xed, 0x8e, + 0xeb, 0x28, 0xe5, 0x78, 0x92, 0x31, 0x04, 0xe1, 0xd5, 0xc0, 0x76, 0x1c, 0x9a, 0x60, 0x05, 0xcc, + 0xd9, 0xf4, 0xdd, 0x80, 0x32, 0x42, 0x25, 0xcf, 0x79, 0x3c, 0xde, 0x43, 0x15, 0xcc, 0xd9, 0x16, + 0x91, 0x63, 0x0b, 0x18, 0x5b, 0x77, 0x1d, 0x65, 0xc5, 0xcf, 0x1e, 0x7a, 0x10, 0x2e, 0xd8, 0x16, + 0xf1, 0x86, 0x08, 0x1f, 0x83, 0x05, 0xcf, 0x1a, 0x0c, 0xa4, 0x3c, 0x2b, 0x43, 0x36, 0x5c, 0x47, + 0x81, 0x93, 0x90, 0xc0, 0x89, 0x30, 0xb0, 0x2d, 0x12, 0xf0, 0xe9, 0x15, 0x32, 0x6c, 0xe1, 0x17, + 0x2a, 0x4c, 0x17, 0x0a, 0x3d, 0x08, 0x17, 0x0c, 0x5b, 0x84, 0x85, 0x3c, 0x6b, 0x58, 0x68, 0x6e, + 0xba, 0x50, 0xc4, 0x89, 0x30, 0x30, 0xec, 0x70, 0x70, 0xb0, 0x09, 0x56, 0x43, 0xb9, 0x70, 0xcb, + 0xa0, 0x96, 0xc9, 0x5a, 0xe5, 0xf9, 0xed, 0xec, 0xce, 0x72, 0x6c, 0x38, 0xe3, 0x9b, 0xa7, 0x7a, + 0xe8, 0x81, 0x6a, 0x5b, 0xae, 0xa3, 0x6c, 0xc6, 0x7f, 0x0f, 0x61, 0x34, 0xc2, 0x2b, 0x81, 0xe9, + 0x30, 0xb4, 0x4c, 0xab, 0x05, 0x53, 0x32, 0x4c, 0xd5, 0x92, 0xaa, 0x25, 0x59, 0x2d, 0x7f, 0x66, + 0xe2, 0xff, 0x40, 0x5e, 0x5b, 0xa6, 0xa0, 0xde, 0x5d, 0x30, 0xd5, 0xca, 0x8d, 0xd2, 0xca, 0x0e, + 0x58, 0xd1, 0x49, 0x87, 0xf1, 0xf7, 0x5d, 0x6a, 0xb4, 0x68, 0x8f, 0x32, 0x21, 0xa5, 0xb2, 0x88, + 0xa7, 0xcd, 0xe8, 0x6b, 0x3e, 0x7e, 0x4d, 0x3a, 0x20, 0x9d, 0xf4, 0x78, 0x48, 0x8f, 0x87, 0xc4, + 0xe3, 0x21, 0x49, 0x56, 0x20, 0x59, 0x56, 0x5f, 0xf2, 0xe0, 0x76, 0x54, 0x56, 0xc7, 0xfe, 0x70, + 0x52, 0x69, 0xa5, 0xd2, 0x4a, 0x94, 0x56, 0x0d, 0x9f, 0x5d, 0x54, 0xb3, 0xe7, 0x17, 0xd5, 0xec, + 0xf7, 0x8b, 0x6a, 0xf6, 0xd3, 0x65, 0x35, 0x73, 0x7e, 0x59, 0xcd, 0x7c, 0xbb, 0xac, 0x66, 0x4e, + 0x9e, 0xb4, 0x4c, 0xd1, 0x1e, 0x34, 0x55, 0xc2, 0x7b, 0x1a, 0xe1, 0x76, 0x8f, 0xdb, 0xc1, 0x67, + 0xd7, 0x36, 0x3a, 0xda, 0x07, 0x6d, 0xfc, 0xaa, 0xf6, 0x60, 0x7f, 0x37, 0x7c, 0x91, 0x13, 0xa3, + 0x3e, 0xb5, 0x9b, 0xb3, 0xf2, 0x59, 0xed, 0xd1, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4a, 0xbf, + 0x65, 0x34, 0xe9, 0x13, 0x00, 0x00, +} + +func (m *EventChannelOpenInit) 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 *EventChannelOpenInit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventChannelOpenInit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ConnectionId) > 0 { + i -= len(m.ConnectionId) + copy(dAtA[i:], m.ConnectionId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ConnectionId))) + i-- + dAtA[i] = 0x2a + } + if len(m.CounterpartyPortId) > 0 { + i -= len(m.CounterpartyPortId) + copy(dAtA[i:], m.CounterpartyPortId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.CounterpartyPortId))) + i-- + dAtA[i] = 0x1a + } + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0x12 + } + if len(m.PortId) > 0 { + i -= len(m.PortId) + copy(dAtA[i:], m.PortId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.PortId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventChannelOpenTry) 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 *EventChannelOpenTry) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventChannelOpenTry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ConnectionId) > 0 { + i -= len(m.ConnectionId) + copy(dAtA[i:], m.ConnectionId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ConnectionId))) + i-- + dAtA[i] = 0x2a + } + if len(m.CounterpartyChannelId) > 0 { + i -= len(m.CounterpartyChannelId) + copy(dAtA[i:], m.CounterpartyChannelId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.CounterpartyChannelId))) + i-- + dAtA[i] = 0x22 + } + if len(m.CounterpartyPortId) > 0 { + i -= len(m.CounterpartyPortId) + copy(dAtA[i:], m.CounterpartyPortId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.CounterpartyPortId))) + i-- + dAtA[i] = 0x1a + } + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0x12 + } + if len(m.PortId) > 0 { + i -= len(m.PortId) + copy(dAtA[i:], m.PortId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.PortId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventChannelOpenAck) 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 *EventChannelOpenAck) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventChannelOpenAck) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ConnectionId) > 0 { + i -= len(m.ConnectionId) + copy(dAtA[i:], m.ConnectionId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ConnectionId))) + i-- + dAtA[i] = 0x2a + } + if len(m.CounterpartyChannelId) > 0 { + i -= len(m.CounterpartyChannelId) + copy(dAtA[i:], m.CounterpartyChannelId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.CounterpartyChannelId))) + i-- + dAtA[i] = 0x22 + } + if len(m.CounterpartyPortId) > 0 { + i -= len(m.CounterpartyPortId) + copy(dAtA[i:], m.CounterpartyPortId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.CounterpartyPortId))) + i-- + dAtA[i] = 0x1a + } + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0x12 + } + if len(m.PortId) > 0 { + i -= len(m.PortId) + copy(dAtA[i:], m.PortId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.PortId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventChannelOpenConfirm) 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 *EventChannelOpenConfirm) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventChannelOpenConfirm) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ConnectionId) > 0 { + i -= len(m.ConnectionId) + copy(dAtA[i:], m.ConnectionId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ConnectionId))) + i-- + dAtA[i] = 0x2a + } + if len(m.CounterpartyChannelId) > 0 { + i -= len(m.CounterpartyChannelId) + copy(dAtA[i:], m.CounterpartyChannelId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.CounterpartyChannelId))) + i-- + dAtA[i] = 0x22 + } + if len(m.CounterpartyPortId) > 0 { + i -= len(m.CounterpartyPortId) + copy(dAtA[i:], m.CounterpartyPortId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.CounterpartyPortId))) + i-- + dAtA[i] = 0x1a + } + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0x12 + } + if len(m.PortId) > 0 { + i -= len(m.PortId) + copy(dAtA[i:], m.PortId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.PortId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventChannelCloseInit) 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 *EventChannelCloseInit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventChannelCloseInit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ConnectionId) > 0 { + i -= len(m.ConnectionId) + copy(dAtA[i:], m.ConnectionId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ConnectionId))) + i-- + dAtA[i] = 0x2a + } + if len(m.CounterpartyChannelId) > 0 { + i -= len(m.CounterpartyChannelId) + copy(dAtA[i:], m.CounterpartyChannelId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.CounterpartyChannelId))) + i-- + dAtA[i] = 0x22 + } + if len(m.CounterpartyPortId) > 0 { + i -= len(m.CounterpartyPortId) + copy(dAtA[i:], m.CounterpartyPortId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.CounterpartyPortId))) + i-- + dAtA[i] = 0x1a + } + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0x12 + } + if len(m.PortId) > 0 { + i -= len(m.PortId) + copy(dAtA[i:], m.PortId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.PortId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventChannelCloseConfirm) 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 *EventChannelCloseConfirm) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventChannelCloseConfirm) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ConnectionId) > 0 { + i -= len(m.ConnectionId) + copy(dAtA[i:], m.ConnectionId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ConnectionId))) + i-- + dAtA[i] = 0x2a + } + if len(m.CounterpartyChannelId) > 0 { + i -= len(m.CounterpartyChannelId) + copy(dAtA[i:], m.CounterpartyChannelId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.CounterpartyChannelId))) + i-- + dAtA[i] = 0x22 + } + if len(m.CounterpartyPortId) > 0 { + i -= len(m.CounterpartyPortId) + copy(dAtA[i:], m.CounterpartyPortId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.CounterpartyPortId))) + i-- + dAtA[i] = 0x1a + } + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0x12 + } + if len(m.PortId) > 0 { + i -= len(m.PortId) + copy(dAtA[i:], m.PortId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.PortId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventChannelSendPacket) 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 *EventChannelSendPacket) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventChannelSendPacket) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ChannelOrdering != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.ChannelOrdering)) + i-- + dAtA[i] = 0x48 + } + if len(m.DstChannel) > 0 { + i -= len(m.DstChannel) + copy(dAtA[i:], m.DstChannel) + i = encodeVarintEvents(dAtA, i, uint64(len(m.DstChannel))) + i-- + dAtA[i] = 0x42 + } + if len(m.DstPort) > 0 { + i -= len(m.DstPort) + copy(dAtA[i:], m.DstPort) + i = encodeVarintEvents(dAtA, i, uint64(len(m.DstPort))) + i-- + dAtA[i] = 0x3a + } + if len(m.SrcChannel) > 0 { + i -= len(m.SrcChannel) + copy(dAtA[i:], m.SrcChannel) + i = encodeVarintEvents(dAtA, i, uint64(len(m.SrcChannel))) + i-- + dAtA[i] = 0x32 + } + if len(m.SrcPort) > 0 { + i -= len(m.SrcPort) + copy(dAtA[i:], m.SrcPort) + i = encodeVarintEvents(dAtA, i, uint64(len(m.SrcPort))) + i-- + dAtA[i] = 0x2a + } + if m.Sequence != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.Sequence)) + i-- + dAtA[i] = 0x20 + } + if m.TimeoutTimestamp != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.TimeoutTimestamp)) + i-- + dAtA[i] = 0x18 + } + { + size, err := m.TimeoutHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventChannelRecvPacket) 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 *EventChannelRecvPacket) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventChannelRecvPacket) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ChannelOrdering != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.ChannelOrdering)) + i-- + dAtA[i] = 0x48 + } + if len(m.DstChannel) > 0 { + i -= len(m.DstChannel) + copy(dAtA[i:], m.DstChannel) + i = encodeVarintEvents(dAtA, i, uint64(len(m.DstChannel))) + i-- + dAtA[i] = 0x42 + } + if len(m.DstPort) > 0 { + i -= len(m.DstPort) + copy(dAtA[i:], m.DstPort) + i = encodeVarintEvents(dAtA, i, uint64(len(m.DstPort))) + i-- + dAtA[i] = 0x3a + } + if len(m.SrcChannel) > 0 { + i -= len(m.SrcChannel) + copy(dAtA[i:], m.SrcChannel) + i = encodeVarintEvents(dAtA, i, uint64(len(m.SrcChannel))) + i-- + dAtA[i] = 0x32 + } + if len(m.SrcPort) > 0 { + i -= len(m.SrcPort) + copy(dAtA[i:], m.SrcPort) + i = encodeVarintEvents(dAtA, i, uint64(len(m.SrcPort))) + i-- + dAtA[i] = 0x2a + } + if m.Sequence != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.Sequence)) + i-- + dAtA[i] = 0x20 + } + if m.TimeoutTimestamp != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.TimeoutTimestamp)) + i-- + dAtA[i] = 0x18 + } + { + size, err := m.TimeoutHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventChannelWriteAck) 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 *EventChannelWriteAck) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventChannelWriteAck) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Acknowledgement) > 0 { + i -= len(m.Acknowledgement) + copy(dAtA[i:], m.Acknowledgement) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Acknowledgement))) + i-- + dAtA[i] = 0x4a + } + if len(m.DstChannel) > 0 { + i -= len(m.DstChannel) + copy(dAtA[i:], m.DstChannel) + i = encodeVarintEvents(dAtA, i, uint64(len(m.DstChannel))) + i-- + dAtA[i] = 0x42 + } + if len(m.DstPort) > 0 { + i -= len(m.DstPort) + copy(dAtA[i:], m.DstPort) + i = encodeVarintEvents(dAtA, i, uint64(len(m.DstPort))) + i-- + dAtA[i] = 0x3a + } + if len(m.SrcChannel) > 0 { + i -= len(m.SrcChannel) + copy(dAtA[i:], m.SrcChannel) + i = encodeVarintEvents(dAtA, i, uint64(len(m.SrcChannel))) + i-- + dAtA[i] = 0x32 + } + if len(m.SrcPort) > 0 { + i -= len(m.SrcPort) + copy(dAtA[i:], m.SrcPort) + i = encodeVarintEvents(dAtA, i, uint64(len(m.SrcPort))) + i-- + dAtA[i] = 0x2a + } + if m.Sequence != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.Sequence)) + i-- + dAtA[i] = 0x20 + } + if m.TimeoutTimestamp != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.TimeoutTimestamp)) + i-- + dAtA[i] = 0x18 + } + { + size, err := m.TimeoutHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventChannelAckPacket) 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 *EventChannelAckPacket) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventChannelAckPacket) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Acknowledgement) > 0 { + i -= len(m.Acknowledgement) + copy(dAtA[i:], m.Acknowledgement) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Acknowledgement))) + i-- + dAtA[i] = 0x52 + } + if m.ChannelOrdering != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.ChannelOrdering)) + i-- + dAtA[i] = 0x48 + } + if len(m.DstChannel) > 0 { + i -= len(m.DstChannel) + copy(dAtA[i:], m.DstChannel) + i = encodeVarintEvents(dAtA, i, uint64(len(m.DstChannel))) + i-- + dAtA[i] = 0x42 + } + if len(m.DstPort) > 0 { + i -= len(m.DstPort) + copy(dAtA[i:], m.DstPort) + i = encodeVarintEvents(dAtA, i, uint64(len(m.DstPort))) + i-- + dAtA[i] = 0x3a + } + if len(m.SrcChannel) > 0 { + i -= len(m.SrcChannel) + copy(dAtA[i:], m.SrcChannel) + i = encodeVarintEvents(dAtA, i, uint64(len(m.SrcChannel))) + i-- + dAtA[i] = 0x32 + } + if len(m.SrcPort) > 0 { + i -= len(m.SrcPort) + copy(dAtA[i:], m.SrcPort) + i = encodeVarintEvents(dAtA, i, uint64(len(m.SrcPort))) + i-- + dAtA[i] = 0x2a + } + if m.Sequence != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.Sequence)) + i-- + dAtA[i] = 0x20 + } + if m.TimeoutTimestamp != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.TimeoutTimestamp)) + i-- + dAtA[i] = 0x18 + } + { + size, err := m.TimeoutHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventChannelTimeoutPacket) 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 *EventChannelTimeoutPacket) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventChannelTimeoutPacket) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ChannelOrdering != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.ChannelOrdering)) + i-- + dAtA[i] = 0x48 + } + if len(m.DstChannel) > 0 { + i -= len(m.DstChannel) + copy(dAtA[i:], m.DstChannel) + i = encodeVarintEvents(dAtA, i, uint64(len(m.DstChannel))) + i-- + dAtA[i] = 0x42 + } + if len(m.DstPort) > 0 { + i -= len(m.DstPort) + copy(dAtA[i:], m.DstPort) + i = encodeVarintEvents(dAtA, i, uint64(len(m.DstPort))) + i-- + dAtA[i] = 0x3a + } + if len(m.SrcChannel) > 0 { + i -= len(m.SrcChannel) + copy(dAtA[i:], m.SrcChannel) + i = encodeVarintEvents(dAtA, i, uint64(len(m.SrcChannel))) + i-- + dAtA[i] = 0x32 + } + if len(m.SrcPort) > 0 { + i -= len(m.SrcPort) + copy(dAtA[i:], m.SrcPort) + i = encodeVarintEvents(dAtA, i, uint64(len(m.SrcPort))) + i-- + dAtA[i] = 0x2a + } + if m.Sequence != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.Sequence)) + i-- + dAtA[i] = 0x20 + } + if m.TimeoutTimestamp != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.TimeoutTimestamp)) + i-- + dAtA[i] = 0x18 + } + { + size, err := m.TimeoutHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { + offset -= sovEvents(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EventChannelOpenInit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PortId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.CounterpartyPortId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.ConnectionId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventChannelOpenTry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PortId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.CounterpartyPortId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.CounterpartyChannelId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.ConnectionId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventChannelOpenAck) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PortId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.CounterpartyPortId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.CounterpartyChannelId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.ConnectionId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventChannelOpenConfirm) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PortId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.CounterpartyPortId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.CounterpartyChannelId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.ConnectionId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventChannelCloseInit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PortId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.CounterpartyPortId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.CounterpartyChannelId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.ConnectionId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventChannelCloseConfirm) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PortId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.CounterpartyPortId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.CounterpartyChannelId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.ConnectionId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventChannelSendPacket) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Data) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = m.TimeoutHeight.Size() + n += 1 + l + sovEvents(uint64(l)) + if m.TimeoutTimestamp != 0 { + n += 1 + sovEvents(uint64(m.TimeoutTimestamp)) + } + if m.Sequence != 0 { + n += 1 + sovEvents(uint64(m.Sequence)) + } + l = len(m.SrcPort) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.SrcChannel) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.DstPort) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.DstChannel) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + if m.ChannelOrdering != 0 { + n += 1 + sovEvents(uint64(m.ChannelOrdering)) + } + return n +} + +func (m *EventChannelRecvPacket) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Data) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = m.TimeoutHeight.Size() + n += 1 + l + sovEvents(uint64(l)) + if m.TimeoutTimestamp != 0 { + n += 1 + sovEvents(uint64(m.TimeoutTimestamp)) + } + if m.Sequence != 0 { + n += 1 + sovEvents(uint64(m.Sequence)) + } + l = len(m.SrcPort) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.SrcChannel) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.DstPort) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.DstChannel) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + if m.ChannelOrdering != 0 { + n += 1 + sovEvents(uint64(m.ChannelOrdering)) + } + return n +} + +func (m *EventChannelWriteAck) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Data) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = m.TimeoutHeight.Size() + n += 1 + l + sovEvents(uint64(l)) + if m.TimeoutTimestamp != 0 { + n += 1 + sovEvents(uint64(m.TimeoutTimestamp)) + } + if m.Sequence != 0 { + n += 1 + sovEvents(uint64(m.Sequence)) + } + l = len(m.SrcPort) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.SrcChannel) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.DstPort) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.DstChannel) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.Acknowledgement) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventChannelAckPacket) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Data) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = m.TimeoutHeight.Size() + n += 1 + l + sovEvents(uint64(l)) + if m.TimeoutTimestamp != 0 { + n += 1 + sovEvents(uint64(m.TimeoutTimestamp)) + } + if m.Sequence != 0 { + n += 1 + sovEvents(uint64(m.Sequence)) + } + l = len(m.SrcPort) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.SrcChannel) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.DstPort) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.DstChannel) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + if m.ChannelOrdering != 0 { + n += 1 + sovEvents(uint64(m.ChannelOrdering)) + } + l = len(m.Acknowledgement) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventChannelTimeoutPacket) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Data) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = m.TimeoutHeight.Size() + n += 1 + l + sovEvents(uint64(l)) + if m.TimeoutTimestamp != 0 { + n += 1 + sovEvents(uint64(m.TimeoutTimestamp)) + } + if m.Sequence != 0 { + n += 1 + sovEvents(uint64(m.Sequence)) + } + l = len(m.SrcPort) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.SrcChannel) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.DstPort) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.DstChannel) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + if m.ChannelOrdering != 0 { + n += 1 + sovEvents(uint64(m.ChannelOrdering)) + } + return n +} + +func sovEvents(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvents(x uint64) (n int) { + return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EventChannelOpenInit) 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 ErrIntOverflowEvents + } + 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: EventChannelOpenInit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventChannelOpenInit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyPortId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterpartyPortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConnectionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventChannelOpenTry) 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 ErrIntOverflowEvents + } + 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: EventChannelOpenTry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventChannelOpenTry: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyPortId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterpartyPortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterpartyChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConnectionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventChannelOpenAck) 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 ErrIntOverflowEvents + } + 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: EventChannelOpenAck: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventChannelOpenAck: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyPortId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterpartyPortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterpartyChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConnectionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventChannelOpenConfirm) 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 ErrIntOverflowEvents + } + 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: EventChannelOpenConfirm: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventChannelOpenConfirm: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyPortId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterpartyPortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterpartyChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConnectionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventChannelCloseInit) 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 ErrIntOverflowEvents + } + 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: EventChannelCloseInit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventChannelCloseInit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyPortId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterpartyPortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterpartyChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConnectionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventChannelCloseConfirm) 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 ErrIntOverflowEvents + } + 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: EventChannelCloseConfirm: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventChannelCloseConfirm: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyPortId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterpartyPortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterpartyChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConnectionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventChannelSendPacket) 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 ErrIntOverflowEvents + } + 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: EventChannelSendPacket: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventChannelSendPacket: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TimeoutHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutTimestamp", wireType) + } + m.TimeoutTimestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TimeoutTimestamp |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) + } + m.Sequence = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Sequence |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SrcPort", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SrcPort = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SrcChannel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SrcChannel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DstPort", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DstPort = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DstChannel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DstChannel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelOrdering", wireType) + } + m.ChannelOrdering = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChannelOrdering |= Order(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventChannelRecvPacket) 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 ErrIntOverflowEvents + } + 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: EventChannelRecvPacket: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventChannelRecvPacket: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TimeoutHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutTimestamp", wireType) + } + m.TimeoutTimestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TimeoutTimestamp |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) + } + m.Sequence = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Sequence |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SrcPort", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SrcPort = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SrcChannel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SrcChannel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DstPort", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DstPort = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DstChannel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DstChannel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelOrdering", wireType) + } + m.ChannelOrdering = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChannelOrdering |= Order(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventChannelWriteAck) 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 ErrIntOverflowEvents + } + 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: EventChannelWriteAck: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventChannelWriteAck: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TimeoutHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutTimestamp", wireType) + } + m.TimeoutTimestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TimeoutTimestamp |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) + } + m.Sequence = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Sequence |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SrcPort", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SrcPort = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SrcChannel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SrcChannel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DstPort", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DstPort = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DstChannel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DstChannel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Acknowledgement", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Acknowledgement = append(m.Acknowledgement[:0], dAtA[iNdEx:postIndex]...) + if m.Acknowledgement == nil { + m.Acknowledgement = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventChannelAckPacket) 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 ErrIntOverflowEvents + } + 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: EventChannelAckPacket: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventChannelAckPacket: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TimeoutHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutTimestamp", wireType) + } + m.TimeoutTimestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TimeoutTimestamp |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) + } + m.Sequence = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Sequence |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SrcPort", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SrcPort = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SrcChannel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SrcChannel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DstPort", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DstPort = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DstChannel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DstChannel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelOrdering", wireType) + } + m.ChannelOrdering = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChannelOrdering |= Order(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Acknowledgement", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Acknowledgement = append(m.Acknowledgement[:0], dAtA[iNdEx:postIndex]...) + if m.Acknowledgement == nil { + m.Acknowledgement = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventChannelTimeoutPacket) 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 ErrIntOverflowEvents + } + 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: EventChannelTimeoutPacket: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventChannelTimeoutPacket: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TimeoutHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutTimestamp", wireType) + } + m.TimeoutTimestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TimeoutTimestamp |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) + } + m.Sequence = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Sequence |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SrcPort", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SrcPort = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SrcChannel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SrcChannel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DstPort", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DstPort = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DstChannel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DstChannel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelOrdering", wireType) + } + m.ChannelOrdering = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChannelOrdering |= Order(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvents(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthEvents + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvents + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvents + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/ibc/core/keeper/msg_server.go b/x/ibc/core/keeper/msg_server.go index 2b655ff9a2fc..46a83eb19bbf 100644 --- a/x/ibc/core/keeper/msg_server.go +++ b/x/ibc/core/keeper/msg_server.go @@ -36,18 +36,15 @@ func (k Keeper) CreateClient(goCtx context.Context, msg *clienttypes.MsgCreateCl 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), - ), - }) + if err := ctx.EventManager().EmitTypedEvent( + &clienttypes.EventCreateClient{ + ClientId: msg.ClientId, + ClientType: clientState.ClientType(), + ConsensusHeight: clientState.GetLatestHeight().(clienttypes.Height), + }, + ); err != nil { + return nil, err + } return &clienttypes.MsgCreateClientResponse{}, nil } @@ -65,13 +62,6 @@ func (k Keeper) UpdateClient(goCtx context.Context, msg *clienttypes.MsgUpdateCl return nil, err } - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, clienttypes.AttributeValueCategory), - ), - ) - return &clienttypes.MsgUpdateClientResponse{}, nil } @@ -93,13 +83,6 @@ func (k Keeper) UpgradeClient(goCtx context.Context, msg *clienttypes.MsgUpgrade return nil, err } - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, clienttypes.AttributeValueCategory), - ), - ) - return &clienttypes.MsgUpgradeClientResponse{}, nil } @@ -116,14 +99,15 @@ func (k Keeper) SubmitMisbehaviour(goCtx context.Context, msg *clienttypes.MsgSu 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()), - ), - ) + if err := ctx.EventManager().EmitTypedEvent( + &clienttypes.EventClientMisbehaviour{ + ClientId: msg.ClientId, + ClientType: misbehaviour.ClientType(), + ConsensusHeight: misbehaviour.GetHeight().(clienttypes.Height), + }, + ); err != nil { + return nil, err + } return &clienttypes.MsgSubmitMisbehaviourResponse{}, nil } @@ -137,19 +121,15 @@ func (k Keeper) ConnectionOpenInit(goCtx context.Context, msg *connectiontypes.M return nil, sdkerrors.Wrap(err, "connection handshake open init failed") } - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - connectiontypes.EventTypeConnectionOpenInit, - sdk.NewAttribute(connectiontypes.AttributeKeyConnectionID, 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), - ), - }) + if err := ctx.EventManager().EmitTypedEvent( + &connectiontypes.EventConnectionOpenInit{ + ConnectionId: connectionID, + ClientId: msg.ClientId, + CounterpartyClientId: msg.Counterparty.ClientId, + }, + ); err != nil { + return nil, err + } return &connectiontypes.MsgConnectionOpenInitResponse{}, nil } @@ -172,19 +152,16 @@ func (k Keeper) ConnectionOpenTry(goCtx context.Context, msg *connectiontypes.Ms return nil, sdkerrors.Wrap(err, "connection handshake open try failed") } - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - connectiontypes.EventTypeConnectionOpenTry, - sdk.NewAttribute(connectiontypes.AttributeKeyConnectionID, 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), - ), - }) + if err := ctx.EventManager().EmitTypedEvent( + &connectiontypes.EventConnectionOpenTry{ + ConnectionId: connectionID, + ClientId: msg.ClientId, + CounterpartyClientId: msg.Counterparty.ClientId, + CounterpartyConnectionId: msg.Counterparty.ConnectionId, + }, + ); err != nil { + return nil, err + } return &connectiontypes.MsgConnectionOpenTryResponse{}, nil } @@ -207,19 +184,16 @@ func (k Keeper) ConnectionOpenAck(goCtx context.Context, msg *connectiontypes.Ms 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), - ), - }) + if err := ctx.EventManager().EmitTypedEvent( + &connectiontypes.EventConnectionOpenAck{ + ConnectionId: msg.ConnectionId, + ClientId: connectionEnd.ClientId, + CounterpartyClientId: connectionEnd.Counterparty.ClientId, + CounterpartyConnectionId: connectionEnd.Counterparty.ConnectionId, + }, + ); err != nil { + return nil, err + } return &connectiontypes.MsgConnectionOpenAckResponse{}, nil } @@ -236,19 +210,16 @@ func (k Keeper) ConnectionOpenConfirm(goCtx context.Context, msg *connectiontype 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), - ), - }) + if err := ctx.EventManager().EmitTypedEvent( + &connectiontypes.EventConnectionOpenConfirm{ + ConnectionId: msg.ConnectionId, + ClientId: connectionEnd.ClientId, + CounterpartyClientId: connectionEnd.Counterparty.ClientId, + CounterpartyConnectionId: connectionEnd.Counterparty.ConnectionId, + }, + ); err != nil { + return nil, err + } return &connectiontypes.MsgConnectionOpenConfirmResponse{}, nil } diff --git a/x/ibc/core/spec/06_events.md b/x/ibc/core/spec/06_events.md index 528a30cffa41..af92ad727e94 100644 --- a/x/ibc/core/spec/06_events.md +++ b/x/ibc/core/spec/06_events.md @@ -6,8 +6,7 @@ order: 6 The IBC module emits the following events. It can be expected that the type `message`, with an attirbute key of `action` will represent the first event for each message -being processed as emitted by the SDK's baseapp. Each IBC TAO message will -also emit its module name in the format 'ibc_sub-modulename'. +being processed as emitted by the SDK's baseapp. All the events for the Channel handshakes, `SendPacket`, `RecvPacket`, `AcknowledgePacket`, `TimeoutPacket` and `TimeoutOnClose` will emit additional events not specified here due to @@ -17,43 +16,50 @@ callbacks to IBC applications. ### MsgCreateClient -| Type | Attribute Key | Attribute Value | -|---------------|------------------|-------------------| -| create_client | client_id | {clientId} | -| create_client | client_type | {clientType} | -| create_client | consensus_height | {consensusHeight} | -| message | action | create_client | -| message | module | ibc_client | +| Type | Attribute Key | Attribute Value | +|--------------------------------------|------------------|-------------------| +| ibc-core-client-v1-EventCreateClient | client_id | {clientId} | +| ibc-core-client-v1-EventCreateClient | client_type | {clientType} | +| ibc-core-client-v1-EventCreateClient | consensus_height | {consensusHeight} | +| message | action | create_client | ### MsgUpdateClient -| Type | Attribute Key | Attribute Value | -|---------------|------------------|-------------------| -| update_client | client_id | {clientId} | -| update_client | client_type | {clientType} | -| update_client | consensus_height | {consensusHeight} | -| message | action | update_client | -| message | module | ibc_client | +| Type | Attribute Key | Attribute Value | +|--------------------------------------|------------------|-------------------| +| ibc-core-client-v1-EventUpdateClient | client_id | {clientId} | +| ibc-core-client-v1-EventUpdateClient | client_type | {clientType} | +| ibc-core-client-v1-EventUpdateClient | consensus_height | {consensusHeight} | +| message | action | update_client | + +### MsgUpgradeClient + +| Type | Attribute Key | Attribute Value | +|---------------------------------------|------------------|-------------------| +| ibc-core-client-v1-EventUpgradeClient | client_id | {clientId} | +| ibc-core-client-v1-EventUpgradeClient | client_type | {clientType} | +| ibc-core-client-v1-EventUpgradeClient | consensus_height | {consensusHeight} | +| message | action | upgrade_client | ### MsgSubmitMisbehaviour -| Type | Attribute Key | Attribute Value | -|---------------------|------------------|---------------------| -| client_misbehaviour | client_id | {clientId} | -| client_misbehaviour | client_type | {clientType} | -| client_misbehaviour | consensus_height | {consensusHeight} | -| message | action | client_misbehaviour | -| message | module | evidence | -| message | sender | {senderAddress} | -| submit_evidence | evidence_hash | {evidenceHash} | +| Type | Attribute Key | Attribute Value | +|--------------------------------------------|------------------|---------------------| +| ibc-core-client-v1-EventClientMisbehaviour | client_id | {clientId} | +| ibc-core-client-v1-EventClientMisbehaviour | client_type | {clientType} | +| ibc-core-client-v1-EventClientMisbehaviour | consensus_height | {consensusHeight} | +| message | action | client_misbehaviour | +| message | module | evidence | +| message | sender | {senderAddress} | +| submit_evidence | evidence_hash | {evidenceHash} | ### UpdateClientProposal -| Type | Attribute Key | Attribute Value | -|------------------------|------------------|-------------------| -| update_client_proposal | client_id | {clientId} | -| update_client_proposal | client_type | {clientType} | -| update_client_proposal | consensus_height | {consensusHeight} | +| Type | Attribute Key | Attribute Value | +|----------------------------------------------|------------------|-------------------| +| ibc-core-client-v1-EventUpdateClientProposal | client_id | {clientId} | +| ibc-core-client-v1-EventUpdateClientProposal | client_type | {clientType} | +| ibc-core-client-v1-EventUpdateClientProposal | consensus_height | {consensusHeight} | @@ -61,181 +67,183 @@ callbacks to IBC applications. ### MsgConnectionOpenInit -| Type | Attribute Key | Attribute Value | -|----------------------|----------------------------|-----------------------------| -| connection_open_init | connection_id | {connectionId} | -| connection_open_init | client_id | {clientId} | -| connection_open_init | counterparty_client_id | {counterparty.clientId} | -| message | action | connection_open_init | -| message | module | ibc_connection | +| Type | Attribute Key | Attribute Value | +|------------------------------------------------|----------------------------|-----------------------------| +| ibc-core-connection-v1-EventConnectionOpenInit | connection_id | {connectionId} | +| ibc-core-connection-v1-EventConnectionOpenInit | client_id | {clientId} | +| ibc-core-connection-v1-EventConnectionOpenInit | counterparty_client_id | {counterparty.clientId} | +| message | action | connection_open_init | ### MsgConnectionOpenTry -| Type | Attribute Key | Attribute Value | -|---------------------|----------------------------|-----------------------------| -| connection_open_try | connection_id | {connectionId} | -| connection_open_try | client_id | {clientId} | -| connection_open_try | counterparty_client_id | {counterparty.clientId | -| connection_open_try | counterparty_connection_id | {counterparty.connectionId} | -| message | action | connection_open_try | -| message | module | ibc_connection | +| Type | Attribute Key | Attribute Value | +|-----------------------------------------------|----------------------------|-----------------------------| +| ibc-core-connection-v1-EventConnectionOpenTry | connection_id | {connectionId} | +| ibc-core-connection-v1-EventConnectionOpenTry | client_id | {clientId} | +| ibc-core-connection-v1-EventConnectionOpenTry | counterparty_client_id | {counterparty.clientId | +| ibc-core-connection-v1-EventConnectionOpenTry | counterparty_connection_id | {counterparty.connectionId} | +| message | action | connection_open_try | ### MsgConnectionOpenAck -| Type | Attribute Key | Attribute Value | -|----------------------|----------------------------|-----------------------------| -| connection_open_ack | connection_id | {connectionId} | -| connection_open_ack | client_id | {clientId} | -| connection_open_ack | counterparty_client_id | {counterparty.clientId} | -| connection_open_ack | counterparty_connection_id | {counterparty.connectionId} | -| message | module | ibc_connection | -| message | action | connection_open_ack | +| Type | Attribute Key | Attribute Value | +|------------------------------------------------|----------------------------|-----------------------------| +| ibc-core-connection-v1-EventConnectionOpenAck | connection_id | {connectionId} | +| ibc-core-connection-v1-EventConnectionOpenAck | client_id | {clientId} | +| ibc-core-connection-v1-EventConnectionOpenAck | counterparty_client_id | {counterparty.clientId} | +| ibc-core-connection-v1-EventConnectionOpenAck | counterparty_connection_id | {counterparty.connectionId} | +| message | action | connection_open_ack | ### MsgConnectionOpenConfirm -| Type | Attribute Key | Attribute Value | -|-------------------------|----------------------------|-----------------------------| -| connection_open_confirm | connection_id | {connectionId} | -| connection_open_confirm | client_id | {clientId} | -| connection_open_confirm | counterparty_client_id | {counterparty.clientId} | -| connection_open_confirm | counterparty_connection_id | {counterparty.connectionId} | -| message | action | connection_open_confirm | -| message | module | ibc_connection | +| Type | Attribute Key | Attribute Value | +|---------------------------------------------------|----------------------------|-----------------------------| +| ibc-core-connection-v1-EventConnectionOpenConfirm | connection_id | {connectionId} | +| ibc-core-connection-v1-EventConnectionOpenConfirm | client_id | {clientId} | +| ibc-core-connection-v1-EventConnectionOpenConfirm | counterparty_client_id | {counterparty.clientId} | +| ibc-core-connection-v1-EventConnectionOpenConfirm | counterparty_connection_id | {counterparty.connectionId} | +| message | action | connection_open_confirm | ## ICS 04 - Channel ### MsgChannelOpenInit -| Type | Attribute Key | Attribute Value | -|-------------------|-------------------------|----------------------------------| -| channel_open_init | port_id | {portId} | -| channel_open_init | channel_id | {channelId} | -| channel_open_init | counterparty_port_id | {channel.counterparty.portId} | -| channel_open_init | connection_id | {channel.connectionHops} | -| message | action | channel_open_init | -| message | module | ibc_channel | +| Type | Attribute Key | Attribute Value | +|------------------------------------------|-------------------------|----------------------------------| +| ibc-core-channel-v1-EventChannelOpenInit | port_id | {portId} | +| ibc-core-channel-v1-EventChannelOpenInit | channel_id | {channelId} | +| ibc-core-channel-v1-EventChannelOpenInit | counterparty_port_id | {channel.counterparty.portId} | +| ibc-core-channel-v1-EventChannelOpenInit | connection_id | {channel.connectionHops} | +| message | action | channel_open_init | ### MsgChannelOpenTry -| Type | Attribute Key | Attribute Value | -|------------------|-------------------------|----------------------------------| -| channel_open_try | port_id | {portId} | -| channel_open_try | channel_id | {channelId} | -| channel_open_try | counterparty_port_id | {channel.counterparty.portId} | -| channel_open_try | counterparty_channel_id | {channel.counterparty.channelId} | -| channel_open_try | connection_id | {channel.connectionHops} | -| message | action | channel_open_try | -| message | module | ibc_channel | +| Type | Attribute Key | Attribute Value | +|-----------------------------------------|-------------------------|----------------------------------| +| ibc-core-channel-v1-EventChannelOpenTry | port_id | {portId} | +| ibc-core-channel-v1-EventChannelOpenTry | channel_id | {channelId} | +| ibc-core-channel-v1-EventChannelOpenTry | counterparty_port_id | {channel.counterparty.portId} | +| ibc-core-channel-v1-EventChannelOpenTry | counterparty_channel_id | {channel.counterparty.channelId} | +| ibc-core-channel-v1-EventChannelOpenTry | connection_id | {channel.connectionHops} | +| message | action | channel_open_try | ### MsgChannelOpenAck -| Type | Attribute Key | Attribute Value | -|------------------|-------------------------|----------------------------------| -| channel_open_ack | port_id | {portId} | -| channel_open_ack | channel_id | {channelId} | -| channel_open_ack | counterparty_port_id | {channel.counterparty.portId} | -| channel_open_ack | counterparty_channel_id | {channel.counterparty.channelId} | -| channel_open_ack | connection_id | {channel.connectionHops} | -| message | action | channel_open_ack | -| message | module | ibc_channel | +| Type | Attribute Key | Attribute Value | +|-----------------------------------------|-------------------------|----------------------------------| +| ibc-core-channel-v1-EventChannelOpenAck | port_id | {portId} | +| ibc-core-channel-v1-EventChannelOpenAck | channel_id | {channelId} | +| ibc-core-channel-v1-EventChannelOpenAck | counterparty_port_id | {channel.counterparty.portId} | +| ibc-core-channel-v1-EventChannelOpenAck | counterparty_channel_id | {channel.counterparty.channelId} | +| ibc-core-channel-v1-EventChannelOpenAck | connection_id | {channel.connectionHops} | +| message | action | channel_open_ack | ### MsgChannelOpenConfirm -| Type | Attribute Key | Attribute Value | -|----------------------|-------------------------|----------------------------------| -| channel_open_confirm | port_id | {portId} | -| channel_open_confirm | channel_id | {channelId} | -| channel_open_confirm | counterparty_port_id | {channel.counterparty.portId} | -| channel_open_confirm | counterparty_channel_id | {channel.counterparty.channelId} | -| channel_open_confirm | connection_id | {channel.connectionHops} | -| message | module | ibc_channel | -| message | action | channel_open_confirm | +| Type | Attribute Key | Attribute Value | +|---------------------------------------------|-------------------------|----------------------------------| +| ibc-core-channel-v1-EventChannelOpenConfirm | port_id | {portId} | +| ibc-core-channel-v1-EventChannelOpenConfirm | channel_id | {channelId} | +| ibc-core-channel-v1-EventChannelOpenConfirm | counterparty_port_id | {channel.counterparty.portId} | +| ibc-core-channel-v1-EventChannelOpenConfirm | counterparty_channel_id | {channel.counterparty.channelId} | +| ibc-core-channel-v1-EventChannelOpenConfirm | connection_id | {channel.connectionHops} | +| message | action | channel_open_confirm | ### MsgChannelCloseInit -| Type | Attribute Key | Attribute Value | -|--------------------|-------------------------|----------------------------------| -| channel_close_init | port_id | {portId} | -| channel_close_init | channel_id | {channelId} | -| channel_close_init | counterparty_port_id | {channel.counterparty.portId} | -| channel_close_init | counterparty_channel_id | {channel.counterparty.channelId} | -| channel_close_init | connection_id | {channel.connectionHops} | -| message | action | channel_close_init | -| message | module | ibc_channel | +| Type | Attribute Key | Attribute Value | +|-------------------------------------------|-------------------------|----------------------------------| +| ibc-core-channel-v1-EventChannelCloseInit | port_id | {portId} | +| ibc-core-channel-v1-EventChannelCloseInit | channel_id | {channelId} | +| ibc-core-channel-v1-EventChannelCloseInit | counterparty_port_id | {channel.counterparty.portId} | +| ibc-core-channel-v1-EventChannelCloseInit | counterparty_channel_id | {channel.counterparty.channelId} | +| ibc-core-channel-v1-EventChannelCloseInit | connection_id | {channel.connectionHops} | +| message | action | channel_close_init | ### MsgChannelCloseConfirm -| Type | Attribute Key | Attribute Value | -|-----------------------|-------------------------|----------------------------------| -| channel_close_confirm | port_id | {portId} | -| channel_close_confirm | channel_id | {channelId} | -| channel_close_confirm | counterparty_port_id | {channel.counterparty.portId} | -| channel_close_confirm | counterparty_channel_id | {channel.counterparty.channelId} | -| channel_close_confirm | connection_id | {channel.connectionHops} | -| message | action | channel_close_confirm | -| message | module | ibc_channel | +| Type | Attribute Key | Attribute Value | +|----------------------------------------------|-------------------------|----------------------------------| +| ibc-core-channel-v1-EventChannelCloseConfirm | port_id | {portId} | +| ibc-core-channel-v1-EventChannelCloseConfirm | channel_id | {channelId} | +| ibc-core-channel-v1-EventChannelCloseConfirm | counterparty_port_id | {channel.counterparty.portId} | +| ibc-core-channel-v1-EventChannelCloseConfirm | counterparty_channel_id | {channel.counterparty.channelId} | +| ibc-core-channel-v1-EventChannelCloseConfirm | connection_id | {channel.connectionHops} | +| message | action | channel_close_confirm | ### SendPacket (application module call) -| Type | Attribute Key | Attribute Value | -|-------------|--------------------------|----------------------------------| -| send_packet | packet_data | {data} | -| send_packet | packet_timeout_height | {timeoutHeight} | -| send_packet | packet_timeout_timestamp | {timeoutTimestamp} | -| send_packet | packet_sequence | {sequence} | -| send_packet | packet_src_port | {sourcePort} | -| send_packet | packet_src_channel | {sourceChannel} | -| send_packet | packet_dst_port | {destinationPort} | -| send_packet | packet_dst_channel | {destinationChannel} | -| send_packet | packet_channel_ordering | {channel.Ordering} | -| message | action | application-module-defined-field | -| message | module | ibc-channel | +| Type | Attribute Key | Attribute Value | +|--------------------------------------------|-------------------|----------------------------------| +| ibc-core-channel-v1-EventChannelSendPacket | data | {data} | +| ibc-core-channel-v1-EventChannelSendPacket | timeout_height | {timeoutHeight} | +| ibc-core-channel-v1-EventChannelSendPacket | timeout_timestamp | {timeoutTimestamp} | +| ibc-core-channel-v1-EventChannelSendPacket | sequence | {sequence} | +| ibc-core-channel-v1-EventChannelSendPacket | src_port | {sourcePort} | +| ibc-core-channel-v1-EventChannelSendPacket | src_channel | {sourceChannel} | +| ibc-core-channel-v1-EventChannelSendPacket | dst_port | {destinationPort} | +| ibc-core-channel-v1-EventChannelSendPacket | dst_channel | {destinationChannel} | +| ibc-core-channel-v1-EventChannelSendPacket | channel_ordering | {channel.Ordering} | +| message | action | application-module-defined-field | ### MsgRecvPacket -| Type | Attribute Key | Attribute Value | -|-------------|--------------------------|----------------------| -| recv_packet | packet_data | {data} | -| recv_packet | packet_ack | {acknowledgement} | -| recv_packet | packet_timeout_height | {timeoutHeight} | -| recv_packet | packet_timeout_timestamp | {timeoutTimestamp} | -| recv_packet | packet_sequence | {sequence} | -| recv_packet | packet_src_port | {sourcePort} | -| recv_packet | packet_src_channel | {sourceChannel} | -| recv_packet | packet_dst_port | {destinationPort} | -| recv_packet | packet_dst_channel | {destinationChannel} | -| recv_packet | packet_channel_ordering | {channel.Ordering} | -| message | action | recv_packet | -| message | module | ibc-channel | +| Type | Attribute Key | Attribute Value | +|--------------------------------------------|-------------------|----------------------| +| ibc-core-channel-v1-EventChannelRecvPacket | data | {data} | +| ibc-core-channel-v1-EventChannelRecvPacket | timeout_height | {timeoutHeight} | +| ibc-core-channel-v1-EventChannelRecvPacket | timeout_timestamp | {timeoutTimestamp} | +| ibc-core-channel-v1-EventChannelRecvPacket | sequence | {sequence} | +| ibc-core-channel-v1-EventChannelRecvPacket | src_port | {sourcePort} | +| ibc-core-channel-v1-EventChannelRecvPacket | src_channel | {sourceChannel} | +| ibc-core-channel-v1-EventChannelRecvPacket | dst_port | {destinationPort} | +| ibc-core-channel-v1-EventChannelRecvPacket | dst_channel | {destinationChannel} | +| ibc-core-channel-v1-EventChannelRecvPacket | channel_ordering | {channel.Ordering} | +| message | action | recv_packet | ### MsgAcknowledgePacket -| Type | Attribute Key | Attribute Value | -|--------------------|--------------------------|----------------------| -| acknowledge_packet | packet_timeout_height | {timeoutHeight} | -| acknowledge_packet | packet_timeout_timestamp | {timeoutTimestamp} | -| acknowledge_packet | packet_sequence | {sequence} | -| acknowledge_packet | packet_src_port | {sourcePort} | -| acknowledge_packet | packet_src_channel | {sourceChannel} | -| acknowledge_packet | packet_dst_port | {destinationPort} | -| acknowledge_packet | packet_dst_channel | {destinationChannel} | -| acknowledge_packet | packet_channel_ordering | {channel.Ordering} | -| message | action | acknowledge_packet | -| message | module | ibc-channel | +| Type | Attribute Key | Attribute Value | +|-------------------------------------------|-------------------|----------------------| +| ibc-core-channel-v1-EventChannelAckPacket | data | {data} | +| ibc-core-channel-v1-EventChannelAckPacket | timeout_height | {timeoutHeight} | +| ibc-core-channel-v1-EventChannelAckPacket | timeout_timestamp | {timeoutTimestamp} | +| ibc-core-channel-v1-EventChannelAckPacket | sequence | {sequence} | +| ibc-core-channel-v1-EventChannelAckPacket | src_port | {sourcePort} | +| ibc-core-channel-v1-EventChannelAckPacket | src_channel | {sourceChannel} | +| ibc-core-channel-v1-EventChannelAckPacket | dst_port | {destinationPort} | +| ibc-core-channel-v1-EventChannelAckPacket | dst_channel | {destinationChannel} | +| ibc-core-channel-v1-EventChannelAckPacket | channel_ordering | {channel.Ordering} | +| ibc-core-channel-v1-EventChannelAckPacket | acknowledgement | {acknowledgement} | +| message | action | acknowledge_packet | ### MsgTimeoutPacket & MsgTimeoutOnClose -| Type | Attribute Key | Attribute Value | -|----------------|--------------------------|----------------------| -| timeout_packet | packet_timeout_height | {timeoutHeight} | -| timeout_packet | packet_timeout_timestamp | {timeoutTimestamp} | -| timeout_packet | packet_sequence | {sequence} | -| timeout_packet | packet_src_port | {sourcePort} | -| timeout_packet | packet_src_channel | {sourceChannel} | -| timeout_packet | packet_dst_port | {destinationPort} | -| timeout_packet | packet_dst_channel | {destinationChannel} | -| timeout_packet | packet_channel_ordering | {channel.Ordering} | -| message | action | timeout_packet | -| message | module | ibc-channel | +| Type | Attribute Key | Attribute Value | +|-----------------------------------------------|-------------------|----------------------| +| ibc-core-channel-v1-EventChannelTimeoutPacket | data | {data} | +| ibc-core-channel-v1-EventChannelTimeoutPacket | timeout_height | {timeoutHeight} | +| ibc-core-channel-v1-EventChannelTimeoutPacket | timeout_timestamp | {timeoutTimestamp} | +| ibc-core-channel-v1-EventChannelTimeoutPacket | sequence | {sequence} | +| ibc-core-channel-v1-EventChannelTimeoutPacket | src_port | {sourcePort} | +| ibc-core-channel-v1-EventChannelTimeoutPacket | src_channel | {sourceChannel} | +| ibc-core-channel-v1-EventChannelTimeoutPacket | dst_port | {destinationPort} | +| ibc-core-channel-v1-EventChannelTimeoutPacket | dst_channel | {destinationChannel} | +| ibc-core-channel-v1-EventChannelTimeoutPacket | channel_ordering | {channel.Ordering} | +| message | action | timeout_packet | + +### WriteAcknowledgement + +| Type | Attribute Key | Attribute Value | +|------------------------------------------|-------------------|----------------------| +| ibc-core-channel-v1-EventChannelWriteAck | data | {data} | +| ibc-core-channel-v1-EventChannelWriteAck | timeout_height | {timeoutHeight} | +| ibc-core-channel-v1-EventChannelWriteAck | timeout_timestamp | {timeoutTimestamp} | +| ibc-core-channel-v1-EventChannelWriteAck | sequence | {sequence} | +| ibc-core-channel-v1-EventChannelWriteAck | src_port | {sourcePort} | +| ibc-core-channel-v1-EventChannelWriteAck | src_channel | {sourceChannel} | +| ibc-core-channel-v1-EventChannelWriteAck | dst_port | {destinationPort} | +| ibc-core-channel-v1-EventChannelWriteAck | dst_channel | {destinationChannel} | +| ibc-core-channel-v1-EventChannelWriteAck | acknowledgement | {acknowledgement} |