Skip to content

Commit

Permalink
fix: Remove WASM config from application configuration (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitsalis authored Jul 28, 2022
1 parent c11ac27 commit f3efa57
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions cmd/babylond/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,8 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
func initAppConfig() (string, interface{}) {
// The following code snippet is just for reference.

// WASMConfig defines configuration for the wasm module.
type WASMConfig struct {
// This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries
QueryGasLimit uint64 `mapstructure:"query_gas_limit"`

// Address defines the gRPC-web server to listen on
LruSize uint64 `mapstructure:"lru_size"`
}

type CustomAppConfig struct {
serverconfig.Config

WASM WASMConfig `mapstructure:"wasm"`
}

// Optionally allow the chain developer to overwrite the SDK's default
Expand All @@ -120,21 +109,9 @@ func initAppConfig() (string, interface{}) {

customAppConfig := CustomAppConfig{
Config: *srvCfg,
WASM: WASMConfig{
LruSize: 1,
QueryGasLimit: 300000,
},
}

customAppTemplate := serverconfig.DefaultConfigTemplate + `
[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`

return customAppTemplate, customAppConfig
return serverconfig.DefaultConfigTemplate, customAppConfig
}

func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) {
Expand Down

0 comments on commit f3efa57

Please sign in to comment.