diff --git a/app/app.go b/app/app.go index 1e64321f21..3a42d51aff 100644 --- a/app/app.go +++ b/app/app.go @@ -372,8 +372,6 @@ func New( authAddr, ) - logger.Info("bank keeper blocklist addresses", "addresses", app.BlockedAddrs()) - app.BankKeeper = bankkeeper.NewBaseKeeper( appCodec, keys[banktypes.StoreKey], diff --git a/app/export.go b/app/export.go index 1f1ae26a96..61bc52659b 100644 --- a/app/export.go +++ b/app/export.go @@ -17,7 +17,6 @@ import ( func (app *App) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string, ) (servertypes.ExportedApp, error) { - // as if they could withdraw from the start of the next block ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) // We export at last height + 1, because that's the height at which diff --git a/cmd/zetacored/root.go b/cmd/zetacored/root.go index 440b921bc2..3880b12108 100644 --- a/cmd/zetacored/root.go +++ b/cmd/zetacored/root.go @@ -268,48 +268,43 @@ func (ac appCreator) newApp( ) } -// appExport creates a new simapp (optionally at a given height) +// appExport is used to export the state of the application for a genesis file. func (ac appCreator) appExport( logger log.Logger, db dbm.DB, traceStore io.Writer, height int64, forZeroHeight bool, jailAllowedAddrs []string, appOpts servertypes.AppOptions, modulesToExport []string, ) (servertypes.ExportedApp, error) { - var anApp *app.App + var zetaApp *app.App homePath, ok := appOpts.Get(flags.FlagHome).(string) if !ok || homePath == "" { return servertypes.ExportedApp{}, errors.New("application home not set") } - if height != -1 { - anApp = app.New( - logger, - db, - traceStore, - false, - map[int64]bool{}, - homePath, - uint(1), - ac.encCfg, - appOpts, - ) - - if err := anApp.LoadHeight(height); err != nil { + loadLatest := false + if height == -1 { + loadLatest = true + } + + zetaApp = app.New( + logger, + db, + traceStore, + loadLatest, + map[int64]bool{}, + homePath, + uint(1), + ac.encCfg, + appOpts, + ) + + // If height is -1, it means we are using the latest height. + // For all other cases, we load the specified height from the Store + if !loadLatest { + if err := zetaApp.LoadHeight(height); err != nil { return servertypes.ExportedApp{}, err } - } else { - anApp = app.New( - logger, - db, - traceStore, - true, - map[int64]bool{}, - homePath, - uint(1), - ac.encCfg, - appOpts, - ) } - return anApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport) + return zetaApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport) }