Skip to content

Commit

Permalink
feat(app)!: wasm snapshot export is mandatory (#1616)
Browse files Browse the repository at this point in the history
* feat(app)!: wasm snapshot export is mandatory

* changelog

* refacotr: unindent else block
  • Loading branch information
Unique-Divine authored and k-yang committed Oct 2, 2023
1 parent 15032f7 commit b5fc784
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### API Breaking

* [#1616](https://github.com/NibiruChain/nibiru/pull/1616) - fix(app)!: Add custom wasm snapshotter for proper state exports
* [#1380](https://github.com/NibiruChain/nibiru/pull/1380) - feat(wasm): Add CreateMarket admin call for the controller contract
* [#1359](https://github.com/NibiruChain/nibiru/pull/1359) - feat(perp): Add InsuranceFundWithdraw admin call with corresponding smart contract
* [#1356](https://github.com/NibiruChain/nibiru/pull/1356) - build: Regress wasmvm (v1.1.1), tendermint (v0.34.24), and Cosmos-SDK (v0.45.14) dependencies
Expand Down
13 changes: 13 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,19 @@ func NewNibiruApp(
app.SetAnteHandler(anteHandler)
app.SetEndBlocker(app.EndBlocker)

snapshotManager := app.SnapshotManager()
if snapshotManager == nil {
panic("mistakes were made: snapshot manager is nil")
}
if err = snapshotManager.RegisterExtensions(
wasmkeeper.NewWasmSnapshotter(
app.CommitMultiStore(),
&app.WasmKeeper,
),
); err != nil {
panic("failed to add wasm snapshot extension.")
}

if loadLatest {
if err := app.LoadLatestVersion(); err != nil {
tmos.Exit(err.Error())
Expand Down

0 comments on commit b5fc784

Please sign in to comment.