Skip to content

Commit 7ec0797

Browse files
committed
fix: add missing base app options
1 parent 5e3bf5c commit 7ec0797

File tree

2 files changed

+7
-35
lines changed

2 files changed

+7
-35
lines changed

app/app.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ type App struct {
5454
func NewApp(
5555
appOpts servertypes.AppOptions, bech32Prefix string, db tmdb.DB, encCfg EncodingConfig, homeDir string,
5656
invCheckPeriod uint, loadLatest bool, logger tmlog.Logger, skipGenesisInvariants bool,
57-
skipUpgradeHeights map[int64]bool, traceWriter io.Writer, version string, wasmOpts []wasmkeeper.Option,
57+
traceWriter io.Writer, version string, skipUpgradeHeights map[int64]bool, wasmOpts []wasmkeeper.Option,
5858
baseAppOpts ...func(*baseapp.BaseApp),
5959
) *App {
6060
baseApp := baseapp.NewBaseApp(appName, logger, db, encCfg.TxConfig.TxDecoder(), baseAppOpts...)

cmd/sentinelhub/app_creator.go

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,13 @@ package main
22

33
import (
44
"io"
5-
"path/filepath"
65

76
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
87
tmdb "github.com/cometbft/cometbft-db"
98
tmlog "github.com/cometbft/cometbft/libs/log"
10-
tmtypes "github.com/cometbft/cometbft/types"
11-
"github.com/cosmos/cosmos-sdk/baseapp"
129
"github.com/cosmos/cosmos-sdk/client/flags"
1310
"github.com/cosmos/cosmos-sdk/server"
1411
servertypes "github.com/cosmos/cosmos-sdk/server/types"
15-
"github.com/cosmos/cosmos-sdk/store"
16-
sdk "github.com/cosmos/cosmos-sdk/types"
1712
"github.com/cosmos/cosmos-sdk/version"
1813
"github.com/cosmos/cosmos-sdk/x/crisis"
1914
"github.com/prometheus/client_golang/prometheus"
@@ -30,46 +25,23 @@ type appCreator struct {
3025
func (ac appCreator) NewApp(
3126
logger tmlog.Logger, db tmdb.DB, traceWriter io.Writer, appOpts servertypes.AppOptions,
3227
) servertypes.Application {
33-
var cache sdk.MultiStorePersistentCache
34-
if cast.ToBool(appOpts.Get(server.FlagInterBlockCache)) {
35-
cache = store.NewCommitKVStoreCacheManager()
36-
}
37-
38-
homeDir := cast.ToString(appOpts.Get(flags.FlagHome))
39-
40-
genDoc, err := tmtypes.GenesisDocFromFile(filepath.Join(homeDir, "config", "genesis.json"))
41-
if err != nil {
42-
panic(err)
43-
}
28+
baseAppOpts := server.DefaultBaseappOptions(appOpts)
4429

4530
skipUpgradeHeights := make(map[int64]bool)
4631
for _, height := range cast.ToIntSlice(appOpts.Get(server.FlagUnsafeSkipUpgrades)) {
4732
skipUpgradeHeights[int64(height)] = true
4833
}
4934

50-
pruningOpts, err := server.GetPruningOptionsFromFlags(appOpts)
51-
if err != nil {
52-
panic(err)
53-
}
54-
5535
var wasmOpts []wasmkeeper.Option
5636
if cast.ToBool(appOpts.Get("telemetry.enabled")) {
5737
wasmOpts = append(wasmOpts, wasmkeeper.WithVMCacheMetrics(prometheus.DefaultRegisterer))
5838
}
5939

6040
return app.NewApp(
61-
appOpts, base.Bech32MainPrefix, db, ac.encCfg, homeDir,
41+
appOpts, base.Bech32MainPrefix, db, ac.encCfg, cast.ToString(appOpts.Get(flags.FlagHome)),
6242
cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)), true, logger,
63-
cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)), skipUpgradeHeights, traceWriter, version.Version,
64-
wasmOpts, baseapp.SetChainID(genDoc.ChainID),
65-
baseapp.SetHaltHeight(cast.ToUint64(appOpts.Get(server.FlagHaltHeight))),
66-
baseapp.SetHaltTime(cast.ToUint64(appOpts.Get(server.FlagHaltTime))),
67-
baseapp.SetIndexEvents(cast.ToStringSlice(appOpts.Get(server.FlagIndexEvents))),
68-
baseapp.SetInterBlockCache(cache),
69-
baseapp.SetMinGasPrices(cast.ToString(appOpts.Get(server.FlagMinGasPrices))),
70-
baseapp.SetMinRetainBlocks(cast.ToUint64(appOpts.Get(server.FlagMinRetainBlocks))),
71-
baseapp.SetPruning(pruningOpts),
72-
baseapp.SetTrace(cast.ToBool(appOpts.Get(server.FlagTrace))),
43+
cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)), traceWriter, version.Version,
44+
skipUpgradeHeights, wasmOpts, baseAppOpts...,
7345
)
7446
}
7547

@@ -80,8 +52,8 @@ func (ac appCreator) AppExport(
8052
v := app.NewApp(
8153
appOpts, base.Bech32MainPrefix, db, ac.encCfg, cast.ToString(appOpts.Get(flags.FlagHome)),
8254
cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)), height == -1, logger,
83-
cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)), map[int64]bool{}, traceWriter,
84-
version.Version, nil, nil,
55+
cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)), traceWriter, version.Version,
56+
map[int64]bool{}, nil,
8557
)
8658

8759
if height != -1 {

0 commit comments

Comments
 (0)