Skip to content

Commit

Permalink
Merge pull request #619 from assafmo/patch-1
Browse files Browse the repository at this point in the history
Fix inconsistent return of contractAddress from keeper/init()
  • Loading branch information
alpe authored Sep 23, 2021
2 parents 6bd9172 + ed96573 commit fc8d33e
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 fc8d33e

Please sign in to comment.