Skip to content

Commit

Permalink
Fix inconsistent return of contractAddress from keeper/init()
Browse files Browse the repository at this point in the history
This will not affect functionality whatsoever, it just makes for a more consistent code, as discussed in issue #616.
  • Loading branch information
assafmo committed Sep 22, 2021
1 parent 6bd9172 commit ed96573
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions x/wasm/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ func (k Keeper) instantiate(ctx sdk.Context, codeID uint64, creator, admin sdk.A
res, gasUsed, err := k.wasmVM.Instantiate(codeInfo.CodeHash, env, info, initMsg, prefixStore, cosmwasmAPI, querier, k.gasMeter(ctx), gas, costJsonDeserialization)
k.consumeRuntimeGas(ctx, gasUsed)
if err != nil {
return contractAddress, nil, sdkerrors.Wrap(types.ErrInstantiateFailed, err.Error())
return nil, nil, sdkerrors.Wrap(types.ErrInstantiateFailed, err.Error())
}

// persist instance first
Expand All @@ -293,7 +293,7 @@ func (k Keeper) instantiate(ctx sdk.Context, codeID uint64, creator, admin sdk.A
// check for IBC flag
report, err := k.wasmVM.AnalyzeCode(codeInfo.CodeHash)
if err != nil {
return contractAddress, nil, sdkerrors.Wrap(types.ErrInstantiateFailed, err.Error())
return nil, nil, sdkerrors.Wrap(types.ErrInstantiateFailed, err.Error())
}
if report.HasIBCEntryPoints {
// register IBC port
Expand Down

0 comments on commit ed96573

Please sign in to comment.