Skip to content

Commit

Permalink
add wasm snapshot support
Browse files Browse the repository at this point in the history
  • Loading branch information
expertdicer committed May 13, 2024
1 parent 6261501 commit 534bdb1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,18 @@ func NewTerraApp(
app.SetPostHandler(postHandler)
app.SetEndBlocker(app.EndBlocker)

// must be before Loading version
// requires the snapshot store to be created and registered as a BaseAppOption
// see cmd/wasmd/root.go: 206 - 214 approx
if manager := app.SnapshotManager(); manager != nil {
err := manager.RegisterExtensions(
wasmkeeper.NewWasmSnapshotter(app.CommitMultiStore(), &app.WasmKeeper),
)
if err != nil {
panic(fmt.Errorf("failed to register snapshot extension: %s", err))
}
}

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

0 comments on commit 534bdb1

Please sign in to comment.