Skip to content

Commit 532e6ca

Browse files
committed
Add comments
1 parent 2d89dd7 commit 532e6ca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

x/wasm/keeper/relay.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,15 @@ func (k Keeper) OnOpenChannel(
4040
gasLeft := k.runtimeGasForContract(ctx)
4141
res, gasUsed, execErr := k.wasmVM.IBCChannelOpen(codeInfo.CodeHash, env, msg, prefixStore, cosmwasmAPI, querier, ctx.GasMeter(), gasLeft, costJSONDeserialization)
4242
k.consumeRuntimeGas(ctx, gasUsed)
43-
43+
// check if contract panicked / VM failed
4444
if execErr != nil {
4545
return "", errorsmod.Wrap(types.ErrExecuteFailed, execErr.Error())
4646
}
4747
if res == nil {
4848
// If this gets executed, that's a bug in wasmvm
4949
return "", errorsmod.Wrap(types.ErrVMError, "internal wasmvm error")
5050
}
51+
// check contract result
5152
if res.Err != "" {
5253
return "", types.MarkErrorDeterministic(errorsmod.Wrap(types.ErrExecuteFailed, res.Err))
5354
}

0 commit comments

Comments
 (0)