diff --git a/modules/light-clients/08-wasm/keeper/genesis.go b/modules/light-clients/08-wasm/keeper/genesis.go index 3b2be7eac55..97e6b22af8b 100644 --- a/modules/light-clients/08-wasm/keeper/genesis.go +++ b/modules/light-clients/08-wasm/keeper/genesis.go @@ -10,7 +10,7 @@ import ( // state. func (k Keeper) InitGenesis(ctx sdk.Context, gs types.GenesisState) error { for _, contract := range gs.Contracts { - err := k.importWasmCode(ctx, contract.ContractCode) + _, err := k.storeWasmCode(ctx, contract.ContractCode) if err != nil { return err } diff --git a/modules/light-clients/08-wasm/keeper/keeper.go b/modules/light-clients/08-wasm/keeper/keeper.go index 1c29036f75b..605ac0d9cb1 100644 --- a/modules/light-clients/08-wasm/keeper/keeper.go +++ b/modules/light-clients/08-wasm/keeper/keeper.go @@ -101,23 +101,3 @@ func (k Keeper) storeWasmCode(ctx sdk.Context, code []byte) ([]byte, error) { store.Set(codeIDKey, code) return codeHash, nil } - -func (k Keeper) importWasmCode(ctx sdk.Context, wasmCode []byte) error { - store := ctx.KVStore(k.storeKey) - if types.IsGzip(wasmCode) { - var err error - wasmCode, err = types.Uncompress(wasmCode, types.MaxWasmByteSize()) - if err != nil { - return errorsmod.Wrap(err, "failed to store contract") - } - } - - codeID, err := k.wasmVM.Create(wasmCode) - if err != nil { - return errorsmod.Wrap(err, "failed to store contract") - } - codeIDKey := types.CodeIDKey(codeID) - - store.Set(codeIDKey, wasmCode) - return nil -}