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 Oct 2, 2023
1 parent 6c24125 commit 839c8c2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* [#1613](https://github.com/NibiruChain/nibiru/pull/1613) - feat(app)!: enforce min commission by changing default and genesis validation
* [#1615](https://github.com/NibiruChain/nibiru/pull/1613) - feat(ante)!: Ante
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

### Improvements

Expand Down
13 changes: 13 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,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

1 comment on commit 839c8c2

@Unique-Divine
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a slight adjustment because the snapshot manager is nil in many tests that use common/testutil/testapp

Please sign in to comment.