Skip to content

Commit

Permalink
fix GetMsgResult to use ibc-solidity's ChannelUpgradeOpen event as Ev…
Browse files Browse the repository at this point in the history
…entUpgradeChannel

Signed-off-by: Masanori Yoshida <[email protected]>
  • Loading branch information
siburu committed Aug 30, 2024
1 parent f73f204 commit 1627ead
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/relay/ethereum/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ var (
abiSendPacket,
abiRecvPacket,
abiWriteAcknowledgement,
abiAcknowledgePacket abi.Event
abiAcknowledgePacket,
abiChannelUpgradeOpen abi.Event
)

func init() {
Expand All @@ -44,6 +45,7 @@ func init() {
abiRecvPacket = abiIBCHandler.Events["RecvPacket"]
abiWriteAcknowledgement = abiIBCHandler.Events["WriteAcknowledgement"]
abiAcknowledgePacket = abiIBCHandler.Events["AcknowledgePacket"]
abiChannelUpgradeOpen = abiIBCHandler.Events["ChannelUpgradeOpen"]
}

func (chain *Chain) findSentPackets(ctx core.QueryContext, fromHeight uint64) (core.PacketInfoList, error) {
Expand Down
10 changes: 10 additions & 0 deletions pkg/relay/ethereum/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,16 @@ func (c *Chain) parseMsgEventLogs(logs []*types.Log) ([]core.MsgEventLog, error)
TimeoutHeight: clienttypes.Height(ev.Packet.TimeoutHeight),
TimeoutTimestamp: time.Unix(0, int64(ev.Packet.TimeoutTimestamp)),
}
case abiChannelUpgradeOpen.ID:
ev, err := c.ibcHandler.ParseChannelUpgradeOpen(*log)
if err != nil {
return nil, fmt.Errorf("failed to parse ChannelUpgradeOpen event: logIndex=%d, log=%v", i, log)
}
event = &core.EventUpgradeChannel{
PortID: ev.PortId,
ChannelID: ev.ChannelId,
UpgradeSequence: ev.UpgradeSequence,
}
default:
event = &core.EventUnknown{Value: log}
}
Expand Down

0 comments on commit 1627ead

Please sign in to comment.