fix app init
mount stores & loadlatestversion
This commit is contained in:
parent
01fbfc6c38
commit
bc76e90b8d
11
app/app.go
11
app/app.go
@ -641,6 +641,11 @@ func NewEthermintApp(
|
|||||||
|
|
||||||
app.sm.RegisterStoreDecoders()
|
app.sm.RegisterStoreDecoders()
|
||||||
|
|
||||||
|
// initialize stores
|
||||||
|
app.MountKVStores(keys)
|
||||||
|
app.MountTransientStores(tkeys)
|
||||||
|
app.MountMemoryStores(memKeys)
|
||||||
|
|
||||||
// initialize BaseApp
|
// initialize BaseApp
|
||||||
app.SetInitChainer(app.InitChainer)
|
app.SetInitChainer(app.InitChainer)
|
||||||
app.SetBeginBlocker(app.BeginBlocker)
|
app.SetBeginBlocker(app.BeginBlocker)
|
||||||
@ -670,6 +675,12 @@ func NewEthermintApp(
|
|||||||
app.ScopedIBCKeeper = scopedIBCKeeper
|
app.ScopedIBCKeeper = scopedIBCKeeper
|
||||||
app.ScopedTransferKeeper = scopedTransferKeeper
|
app.ScopedTransferKeeper = scopedTransferKeeper
|
||||||
|
|
||||||
|
if loadLatest {
|
||||||
|
if err := app.LoadLatestVersion(); err != nil {
|
||||||
|
tmos.Exit(err.Error())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return app
|
return app
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,6 @@ func TestEthermintAppExport(t *testing.T) {
|
|||||||
|
|
||||||
// Making a new app object with the db, so that initchain hasn't been called
|
// Making a new app object with the db, so that initchain hasn't been called
|
||||||
app2 := NewEthermintApp(logger2, db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, encCfg, EmptyAppOptions{})
|
app2 := NewEthermintApp(logger2, db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, encCfg, EmptyAppOptions{})
|
||||||
require.NoError(t, app2.Init())
|
|
||||||
_, err := app2.ExportAppStateAndValidators(false, []string{})
|
_, err := app2.ExportAppStateAndValidators(false, []string{})
|
||||||
require.NoError(t, err, "ExportAppStateAndValidators should not have an error")
|
require.NoError(t, err, "ExportAppStateAndValidators should not have an error")
|
||||||
}
|
}
|
||||||
|
@ -5,31 +5,33 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
"github.com/stretchr/testify/require"
|
||||||
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
|
|
||||||
"github.com/cosmos/cosmos-sdk/server/types"
|
|
||||||
"github.com/cosmos/cosmos-sdk/simapp"
|
|
||||||
"github.com/cosmos/cosmos-sdk/testutil/mock"
|
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/crypto"
|
"github.com/ethereum/go-ethereum/crypto"
|
||||||
|
|
||||||
"github.com/cerc-io/laconicd/crypto/ethsecp256k1"
|
|
||||||
"github.com/cerc-io/laconicd/encoding"
|
|
||||||
ethermint "github.com/cerc-io/laconicd/types"
|
|
||||||
"github.com/cosmos/cosmos-sdk/simapp/params"
|
|
||||||
"github.com/stretchr/testify/require"
|
|
||||||
tmjson "github.com/tendermint/tendermint/libs/json"
|
|
||||||
|
|
||||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
|
||||||
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
|
|
||||||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
|
||||||
abci "github.com/tendermint/tendermint/abci/types"
|
abci "github.com/tendermint/tendermint/abci/types"
|
||||||
"github.com/tendermint/tendermint/crypto/ed25519"
|
"github.com/tendermint/tendermint/crypto/ed25519"
|
||||||
|
tmjson "github.com/tendermint/tendermint/libs/json"
|
||||||
"github.com/tendermint/tendermint/libs/log"
|
"github.com/tendermint/tendermint/libs/log"
|
||||||
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
|
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
|
||||||
tmtypes "github.com/tendermint/tendermint/types"
|
tmtypes "github.com/tendermint/tendermint/types"
|
||||||
dbm "github.com/tendermint/tm-db"
|
dbm "github.com/tendermint/tm-db"
|
||||||
|
|
||||||
|
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||||
|
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
|
||||||
|
"github.com/cosmos/cosmos-sdk/server/types"
|
||||||
|
"github.com/cosmos/cosmos-sdk/simapp"
|
||||||
|
"github.com/cosmos/cosmos-sdk/simapp/params"
|
||||||
|
"github.com/cosmos/cosmos-sdk/testutil/mock"
|
||||||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||||
|
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||||
|
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||||
|
|
||||||
|
"github.com/cerc-io/laconicd/crypto/ethsecp256k1"
|
||||||
|
"github.com/cerc-io/laconicd/encoding"
|
||||||
|
ethermint "github.com/cerc-io/laconicd/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GenesisState of the blockchain is represented here as a map of raw json
|
// GenesisState of the blockchain is represented here as a map of raw json
|
||||||
|
Loading…
Reference in New Issue
Block a user