Skip to content

Commit

Permalink
Update app.go
Browse files Browse the repository at this point in the history
override wasm limits
  • Loading branch information
tommyv1987 authored Jul 4, 2023
1 parent 33d176b commit cf0e6b6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,14 @@ type WasmApp struct {
configurator module.Configurator
}

// overrideWasmVariables overrides the wasm variables to:
// - allow for larger wasm files
func overrideWasmVariables() {
// Override Wasm size limitation from WASMD.
wasmtypes.MaxWasmSize = 3 * 1024 * 1024
wasmtypes.MaxProposalWasmSize = wasmtypes.MaxWasmSize
}

// NewWasmApp returns a reference to an initialized WasmApp.
func NewWasmApp(
logger log.Logger,
Expand All @@ -305,7 +313,7 @@ func NewWasmApp(
wasmOpts []wasm.Option,
baseAppOptions ...func(*baseapp.BaseApp),
) *WasmApp {
wasmtypes.MaxWasmSize = 1200 * 1024 // set this to 1.2MB
overrideWasmVariables()
appCodec, legacyAmino := encodingConfig.Marshaler, encodingConfig.Amino
interfaceRegistry := encodingConfig.InterfaceRegistry

Expand Down

0 comments on commit cf0e6b6

Please sign in to comment.