From 83e86064c78c05d3a79a917a95444641acf8fe51 Mon Sep 17 00:00:00 2001 From: mkXultra Date: Mon, 11 Jul 2022 19:40:02 +0900 Subject: [PATCH] change in use of snapshot https://github.com/cosmos/cosmos-sdk/pull/11496 --- cmd/ununifid/cmd/root.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cmd/ununifid/cmd/root.go b/cmd/ununifid/cmd/root.go index 8ac3e4c14..a73154cfd 100644 --- a/cmd/ununifid/cmd/root.go +++ b/cmd/ununifid/cmd/root.go @@ -8,7 +8,6 @@ import ( // "github.com/CosmWasm/wasmd/x/wasm" "github.com/UnUniFi/chain/app/params" - "github.com/cosmos/cosmos-sdk/snapshots" tmcfg "github.com/tendermint/tendermint/config" "github.com/UnUniFi/chain/app" @@ -21,6 +20,8 @@ import ( "github.com/cosmos/cosmos-sdk/server" serverconfig "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" + "github.com/cosmos/cosmos-sdk/snapshots" + snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" "github.com/cosmos/cosmos-sdk/store" sdk "github.com/cosmos/cosmos-sdk/types" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" @@ -237,6 +238,11 @@ func (a appCreator) newApp( // wasmOpts = append(wasmOpts, Wasmkeeper.WithVMCacheMetrics(prometheus.DefaultRegisterer)) // } + snapshotOptions := snapshottypes.NewSnapshotOptions( + cast.ToUint64(appOpts.Get(server.FlagStateSyncSnapshotInterval)), + cast.ToUint32(appOpts.Get(server.FlagStateSyncSnapshotKeepRecent)), + ) + return app.NewApp( logger, db, traceStore, true, skipUpgradeHeights, cast.ToString(appOpts.Get(flags.FlagHome)), @@ -254,9 +260,7 @@ func (a appCreator) newApp( baseapp.SetInterBlockCache(cache), baseapp.SetTrace(cast.ToBool(appOpts.Get(server.FlagTrace))), baseapp.SetIndexEvents(cast.ToStringSlice(appOpts.Get(server.FlagIndexEvents))), - baseapp.SetSnapshotStore(snapshotStore), - baseapp.SetSnapshotInterval(cast.ToUint64(appOpts.Get(server.FlagStateSyncSnapshotInterval))), - baseapp.SetSnapshotKeepRecent(cast.ToUint32(appOpts.Get(server.FlagStateSyncSnapshotKeepRecent))), + baseapp.SetSnapshot(snapshotStore, snapshotOptions), ) }