Skip to content

Commit

Permalink
Fix relay tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanfrey committed Jul 28, 2021
1 parent cf85494 commit 0fe0b62
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions x/wasm/keeper/relay_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,13 @@ func TestOnOpenChannel(t *testing.T) {
before := ctx.GasMeter().GasConsumed()

// when
err := keepers.WasmKeeper.OnOpenChannel(ctx, spec.contractAddr, myChannel, "foo")
msg := wasmvmtypes.IBCChannelOpenMsg{
OpenTry: &wasmvmtypes.IBCOpenTry{
Channel: myChannel,
CounterpartyVersion: "foo",
},
}
err := keepers.WasmKeeper.OnOpenChannel(ctx, spec.contractAddr, msg)

// then
if spec.expErr {
Expand Down Expand Up @@ -163,7 +169,12 @@ func TestOnConnectChannel(t *testing.T) {
}

// when
err := keepers.WasmKeeper.OnConnectChannel(ctx, spec.contractAddr, myChannel, "")
msg := wasmvmtypes.IBCChannelConnectMsg{
OpenConfirm: &wasmvmtypes.IBCOpenConfirm{
Channel: myChannel,
},
}
err := keepers.WasmKeeper.OnConnectChannel(ctx, spec.contractAddr, msg)

// then
events := ctx.EventManager().Events()
Expand Down Expand Up @@ -279,7 +290,12 @@ func TestOnCloseChannel(t *testing.T) {
}

// when
err := keepers.WasmKeeper.OnCloseChannel(ctx, spec.contractAddr, myChannel, false)
msg := wasmvmtypes.IBCChannelCloseMsg{
CloseInit: &wasmvmtypes.IBCCloseInit{
Channel: myChannel,
},
}
err := keepers.WasmKeeper.OnCloseChannel(ctx, spec.contractAddr, msg)

// then
events := ctx.EventManager().Events()
Expand Down Expand Up @@ -453,7 +469,8 @@ func TestOnRecvPacket(t *testing.T) {
}

// when
gotAck, err := keepers.WasmKeeper.OnRecvPacket(ctx, spec.contractAddr, myPacket)
msg := wasmvmtypes.IBCPacketReceiveMsg{Packet: myPacket}
gotAck, err := keepers.WasmKeeper.OnRecvPacket(ctx, spec.contractAddr, msg)

// then
events := ctx.EventManager().Events()
Expand Down Expand Up @@ -704,7 +721,8 @@ func TestOnTimeoutPacket(t *testing.T) {
}

// when
err := keepers.WasmKeeper.OnTimeoutPacket(ctx, spec.contractAddr, myPacket)
msg := wasmvmtypes.IBCPacketTimeoutMsg{Packet: myPacket}
err := keepers.WasmKeeper.OnTimeoutPacket(ctx, spec.contractAddr, msg)

// then
events := ctx.EventManager().Events()
Expand Down

0 comments on commit 0fe0b62

Please sign in to comment.