diff --git a/packages/cosmic-swingset/lib/ag-solo/vats/ibc.js b/packages/cosmic-swingset/lib/ag-solo/vats/ibc.js index 505a9e4716c..8007c325a09 100644 --- a/packages/cosmic-swingset/lib/ag-solo/vats/ibc.js +++ b/packages/cosmic-swingset/lib/ag-solo/vats/ibc.js @@ -199,7 +199,11 @@ export function makeIBCProtocolHandler( }, onReceive, async onClose(_conn, _reason, _handler) { - await callIBCDevice('channelCloseInit', { channelID, portID }); + const packet = { + source_port: portID, + source_channel: channelID, + }; + await callIBCDevice('channelCloseInit', { packet }); usedChannels.delete(channelID); usedChannels.delete(rChannelID); }, @@ -251,7 +255,10 @@ export function makeIBCProtocolHandler( }, async onBind(_port, localAddr, _protocolHandler) { const portID = localAddrToPortID(localAddr); - return callIBCDevice('bindPort', { portID }); + const packet = { + source_port: portID, + }; + return callIBCDevice('bindPort', { packet }); }, async onConnect(_port, localAddr, remoteAddr, _protocolHandler) { console.warn('IBC onConnect', localAddr, remoteAddr); diff --git a/packages/cosmic-swingset/x/swingset/ibc.go b/packages/cosmic-swingset/x/swingset/ibc.go index bdadbb33e2a..031c0c26fb0 100644 --- a/packages/cosmic-swingset/x/swingset/ibc.go +++ b/packages/cosmic-swingset/x/swingset/ibc.go @@ -23,8 +23,6 @@ type channelHandler struct { type channelMessage struct { // comes from swingset's IBC handler Type string `json:"type"` // IBC_METHOD Method string `json:"method"` - PortID string `json:"portID"` - ChannelID string `json:"channelID"` Packet channeltypes.Packet `json:"packet"` RelativeTimeout uint64 `json:"relativeTimeout"` Order channelexported.Order `json:"order"` @@ -110,13 +108,13 @@ func (ch channelHandler) Receive(ctx *ControllerContext, str string) (ret string } case "channelCloseInit": - err = ctx.Keeper.ChanCloseInit(ctx.Context, msg.PortID, msg.ChannelID) + err = ctx.Keeper.ChanCloseInit(ctx.Context, msg.Packet.SourcePort, msg.Packet.SourceChannel) if err == nil { ret = "true" } case "bindPort": - err = ctx.Keeper.BindPort(ctx.Context, msg.PortID) + err = ctx.Keeper.BindPort(ctx.Context, msg.Packet.SourcePort) if err == nil { ret = "true" }