Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanfrey committed May 4, 2022
1 parent b6a7963 commit 7704459
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions x/wasm/ibc.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ func (i IBCHandler) OnChanOpenTry(
return "", sdkerrors.Wrap(err, "claim capability")
}
}

// In the future, we can negotiate (see design comment above), but for now, we only error if we disagee
// with the proposed version
return counterpartyVersion, nil
}

Expand All @@ -137,6 +140,11 @@ func (i IBCHandler) OnChanOpenAck(
return sdkerrors.Wrapf(channeltypes.ErrChannelNotFound, "port ID (%s) channel ID (%s)", portID, channelID)
}
channelInfo.Counterparty.ChannelId = counterpartyChannelID
// This is a bit ugly, but it is set AFTER the callback is done, yet we want to provide the contract
// access to the channel in queries. We can revisit how to better integrate with ibc-go in the future,
// but this is the best/safest we can do now. (If you remove this, you error when sending a packet during the
// OnChanOpenAck entry point)
// https://github.com/cosmos/ibc-go/pull/647/files#diff-54b5be375a2333c56f2ae1b5b4dc13ac9c734561e30286505f39837ee75762c7R25
i.channelKeeper.SetChannel(ctx, portID, channelID, channelInfo)
msg := wasmvmtypes.IBCChannelConnectMsg{
OpenAck: &wasmvmtypes.IBCOpenAck{
Expand Down

0 comments on commit 7704459

Please sign in to comment.