rename ethermintApp to laconicApp
This commit is contained in:
parent
395b2dcde6
commit
fc60016453
@ -6,7 +6,7 @@ import (
|
||||
|
||||
sdkmath "cosmossdk.io/math"
|
||||
|
||||
ethermint "github.com/cerc-io/laconicd/types"
|
||||
laconicd "github.com/cerc-io/laconicd/types"
|
||||
"github.com/cerc-io/laconicd/x/evm/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||
@ -49,7 +49,7 @@ func NewDynamicFeeChecker(k DynamicFeeEVMKeeper) authante.TxFeeChecker {
|
||||
// get the priority tip cap from the extension option.
|
||||
if hasExtOptsTx, ok := tx.(authante.HasExtensionOptionsTx); ok {
|
||||
for _, opt := range hasExtOptsTx.GetExtensionOptions() {
|
||||
if extOpt, ok := opt.GetCachedValue().(*ethermint.ExtensionOptionDynamicFeeTx); ok {
|
||||
if extOpt, ok := opt.GetCachedValue().(*laconicd.ExtensionOptionDynamicFeeTx); ok {
|
||||
maxPriorityPrice = extOpt.MaxPriorityPrice
|
||||
break
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ type AnteTestSuite struct {
|
||||
suite.Suite
|
||||
|
||||
ctx sdk.Context
|
||||
app *app.EthermintApp
|
||||
app *app.LaconicApp
|
||||
clientCtx client.Context
|
||||
anteHandler sdk.AnteHandler
|
||||
ethSigner ethtypes.Signer
|
||||
@ -73,7 +73,7 @@ func (suite *AnteTestSuite) StateDB() *statedb.StateDB {
|
||||
func (suite *AnteTestSuite) SetupTest() {
|
||||
checkTx := false
|
||||
|
||||
suite.app = app.Setup(checkTx, func(app *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
|
||||
suite.app = app.Setup(checkTx, func(app *app.LaconicApp, genesis simapp.GenesisState) simapp.GenesisState {
|
||||
if suite.enableFeemarket {
|
||||
// setup feemarketGenesis params
|
||||
feemarketGenesis := feemarkettypes.DefaultGenesisState()
|
||||
|
||||
62
app/app.go
62
app/app.go
@ -199,14 +199,14 @@ var (
|
||||
}
|
||||
)
|
||||
|
||||
var _ simapp.App = (*EthermintApp)(nil)
|
||||
var _ simapp.App = (*LaconicApp)(nil)
|
||||
|
||||
// var _ server.Application (*EthermintApp)(nil)
|
||||
// var _ server.Application (*LaconicApp)(nil)
|
||||
|
||||
// EthermintApp implements an extended ABCI application. It is an application
|
||||
// LaconicApp implements an extended ABCI application. It is an application
|
||||
// that may process transactions through Ethereum's EVM running atop of
|
||||
// Tendermint consensus.
|
||||
type EthermintApp struct {
|
||||
type LaconicApp struct {
|
||||
*baseapp.BaseApp
|
||||
|
||||
// encoding
|
||||
@ -263,8 +263,8 @@ type EthermintApp struct {
|
||||
configurator module.Configurator
|
||||
}
|
||||
|
||||
// NewEthermintApp returns a reference to a new initialized Ethermint application.
|
||||
func NewEthermintApp(
|
||||
// NewLaconicApp returns a reference to a new initialized Ethermint application.
|
||||
func NewLaconicApp(
|
||||
logger log.Logger,
|
||||
db dbm.DB,
|
||||
traceStore io.Writer,
|
||||
@ -275,7 +275,7 @@ func NewEthermintApp(
|
||||
encodingConfig simappparams.EncodingConfig,
|
||||
appOpts servertypes.AppOptions,
|
||||
baseAppOptions ...func(*baseapp.BaseApp),
|
||||
) *EthermintApp {
|
||||
) *LaconicApp {
|
||||
appCodec := encodingConfig.Codec
|
||||
cdc := encodingConfig.Amino
|
||||
interfaceRegistry := encodingConfig.InterfaceRegistry
|
||||
@ -313,7 +313,7 @@ func NewEthermintApp(
|
||||
tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey, evmtypes.TransientKey, feemarkettypes.TransientKey)
|
||||
memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey)
|
||||
|
||||
app := &EthermintApp{
|
||||
app := &LaconicApp{
|
||||
BaseApp: bApp,
|
||||
cdc: cdc,
|
||||
appCodec: appCodec,
|
||||
@ -707,7 +707,7 @@ func NewEthermintApp(
|
||||
}
|
||||
|
||||
// use Ethermint's custom AnteHandler
|
||||
func (app *EthermintApp) setAnteHandler(txConfig client.TxConfig, maxGasWanted uint64) {
|
||||
func (app *LaconicApp) setAnteHandler(txConfig client.TxConfig, maxGasWanted uint64) {
|
||||
anteHandler, err := ante.NewAnteHandler(ante.HandlerOptions{
|
||||
AccountKeeper: app.AccountKeeper,
|
||||
BankKeeper: app.BankKeeper,
|
||||
@ -726,7 +726,7 @@ func (app *EthermintApp) setAnteHandler(txConfig client.TxConfig, maxGasWanted u
|
||||
app.SetAnteHandler(anteHandler)
|
||||
}
|
||||
|
||||
func (app *EthermintApp) setPostHandler() {
|
||||
func (app *LaconicApp) setPostHandler() {
|
||||
postHandler, err := posthandler.NewPostHandler(
|
||||
posthandler.HandlerOptions{},
|
||||
)
|
||||
@ -738,20 +738,20 @@ func (app *EthermintApp) setPostHandler() {
|
||||
}
|
||||
|
||||
// Name returns the name of the App
|
||||
func (app *EthermintApp) Name() string { return app.BaseApp.Name() }
|
||||
func (app *LaconicApp) Name() string { return app.BaseApp.Name() }
|
||||
|
||||
// BeginBlocker updates every begin block
|
||||
func (app *EthermintApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock {
|
||||
func (app *LaconicApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock {
|
||||
return app.mm.BeginBlock(ctx, req)
|
||||
}
|
||||
|
||||
// EndBlocker updates every end block
|
||||
func (app *EthermintApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock {
|
||||
func (app *LaconicApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock {
|
||||
return app.mm.EndBlock(ctx, req)
|
||||
}
|
||||
|
||||
// InitChainer updates at chain initialization
|
||||
func (app *EthermintApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain {
|
||||
func (app *LaconicApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain {
|
||||
var genesisState simapp.GenesisState
|
||||
if err := json.Unmarshal(req.AppStateBytes, &genesisState); err != nil {
|
||||
panic(err)
|
||||
@ -761,12 +761,12 @@ func (app *EthermintApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain)
|
||||
}
|
||||
|
||||
// LoadHeight loads state at a particular height
|
||||
func (app *EthermintApp) LoadHeight(height int64) error {
|
||||
func (app *LaconicApp) LoadHeight(height int64) error {
|
||||
return app.LoadVersion(height)
|
||||
}
|
||||
|
||||
// ModuleAccountAddrs returns all the app's module account addresses.
|
||||
func (app *EthermintApp) ModuleAccountAddrs() map[string]bool {
|
||||
func (app *LaconicApp) ModuleAccountAddrs() map[string]bool {
|
||||
modAccAddrs := make(map[string]bool)
|
||||
// #nosec G705
|
||||
for acc := range maccPerms {
|
||||
@ -778,7 +778,7 @@ func (app *EthermintApp) ModuleAccountAddrs() map[string]bool {
|
||||
|
||||
// BlockedAddrs returns all the app's module account addresses that are not
|
||||
// allowed to receive external tokens.
|
||||
func (app *EthermintApp) BlockedAddrs() map[string]bool {
|
||||
func (app *LaconicApp) BlockedAddrs() map[string]bool {
|
||||
blockedAddrs := make(map[string]bool)
|
||||
// #nosec G705
|
||||
for acc := range maccPerms {
|
||||
@ -788,64 +788,64 @@ func (app *EthermintApp) BlockedAddrs() map[string]bool {
|
||||
return blockedAddrs
|
||||
}
|
||||
|
||||
// LegacyAmino returns EthermintApp's amino codec.
|
||||
// LegacyAmino returns LaconicApp's amino codec.
|
||||
//
|
||||
// NOTE: This is solely to be used for testing purposes as it may be desirable
|
||||
// for modules to register their own custom testing types.
|
||||
func (app *EthermintApp) LegacyAmino() *codec.LegacyAmino {
|
||||
func (app *LaconicApp) LegacyAmino() *codec.LegacyAmino {
|
||||
return app.cdc
|
||||
}
|
||||
|
||||
// AppCodec returns EthermintApp's app codec.
|
||||
// AppCodec returns LaconicApp's app codec.
|
||||
//
|
||||
// NOTE: This is solely to be used for testing purposes as it may be desirable
|
||||
// for modules to register their own custom testing types.
|
||||
func (app *EthermintApp) AppCodec() codec.Codec {
|
||||
func (app *LaconicApp) AppCodec() codec.Codec {
|
||||
return app.appCodec
|
||||
}
|
||||
|
||||
// InterfaceRegistry returns EthermintApp's InterfaceRegistry
|
||||
func (app *EthermintApp) InterfaceRegistry() types.InterfaceRegistry {
|
||||
// InterfaceRegistry returns LaconicApp's InterfaceRegistry
|
||||
func (app *LaconicApp) InterfaceRegistry() types.InterfaceRegistry {
|
||||
return app.interfaceRegistry
|
||||
}
|
||||
|
||||
// GetKey returns the KVStoreKey for the provided store key.
|
||||
//
|
||||
// NOTE: This is solely to be used for testing purposes.
|
||||
func (app *EthermintApp) GetKey(storeKey string) *storetypes.KVStoreKey {
|
||||
func (app *LaconicApp) GetKey(storeKey string) *storetypes.KVStoreKey {
|
||||
return app.keys[storeKey]
|
||||
}
|
||||
|
||||
// GetTKey returns the TransientStoreKey for the provided store key.
|
||||
//
|
||||
// NOTE: This is solely to be used for testing purposes.
|
||||
func (app *EthermintApp) GetTKey(storeKey string) *storetypes.TransientStoreKey {
|
||||
func (app *LaconicApp) GetTKey(storeKey string) *storetypes.TransientStoreKey {
|
||||
return app.tkeys[storeKey]
|
||||
}
|
||||
|
||||
// GetMemKey returns the MemStoreKey for the provided mem key.
|
||||
//
|
||||
// NOTE: This is solely used for testing purposes.
|
||||
func (app *EthermintApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey {
|
||||
func (app *LaconicApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey {
|
||||
return app.memKeys[storeKey]
|
||||
}
|
||||
|
||||
// GetSubspace returns a param subspace for a given module name.
|
||||
//
|
||||
// NOTE: This is solely to be used for testing purposes.
|
||||
func (app *EthermintApp) GetSubspace(moduleName string) paramstypes.Subspace {
|
||||
func (app *LaconicApp) GetSubspace(moduleName string) paramstypes.Subspace {
|
||||
subspace, _ := app.ParamsKeeper.GetSubspace(moduleName)
|
||||
return subspace
|
||||
}
|
||||
|
||||
// SimulationManager implements the SimulationApp interface
|
||||
func (app *EthermintApp) SimulationManager() *module.SimulationManager {
|
||||
func (app *LaconicApp) SimulationManager() *module.SimulationManager {
|
||||
return app.sm
|
||||
}
|
||||
|
||||
// RegisterAPIRoutes registers all application module routes with the provided
|
||||
// API server.
|
||||
func (app *EthermintApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) {
|
||||
func (app *LaconicApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) {
|
||||
clientCtx := apiSvr.ClientCtx
|
||||
// Register new tx routes from grpc-gateway.
|
||||
authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)
|
||||
@ -862,12 +862,12 @@ func (app *EthermintApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.
|
||||
}
|
||||
|
||||
// RegisterTxService implements the Application.RegisterTxService method.
|
||||
func (app *EthermintApp) RegisterTxService(clientCtx client.Context) {
|
||||
func (app *LaconicApp) RegisterTxService(clientCtx client.Context) {
|
||||
authtx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, app.interfaceRegistry)
|
||||
}
|
||||
|
||||
// RegisterTendermintService implements the Application.RegisterTendermintService method.
|
||||
func (app *EthermintApp) RegisterTendermintService(clientCtx client.Context) {
|
||||
func (app *LaconicApp) RegisterTendermintService(clientCtx client.Context) {
|
||||
tmservice.RegisterTendermintService(
|
||||
clientCtx,
|
||||
app.BaseApp.GRPCQueryRouter(),
|
||||
|
||||
@ -14,13 +14,13 @@ import (
|
||||
"github.com/cerc-io/laconicd/encoding"
|
||||
)
|
||||
|
||||
func TestEthermintAppExport(t *testing.T) {
|
||||
func TestLaconicAppExport(t *testing.T) {
|
||||
db := dbm.NewMemDB()
|
||||
app := SetupWithDB(false, nil, db)
|
||||
app.Commit()
|
||||
|
||||
// Making a new app object with the db, so that initchain hasn't been called
|
||||
app2 := NewEthermintApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, encoding.MakeConfig(ModuleBasics), simapp.EmptyAppOptions{})
|
||||
app2 := NewLaconicApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, encoding.MakeConfig(ModuleBasics), simapp.EmptyAppOptions{})
|
||||
_, err := app2.ExportAppStateAndValidators(false, []string{})
|
||||
require.NoError(t, err, "ExportAppStateAndValidators should not have an error")
|
||||
}
|
||||
|
||||
@ -12,9 +12,9 @@ import (
|
||||
dbm "github.com/tendermint/tm-db"
|
||||
)
|
||||
|
||||
func BenchmarkEthermintApp_ExportAppStateAndValidators(b *testing.B) {
|
||||
func BenchmarkLaconicApp_ExportAppStateAndValidators(b *testing.B) {
|
||||
db := dbm.NewMemDB()
|
||||
app := NewEthermintApp(log.NewTMLogger(io.Discard), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, encoding.MakeConfig(ModuleBasics), simapp.EmptyAppOptions{})
|
||||
app := NewLaconicApp(log.NewTMLogger(io.Discard), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, encoding.MakeConfig(ModuleBasics), simapp.EmptyAppOptions{})
|
||||
|
||||
genesisState := NewTestGenesisState(app.AppCodec())
|
||||
stateBytes, err := json.MarshalIndent(genesisState, "", " ")
|
||||
@ -36,7 +36,7 @@ func BenchmarkEthermintApp_ExportAppStateAndValidators(b *testing.B) {
|
||||
b.ReportAllocs()
|
||||
for i := 0; i < b.N; i++ {
|
||||
// Making a new app object with the db, so that initchain hasn't been called
|
||||
app2 := NewEthermintApp(log.NewTMLogger(log.NewSyncWriter(io.Discard)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, encoding.MakeConfig(ModuleBasics), simapp.EmptyAppOptions{})
|
||||
app2 := NewLaconicApp(log.NewTMLogger(log.NewSyncWriter(io.Discard)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, encoding.MakeConfig(ModuleBasics), simapp.EmptyAppOptions{})
|
||||
if _, err := app2.ExportAppStateAndValidators(false, []string{}); err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ func NewDefaultGenesisState() simapp.GenesisState {
|
||||
|
||||
// ExportAppStateAndValidators exports the state of the application for a genesis
|
||||
// file.
|
||||
func (app *EthermintApp) ExportAppStateAndValidators(
|
||||
func (app *LaconicApp) ExportAppStateAndValidators(
|
||||
forZeroHeight bool, jailAllowedAddrs []string,
|
||||
) (servertypes.ExportedApp, error) {
|
||||
// Creates context with current height and checks txs for ctx to be usable by start of next block
|
||||
@ -63,7 +63,7 @@ func (app *EthermintApp) ExportAppStateAndValidators(
|
||||
// prepare for fresh start at zero height
|
||||
// NOTE zero height genesis is a temporary feature which will be deprecated
|
||||
// in favor of export at a block height
|
||||
func (app *EthermintApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) error {
|
||||
func (app *LaconicApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) error {
|
||||
applyAllowedAddrs := false
|
||||
|
||||
// check if there is a allowed address list
|
||||
|
||||
@ -64,9 +64,9 @@ func fauxMerkleModeOpt(bapp *baseapp.BaseApp) {
|
||||
}
|
||||
|
||||
// NewSimApp disable feemarket on native tx, otherwise the cosmos-sdk simulation tests will fail.
|
||||
func NewSimApp(logger log.Logger, db dbm.DB) (*EthermintApp, error) {
|
||||
func NewSimApp(logger log.Logger, db dbm.DB) (*LaconicApp, error) {
|
||||
encodingConfig := MakeEncodingConfig()
|
||||
app := NewEthermintApp(logger, db, nil, false, map[int64]bool{}, DefaultNodeHome, simapp.FlagPeriodValue, encodingConfig, simapp.EmptyAppOptions{}, fauxMerkleModeOpt)
|
||||
app := NewLaconicApp(logger, db, nil, false, map[int64]bool{}, DefaultNodeHome, simapp.FlagPeriodValue, encodingConfig, simapp.EmptyAppOptions{}, fauxMerkleModeOpt)
|
||||
// disable feemarket on native tx
|
||||
anteHandler, err := ante.NewAnteHandler(ante.HandlerOptions{
|
||||
AccountKeeper: app.AccountKeeper,
|
||||
|
||||
@ -6,7 +6,7 @@ import (
|
||||
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
|
||||
)
|
||||
|
||||
func (app *EthermintApp) RegisterUpgradeHandlers() {
|
||||
func (app *LaconicApp) RegisterUpgradeHandlers() {
|
||||
planName := "integration-test-upgrade"
|
||||
app.UpgradeKeeper.SetUpgradeHandler(planName, func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
|
||||
return app.mm.RunMigrations(ctx, app.configurator, fromVM)
|
||||
|
||||
12
app/utils.go
12
app/utils.go
@ -34,7 +34,7 @@ import (
|
||||
)
|
||||
|
||||
// DefaultConsensusParams defines the default Tendermint consensus params used in
|
||||
// EthermintApp testing.
|
||||
// LaconicApp testing.
|
||||
var DefaultConsensusParams = &abci.ConsensusParams{
|
||||
Block: &abci.BlockParams{
|
||||
MaxBytes: 200000,
|
||||
@ -52,14 +52,14 @@ var DefaultConsensusParams = &abci.ConsensusParams{
|
||||
},
|
||||
}
|
||||
|
||||
// Setup initializes a new EthermintApp. A Nop logger is set in EthermintApp.
|
||||
func Setup(isCheckTx bool, patchGenesis func(*EthermintApp, simapp.GenesisState) simapp.GenesisState) *EthermintApp {
|
||||
// Setup initializes a new LaconicApp. A Nop logger is set in LaconicApp.
|
||||
func Setup(isCheckTx bool, patchGenesis func(*LaconicApp, simapp.GenesisState) simapp.GenesisState) *LaconicApp {
|
||||
return SetupWithDB(isCheckTx, patchGenesis, dbm.NewMemDB())
|
||||
}
|
||||
|
||||
// SetupWithDB initializes a new EthermintApp. A Nop logger is set in EthermintApp.
|
||||
func SetupWithDB(isCheckTx bool, patchGenesis func(*EthermintApp, simapp.GenesisState) simapp.GenesisState, db dbm.DB) *EthermintApp {
|
||||
app := NewEthermintApp(log.NewNopLogger(),
|
||||
// SetupWithDB initializes a new LaconicApp. A Nop logger is set in LaconicApp.
|
||||
func SetupWithDB(isCheckTx bool, patchGenesis func(*LaconicApp, simapp.GenesisState) simapp.GenesisState, db dbm.DB) *LaconicApp {
|
||||
app := NewLaconicApp(log.NewNopLogger(),
|
||||
db,
|
||||
nil,
|
||||
true,
|
||||
|
||||
@ -76,7 +76,7 @@ func TestStateFn(t *testing.T) {
|
||||
require.NoError(t, os.RemoveAll(dir))
|
||||
}()
|
||||
|
||||
app := NewEthermintApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, simapp.FlagPeriodValue, MakeEncodingConfig(), simapp.EmptyAppOptions{}, fauxMerkleModeOpt)
|
||||
app := NewLaconicApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, simapp.FlagPeriodValue, MakeEncodingConfig(), simapp.EmptyAppOptions{}, fauxMerkleModeOpt)
|
||||
require.Equal(t, appName, app.Name())
|
||||
|
||||
appStateFn := StateFn(app.AppCodec(), app.SimulationManager())
|
||||
|
||||
@ -231,7 +231,7 @@ func (a appCreator) newApp(logger tmlog.Logger, db dbm.DB, traceStore io.Writer,
|
||||
cast.ToUint32(appOpts.Get(sdkserver.FlagStateSyncSnapshotKeepRecent)),
|
||||
)
|
||||
|
||||
ethermintApp := app.NewEthermintApp(
|
||||
laconicApp := app.NewLaconicApp(
|
||||
logger, db, traceStore, true, skipUpgradeHeights,
|
||||
cast.ToString(appOpts.Get(flags.FlagHome)),
|
||||
cast.ToUint(appOpts.Get(sdkserver.FlagInvCheckPeriod)),
|
||||
@ -248,7 +248,7 @@ func (a appCreator) newApp(logger tmlog.Logger, db dbm.DB, traceStore io.Writer,
|
||||
baseapp.SetSnapshot(snapshotStore, snapshotOptions),
|
||||
)
|
||||
|
||||
return ethermintApp
|
||||
return laconicApp
|
||||
}
|
||||
|
||||
// appExport creates a new simapp (optionally at a given height)
|
||||
@ -257,21 +257,21 @@ func (a appCreator) appExport(
|
||||
logger tmlog.Logger, db dbm.DB, traceStore io.Writer, height int64, forZeroHeight bool, jailAllowedAddrs []string,
|
||||
appOpts servertypes.AppOptions,
|
||||
) (servertypes.ExportedApp, error) {
|
||||
var ethermintApp *app.EthermintApp
|
||||
var laconicApp *app.LaconicApp
|
||||
homePath, ok := appOpts.Get(flags.FlagHome).(string)
|
||||
if !ok || homePath == "" {
|
||||
return servertypes.ExportedApp{}, errors.New("application home not set")
|
||||
}
|
||||
|
||||
if height != -1 {
|
||||
ethermintApp = app.NewEthermintApp(logger, db, traceStore, false, map[int64]bool{}, "", uint(1), a.encCfg, appOpts)
|
||||
laconicApp = app.NewLaconicApp(logger, db, traceStore, false, map[int64]bool{}, "", uint(1), a.encCfg, appOpts)
|
||||
|
||||
if err := ethermintApp.LoadHeight(height); err != nil {
|
||||
if err := laconicApp.LoadHeight(height); err != nil {
|
||||
return servertypes.ExportedApp{}, err
|
||||
}
|
||||
} else {
|
||||
ethermintApp = app.NewEthermintApp(logger, db, traceStore, true, map[int64]bool{}, "", uint(1), a.encCfg, appOpts)
|
||||
laconicApp = app.NewLaconicApp(logger, db, traceStore, true, map[int64]bool{}, "", uint(1), a.encCfg, appOpts)
|
||||
}
|
||||
|
||||
return ethermintApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs)
|
||||
return laconicApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs)
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ func init() {
|
||||
type ImporterTestSuite struct {
|
||||
suite.Suite
|
||||
|
||||
app *app.EthermintApp
|
||||
app *app.LaconicApp
|
||||
ctx sdk.Context
|
||||
}
|
||||
|
||||
|
||||
@ -68,7 +68,7 @@ type AppConstructor = func(val Validator) servertypes.Application
|
||||
// NewAppConstructor returns a new simapp AppConstructor
|
||||
func NewAppConstructor(encodingCfg params.EncodingConfig) AppConstructor {
|
||||
return func(val Validator) servertypes.Application {
|
||||
return app.NewEthermintApp(
|
||||
return app.NewLaconicApp(
|
||||
val.Ctx.Logger, dbm.NewMemDB(), nil, true, make(map[int64]bool), val.Ctx.Config.RootDir, 0,
|
||||
encodingCfg,
|
||||
simapp.EmptyAppOptions{},
|
||||
|
||||
@ -16,13 +16,13 @@ import (
|
||||
|
||||
type KeeperTestSuite struct {
|
||||
suite.Suite
|
||||
app *app.EthermintApp
|
||||
app *app.LaconicApp
|
||||
ctx sdk.Context
|
||||
queryClient types.QueryClient
|
||||
}
|
||||
|
||||
func (suite *KeeperTestSuite) SetupTest() {
|
||||
testApp := app.Setup(false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
|
||||
testApp := app.Setup(false, func(ea *app.LaconicApp, genesis simapp.GenesisState) simapp.GenesisState {
|
||||
return genesis
|
||||
})
|
||||
ctx := testApp.BaseApp.NewContext(false, tmproto.Header{})
|
||||
@ -37,7 +37,7 @@ func (suite *KeeperTestSuite) SetupTest() {
|
||||
}
|
||||
|
||||
func TestParams(t *testing.T) {
|
||||
testApp := app.Setup(false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
|
||||
testApp := app.Setup(false, func(ea *app.LaconicApp, genesis simapp.GenesisState) simapp.GenesisState {
|
||||
return genesis
|
||||
})
|
||||
ctx := testApp.BaseApp.NewContext(false, tmproto.Header{})
|
||||
|
||||
@ -16,13 +16,13 @@ import (
|
||||
|
||||
type KeeperTestSuite struct {
|
||||
suite.Suite
|
||||
app *app.EthermintApp
|
||||
app *app.LaconicApp
|
||||
ctx sdk.Context
|
||||
queryClient types.QueryClient
|
||||
}
|
||||
|
||||
func (suite *KeeperTestSuite) SetupTest() {
|
||||
testApp := app.Setup(false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
|
||||
testApp := app.Setup(false, func(ea *app.LaconicApp, genesis simapp.GenesisState) simapp.GenesisState {
|
||||
return genesis
|
||||
})
|
||||
ctx := testApp.BaseApp.NewContext(false, tmproto.Header{})
|
||||
@ -37,7 +37,7 @@ func (suite *KeeperTestSuite) SetupTest() {
|
||||
}
|
||||
|
||||
func TestParams(t *testing.T) {
|
||||
testApp := app.Setup(false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
|
||||
testApp := app.Setup(false, func(ea *app.LaconicApp, genesis simapp.GenesisState) simapp.GenesisState {
|
||||
return genesis
|
||||
})
|
||||
ctx := testApp.BaseApp.NewContext(false, tmproto.Header{})
|
||||
|
||||
@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
func TestItCreatesModuleAccountOnInitBlock(t *testing.T) {
|
||||
app := app.Setup(false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
|
||||
app := app.Setup(false, func(ea *app.LaconicApp, genesis simapp.GenesisState) simapp.GenesisState {
|
||||
return genesis
|
||||
})
|
||||
ctx := app.BaseApp.NewContext(false, tmproto.Header{})
|
||||
|
||||
@ -50,7 +50,7 @@ type EvmTestSuite struct {
|
||||
|
||||
ctx sdk.Context
|
||||
handler sdk.Handler
|
||||
app *app.EthermintApp
|
||||
app *app.LaconicApp
|
||||
codec codec.Codec
|
||||
chainID *big.Int
|
||||
|
||||
@ -77,7 +77,7 @@ func (suite *EvmTestSuite) DoSetupTest(t require.TestingT) {
|
||||
require.NoError(t, err)
|
||||
consAddress := sdk.ConsAddress(priv.PubKey().Address())
|
||||
|
||||
suite.app = app.Setup(checkTx, func(app *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
|
||||
suite.app = app.Setup(checkTx, func(app *app.LaconicApp, genesis simapp.GenesisState) simapp.GenesisState {
|
||||
if suite.dynamicTxFee {
|
||||
feemarketGenesis := feemarkettypes.DefaultGenesisState()
|
||||
feemarketGenesis.Params.EnableHeight = 1
|
||||
|
||||
@ -168,7 +168,7 @@ func setupChain(localMinGasPricesStr string) {
|
||||
// Initialize the app, so we can use SetMinGasPrices to set the
|
||||
// validator-specific min-gas-prices setting
|
||||
db := dbm.NewMemDB()
|
||||
newapp := app.NewEthermintApp(
|
||||
newapp := app.NewLaconicApp(
|
||||
log.NewNopLogger(),
|
||||
db,
|
||||
nil,
|
||||
|
||||
@ -56,7 +56,7 @@ type KeeperTestSuite struct {
|
||||
suite.Suite
|
||||
|
||||
ctx sdk.Context
|
||||
app *app.EthermintApp
|
||||
app *app.LaconicApp
|
||||
queryClient types.QueryClient
|
||||
address common.Address
|
||||
consAddress sdk.ConsAddress
|
||||
@ -110,7 +110,7 @@ func (suite *KeeperTestSuite) SetupApp(checkTx bool) {
|
||||
require.NoError(t, err)
|
||||
suite.consAddress = sdk.ConsAddress(priv.PubKey().Address())
|
||||
|
||||
suite.app = app.Setup(checkTx, func(app *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
|
||||
suite.app = app.Setup(checkTx, func(app *app.LaconicApp, genesis simapp.GenesisState) simapp.GenesisState {
|
||||
feemarketGenesis := feemarkettypes.DefaultGenesisState()
|
||||
if suite.enableFeemarket {
|
||||
feemarketGenesis.Params.EnableHeight = 1
|
||||
|
||||
@ -483,7 +483,7 @@ func setupChain(localMinGasPricesStr string) {
|
||||
// Initialize the app, so we can use SetMinGasPrices to set the
|
||||
// validator-specific min-gas-prices setting
|
||||
db := dbm.NewMemDB()
|
||||
newapp := app.NewEthermintApp(
|
||||
newapp := app.NewLaconicApp(
|
||||
log.NewNopLogger(),
|
||||
db,
|
||||
nil,
|
||||
|
||||
@ -44,7 +44,7 @@ type KeeperTestSuite struct {
|
||||
suite.Suite
|
||||
|
||||
ctx sdk.Context
|
||||
app *app.EthermintApp
|
||||
app *app.LaconicApp
|
||||
queryClient types.QueryClient
|
||||
address common.Address
|
||||
consAddress sdk.ConsAddress
|
||||
|
||||
@ -21,7 +21,7 @@ var seed = int64(233)
|
||||
|
||||
type KeeperTestSuite struct {
|
||||
suite.Suite
|
||||
app *app.EthermintApp
|
||||
app *app.LaconicApp
|
||||
ctx sdk.Context
|
||||
queryClient types.QueryClient
|
||||
accounts []sdk.AccAddress
|
||||
@ -29,7 +29,7 @@ type KeeperTestSuite struct {
|
||||
}
|
||||
|
||||
func (suite *KeeperTestSuite) SetupTest() {
|
||||
testApp := app.Setup(false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
|
||||
testApp := app.Setup(false, func(ea *app.LaconicApp, genesis simapp.GenesisState) simapp.GenesisState {
|
||||
return genesis
|
||||
})
|
||||
ctx := testApp.BaseApp.NewContext(false, tmproto.Header{})
|
||||
@ -58,7 +58,7 @@ func (suite *KeeperTestSuite) SetupTest() {
|
||||
}
|
||||
|
||||
func TestParams(t *testing.T) {
|
||||
testApp := app.Setup(false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
|
||||
testApp := app.Setup(false, func(ea *app.LaconicApp, genesis simapp.GenesisState) simapp.GenesisState {
|
||||
return genesis
|
||||
})
|
||||
ctx := testApp.BaseApp.NewContext(false, tmproto.Header{})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user