diff --git a/app/app.go b/app/app.go index 1bae25cb..8c659e42 100644 --- a/app/app.go +++ b/app/app.go @@ -123,6 +123,12 @@ type WasmApp struct { sm *module.SimulationManager } +// WasmWrapper allows us to use namespacing in the config file +// This is only used for parsing in the app, x/wasm expects WasmConfig +type WasmWrapper struct { + Wasm wasm.WasmConfig `mapstructure:"wasm"` +} + // NewWasmApp returns a reference to an initialized WasmApp. func NewWasmApp( logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, @@ -183,11 +189,13 @@ func NewWasmApp( homeDir := viper.GetString(cli.HomeFlag) wasmDir := filepath.Join(homeDir, "wasm") - wasmConfig := wasm.DefaultWasmConfig() - err := viper.Unmarshal(&wasmConfig) + wasmWrap := WasmWrapper{Wasm: wasm.DefaultWasmConfig()} + err := viper.Unmarshal(&wasmWrap) if err != nil { fmt.Println("error while reading wasm config:", err.Error()) } + wasmConfig := wasmWrap.Wasm + fmt.Printf("WasmConfig: %#v\n", wasmConfig) app.wasmKeeper = wasm.NewKeeper(app.cdc, keys[wasm.StoreKey], app.accountKeeper, app.bankKeeper, wasmRouter, wasmDir, wasmConfig) diff --git a/x/wasm/README.md b/x/wasm/README.md new file mode 100644 index 00000000..e1331312 --- /dev/null +++ b/x/wasm/README.md @@ -0,0 +1,28 @@ +# Wasm Module + +This should be a brief overview of the functionality + +## Configuration + +You can add the following section to `config/app.toml`. Below is shown with defaults: + +```toml +[wasm] +# This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries +query_gas_limit = 300000 +# This is the number of wasm vm instances we keep cached in memory for speed-up +# Warning: this is currently unstable and may lead to crashes, best to keep for 0 unless testing locally +lru_size = 0 +``` + +## Messages + +TODO + +## CLI + +TODO + +## Rest + +TODO