From 9b29206c5b779014651ae4701e50bfbfe5b9fb57 Mon Sep 17 00:00:00 2001 From: vuong177 Date: Tue, 4 Jul 2023 07:15:46 +0700 Subject: [PATCH] wasm_client_data path --- modules/light-clients/08-wasm/keeper/keeper.go | 5 +++-- testing/simapp/app.go | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/light-clients/08-wasm/keeper/keeper.go b/modules/light-clients/08-wasm/keeper/keeper.go index e1325a8570f..2ce18789498 100644 --- a/modules/light-clients/08-wasm/keeper/keeper.go +++ b/modules/light-clients/08-wasm/keeper/keeper.go @@ -6,6 +6,7 @@ import ( "crypto/sha256" "encoding/hex" "math" + "path/filepath" "strings" "google.golang.org/grpc/codes" @@ -29,9 +30,9 @@ type Keeper struct { authority string } -func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, authority string) Keeper { +func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, authority string, homeDir string) Keeper { // Wasm VM - wasmDataDir := "wasm_client_data" + wasmDataDir := filepath.Join(homeDir, "wasm_client_data") wasmSupportedFeatures := strings.Join([]string{"storage", "iterator"}, ",") wasmMemoryLimitMb := uint32(math.Pow(2, 12)) wasmPrintDebug := true diff --git a/testing/simapp/app.go b/testing/simapp/app.go index e05698b54e6..cd3c6488dcb 100644 --- a/testing/simapp/app.go +++ b/testing/simapp/app.go @@ -411,7 +411,7 @@ func NewSimApp( */ app.GroupKeeper = groupkeeper.NewKeeper(keys[group.StoreKey], appCodec, app.MsgServiceRouter(), app.AccountKeeper, groupConfig) - app.WasmClientKeeper = ibcwasmkeeper.NewKeeper(appCodec, keys[ibcwasmtypes.StoreKey], authtypes.NewModuleAddress(govtypes.ModuleName).String()) + app.WasmClientKeeper = ibcwasmkeeper.NewKeeper(appCodec, keys[ibcwasmtypes.StoreKey], authtypes.NewModuleAddress(govtypes.ModuleName).String(), homePath) // IBC Fee Module keeper app.IBCFeeKeeper = ibcfeekeeper.NewKeeper(