Skip to content

Commit

Permalink
fix(app): non-nil snapshot manager is not guarantted in testapp (#1617)
Browse files Browse the repository at this point in the history
* feat(app)!: wasm snapshot export is mandatory

* changelog

* refacotr: unindent else block

* hotfix(app)!: non-nil snapshot manager is not guaranteed in testapp

* changelog

---------

Co-authored-by: Jonathan Gimeno <[email protected]>
  • Loading branch information
Unique-Divine and jgimeno authored Oct 3, 2023
1 parent ed1a2e4 commit c7ae585
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
handler to add a maximum commission rate of 25% for validators.
* [#1616](https://github.com/NibiruChain/nibiru/pull/1616) - fix(app)!:
Add custom wasm snapshotter for proper state exports
* [#1617](https://github.com/NibiruChain/nibiru/pull/1617) - fix(app)!:
non-nil snapshot manager is not guarantted in testapp

### Improvements

Expand Down
20 changes: 9 additions & 11 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,17 +206,15 @@ 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 snapshotManager := app.SnapshotManager(); snapshotManager != nil {
if err = snapshotManager.RegisterExtensions(
wasmkeeper.NewWasmSnapshotter(
app.CommitMultiStore(),
&app.WasmKeeper,
),
); err != nil {
panic("failed to add wasm snapshot extension.")
}
}

if loadLatest {
Expand Down

0 comments on commit c7ae585

Please sign in to comment.