Skip to content

Commit

Permalink
fix!: load from the proper data dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Reecepbcups committed Feb 5, 2024
1 parent fc06bf4 commit 120946f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
7 changes: 3 additions & 4 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package keepers
import (
"fmt"
"math"
"path"
"path/filepath"
"strings"

Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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))
}
Expand All @@ -566,7 +566,7 @@ func NewAppKeepers(
appKeepers.TransferKeeper,
bApp.MsgServiceRouter(),
bApp.GRPCQueryRouter(),
wasmDir,
dataDir,
wasmConfig,
wasmCapabilities,
govModAddress,
Expand Down

0 comments on commit 120946f

Please sign in to comment.