app: fix export genesis (#619)

* v0.3.1 changes

* fix export genesis

* changelog

* evm: fix genesis format mismatch (#623)

* evm: fix genesis format mismatch

* genesis tests

* fix test

* changelog

* nolint
This commit is contained in:
Federico Kunze
2020-11-27 19:42:04 +01:00
committed by GitHub
parent 34a6011627
commit 048a8bdc12
9 changed files with 222 additions and 136 deletions
+6 -4
View File
@@ -111,14 +111,16 @@ func newApp(logger log.Logger, db dbm.DB, traceStore io.Writer) abci.Application
func exportAppStateAndTMValidators(
logger log.Logger, db dbm.DB, traceStore io.Writer, height int64, forZeroHeight bool, jailWhiteList []string,
) (json.RawMessage, []tmtypes.GenesisValidator, error) {
ethermintApp := app.NewEthermintApp(logger, db, traceStore, true, map[int64]bool{}, 0)
var ethermintApp *app.EthermintApp
if height != -1 {
err := ethermintApp.LoadHeight(height)
if err != nil {
ethermintApp = app.NewEthermintApp(logger, db, traceStore, false, map[int64]bool{}, 0)
if err := ethermintApp.LoadHeight(height); err != nil {
return nil, nil, err
}
} else {
ethermintApp = app.NewEthermintApp(logger, db, traceStore, true, map[int64]bool{}, 0)
}
return ethermintApp.ExportAppStateAndValidators(forZeroHeight, jailWhiteList)