From 120946f72166b47f762f4afd7990608a4b2617d0 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Mon, 5 Feb 2024 17:32:09 -0600 Subject: [PATCH] fix!: load from the proper data dir --- app/app.go | 7 +++---- app/keepers/keepers.go | 10 +++++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/app/app.go b/app/app.go index b9486a130..0a118cfb5 100644 --- a/app/app.go +++ b/app/app.go @@ -449,10 +449,9 @@ func New( tmos.Exit(fmt.Sprintf("wasmlckeeper failed initialize pinned codes %s", err)) } - // we already load in with the wasmlc (all) - // if err := app.AppKeepers.WasmKeeper.InitializePinnedCodes(ctx); err != nil { - // tmos.Exit(fmt.Sprintf("app.AppKeepers.WasmKeeper failed initialize pinned codes %s", err)) - // } + if err := app.AppKeepers.WasmKeeper.InitializePinnedCodes(ctx); err != nil { + tmos.Exit(fmt.Sprintf("app.AppKeepers.WasmKeeper failed initialize pinned codes %s", err)) + } // Initialize and seal the capability keeper so all persistent capabilities // are loaded in-memory and prevent any further modules from creating scoped diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index 4d9359a4d..af5eefd70 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -3,6 +3,7 @@ package keepers import ( "fmt" "math" + "path" "path/filepath" "strings" @@ -485,8 +486,7 @@ func NewAppKeepers( govModAddress, ) - wasmDir := filepath.Join(homePath, "data") - lcWasmDir := filepath.Join(homePath, "data", "light-client-wasm") + dataDir := filepath.Join(homePath, "data") wasmConfig, err := wasm.ReadWasmConfig(appOpts) if err != nil { @@ -542,12 +542,12 @@ func NewAppKeepers( wasmOpts = append(wasmOpts, burnMessageHandler) - mainWasmer, err := wasmvm.NewVM(wasmDir, wasmCapabilities, 32, wasmConfig.ContractDebugMode, wasmConfig.MemoryCacheSize) + mainWasmer, err := wasmvm.NewVM(path.Join(dataDir, "wasm"), wasmCapabilities, 32, wasmConfig.ContractDebugMode, wasmConfig.MemoryCacheSize) if err != nil { panic(fmt.Sprintf("failed to create juno wasm vm: %s", err)) } - lcWasmer, err := wasmvm.NewVM(lcWasmDir, wasmCapabilities, 32, wasmConfig.ContractDebugMode, wasmConfig.MemoryCacheSize) + lcWasmer, err := wasmvm.NewVM(filepath.Join(dataDir, "light-client-wasm"), wasmCapabilities, 32, wasmConfig.ContractDebugMode, wasmConfig.MemoryCacheSize) if err != nil { panic(fmt.Sprintf("failed to create juno wasm vm for 08-wasm: %s", err)) } @@ -566,7 +566,7 @@ func NewAppKeepers( appKeepers.TransferKeeper, bApp.MsgServiceRouter(), bApp.GRPCQueryRouter(), - wasmDir, + dataDir, wasmConfig, wasmCapabilities, govModAddress,