properly register the snapshot manager
This commit is contained in:
21
app/app.go
21
app/app.go
@@ -667,6 +667,19 @@ func NewWasmApp(
|
||||
app.SetBeginBlocker(app.BeginBlocker)
|
||||
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 {
|
||||
manager.RegisterExtensions(
|
||||
wasm.NewWasmSnapshotter(app.CommitMultiStore(), app.wasmKeeper),
|
||||
)
|
||||
}
|
||||
|
||||
app.scopedIBCKeeper = scopedIBCKeeper
|
||||
app.scopedTransferKeeper = scopedTransferKeeper
|
||||
app.scopedWasmKeeper = scopedWasmKeeper
|
||||
|
||||
if loadLatest {
|
||||
if err := app.LoadLatestVersion(); err != nil {
|
||||
tmos.Exit(fmt.Sprintf("failed to load latest version: %s", err))
|
||||
@@ -679,14 +692,6 @@ func NewWasmApp(
|
||||
}
|
||||
}
|
||||
|
||||
app.scopedIBCKeeper = scopedIBCKeeper
|
||||
app.scopedTransferKeeper = scopedTransferKeeper
|
||||
app.scopedWasmKeeper = scopedWasmKeeper
|
||||
|
||||
app.SnapshotManager().RegisterExtensions(
|
||||
wasm.NewWasmSnapshotter(app.CommitMultiStore(), app.wasmKeeper),
|
||||
)
|
||||
|
||||
return app
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user