Skip to content

Commit

Permalink
feat(wasm)!: increase contract size limit to 3MB (#1906)
Browse files Browse the repository at this point in the history
* feat(wasm): increase contract size limit to 3MB

* chore: update changelog
  • Loading branch information
k-yang committed Jun 4, 2024
1 parent 906f9c7 commit 1b109f0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,14 @@ func GetWasmOpts(nibiru NibiruApp, appOpts servertypes.AppOptions) []wasmkeeper.
return wasmOpts
}

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

// NewNibiruApp returns a reference to an initialized NibiruApp.
func NewNibiruApp(
logger log.Logger,
Expand All @@ -135,6 +143,7 @@ func NewNibiruApp(
appOpts servertypes.AppOptions,
baseAppOptions ...func(*baseapp.BaseApp),
) *NibiruApp {
overrideWasmVariables()
appCodec := encodingConfig.Marshaler
legacyAmino := encodingConfig.Amino
interfaceRegistry := encodingConfig.InterfaceRegistry
Expand Down

0 comments on commit 1b109f0

Please sign in to comment.