Skip to content

Commit

Permalink
fix TestOnChanOpenAck
Browse files Browse the repository at this point in the history
  • Loading branch information
mpoke committed May 16, 2023
1 parent 6041222 commit 70f20e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 1 addition & 2 deletions x/ccv/consumer/ibc_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ func (am AppModule) OnChanOpenAck(

// First check if an existing transfer channel already exists.
transChannelID := am.keeper.GetDistributionTransmissionChannel(ctx)
found := am.keeper.TransferChannelExists(ctx, transChannelID)
if found {
if found := am.keeper.TransferChannelExists(ctx, transChannelID); found {
return nil
}

Expand Down
7 changes: 6 additions & 1 deletion x/ccv/consumer/ibc_module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func TestOnChanOpenAck(t *testing.T) {
expPass bool
}{
{
"success",
"success - empty transferChannelID",
func(keeper *consumerkeeper.Keeper, params *params, mocks testkeeper.MockedKeepers) {
// Expected msg
distrTransferMsg := channeltypes.NewMsgChannelOpenInit(
Expand All @@ -224,8 +224,13 @@ func TestOnChanOpenAck(t *testing.T) {
"", // signer unused
)

transferChannelID := ""
keeper.SetDistributionTransmissionChannel(params.ctx, transferChannelID)

// Expected mock calls
gomock.InOrder(
mocks.MockChannelKeeper.EXPECT().GetChannel(
params.ctx, transfertypes.PortID, transferChannelID).Return(channeltypes.Channel{}, false).Times(1),
mocks.MockChannelKeeper.EXPECT().GetChannel(
params.ctx, params.portID, params.channelID).Return(channeltypes.Channel{
ConnectionHops: []string{"connectionID"},
Expand Down

0 comments on commit 70f20e3

Please sign in to comment.