5b2f068a03
* ante: switch ethAnteHandler to use AnteDecorators * ante: cleanup panic recover, update MsgEthereumTx GetSigners * ante: remove EthIntrinsicGasDecorator in favor of EthGasConsumeDecorator * migrate errors
35 lines
811 B
Go
35 lines
811 B
Go
package app
|
|
|
|
import (
|
|
abci "github.com/tendermint/tendermint/abci/types"
|
|
"github.com/tendermint/tendermint/libs/log"
|
|
dbm "github.com/tendermint/tm-db"
|
|
|
|
"github.com/cosmos/cosmos-sdk/codec"
|
|
)
|
|
|
|
// Setup initializes a new EthermintApp. A Nop logger is set in EthermintApp.
|
|
func Setup(isCheckTx bool) *EthermintApp {
|
|
db := dbm.NewMemDB()
|
|
app := NewEthermintApp(log.NewNopLogger(), db, nil, true, 0)
|
|
|
|
if !isCheckTx {
|
|
// init chain must be called to stop deliverState from being nil
|
|
genesisState := NewDefaultGenesisState()
|
|
stateBytes, err := codec.MarshalJSONIndent(app.Codec(), genesisState)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
// Initialize the chain
|
|
app.InitChain(
|
|
abci.RequestInitChain{
|
|
Validators: []abci.ValidatorUpdate{},
|
|
AppStateBytes: stateBytes,
|
|
},
|
|
)
|
|
}
|
|
|
|
return app
|
|
}
|