app

package
v0.0.0-...-a6078a4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 117 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Name defines the application binary name
	Name = "evmmd"
)
View Source
const PremintAmount = 20_000_000_000

Variables

View Source
var (
	// DefaultNodeHome default home directories for the application daemon
	DefaultNodeHome string

	// ModuleBasics defines the module BasicManager is in charge of setting up basic,
	// non-dependant module elements, such as codec registration
	// and genesis verification.
	ModuleBasics = module.NewBasicManager(
		auth.AppModuleBasic{},
		genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator),
		bank.AppModuleBasic{},
		capability.AppModuleBasic{},
		staking.AppModuleBasic{},
		distr.AppModuleBasic{},
		gov.NewAppModuleBasic(
			[]govclient.ProposalHandler{
				paramsclient.ProposalHandler, upgradeclient.LegacyProposalHandler, upgradeclient.LegacyCancelProposalHandler,
			},
		),
		params.AppModuleBasic{},
		crisis.AppModuleBasic{},
		slashing.AppModuleBasic{},
		authzmodule.AppModuleBasic{},
		feegrantmodule.AppModuleBasic{},
		upgrade.AppModuleBasic{},
		evidence.AppModuleBasic{},
		evm.AppModuleBasic{},
		feemarket.AppModuleBasic{},
		consensus.AppModuleBasic{},
	)
)
View Source
var (
	MinGasPrices     = sdk.NewDec(20_000_000_000)
	MinGasMultiplier = sdk.NewDecWithPrec(5, 1)
)
View Source
var DefaultConsensusParams = &tmproto.ConsensusParams{
	Block: &tmproto.BlockParams{
		MaxBytes: 200000,
		MaxGas:   -1,
	},
	Evidence: &tmproto.EvidenceParams{
		MaxAgeNumBlocks: 302400,
		MaxAgeDuration:  504 * time.Hour,
		MaxBytes:        10000,
	},
	Validator: &tmproto.ValidatorParams{
		PubKeyTypes: []string{
			tmtypes.ABCIPubKeyTypeEd25519,
		},
	},
}

DefaultConsensusParams defines the default Tendermint consensus params used in Evmos testing.

View Source
var EthDefaultConsensusParams = &tmproto.ConsensusParams{
	Block: &tmproto.BlockParams{
		MaxBytes: 200000,
		MaxGas:   -1,
	},
	Evidence: &tmproto.EvidenceParams{
		MaxAgeNumBlocks: 302400,
		MaxAgeDuration:  504 * time.Hour,
		MaxBytes:        10000,
	},
	Validator: &tmproto.ValidatorParams{
		PubKeyTypes: []string{
			tmtypes.ABCIPubKeyTypeEd25519,
		},
	},
}

EthDefaultConsensusParams defines the default Tendermint consensus params used in EvmmApp testing.

Functions

func GenesisStateWithValSet

func GenesisStateWithValSet(app *EvmM, genesisState types.GenesisState,
	valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount,
	balances ...banktypes.Balance,
) types.GenesisState

func GetMaccPerms

func GetMaccPerms() map[string][]string

GetMaccPerms returns a copy of the module account permissions

func NewDefaultGenesisState

func NewDefaultGenesisState() types.GenesisState

NewDefaultGenesisState generates the default state for the application.

func NewTestGenesisState

func NewTestGenesisState(codec codec.Codec) types.GenesisState

NewTestGenesisState generate genesis state with single validator

func ObservabilityViews

func ObservabilityViews() (views []*view.View)

func RegisterSwaggerAPI

func RegisterSwaggerAPI(_ client.Context, rtr *mux.Router)

RegisterSwaggerAPI registers swagger route with API Server

Types

type EvmM

type EvmM struct {
	*baseapp.BaseApp

	// keepers
	AccountKeeper         authkeeper.AccountKeeper
	BankKeeper            bankkeeper.Keeper
	CapabilityKeeper      *capabilitykeeper.Keeper
	StakingKeeper         stakingkeeper.Keeper
	SlashingKeeper        slashingkeeper.Keeper
	DistrKeeper           distrkeeper.Keeper
	GovKeeper             govkeeper.Keeper
	CrisisKeeper          crisiskeeper.Keeper
	UpgradeKeeper         upgradekeeper.Keeper
	ParamsKeeper          paramskeeper.Keeper
	FeeGrantKeeper        feegrantkeeper.Keeper
	AuthzKeeper           authzkeeper.Keeper
	EvidenceKeeper        evidencekeeper.Keeper
	ConsensusParamsKeeper consensusparamkeeper.Keeper

	// EVM keepers
	EvmKeeper       *evmkeeper.Keeper
	FeeMarketKeeper feemarketkeeper.Keeper
	// contains filtered or unexported fields
}

EvmM implements an extended ABCI application. It is an application that may process transactions through Ethereum's EVM running atop of CometBFT consensus.

func EthSetup

func EthSetup(isCheckTx bool, patchGenesis func(*EvmM, types.GenesisState) types.GenesisState) *EvmM

EthSetup initializes a new EvmmApp. A Nop logger is set in EvmmApp.

func EthSetupWithDB

func EthSetupWithDB(isCheckTx bool, patchGenesis func(*EvmM, types.GenesisState) types.GenesisState, db dbm.DB) *EvmM

EthSetupWithDB initializes a new EvmmApp. A Nop logger is set in EvmmApp.

func NewEvmM

func NewEvmM(
	logger log.Logger,
	db dbm.DB,
	traceStore io.Writer,
	loadLatest bool,
	skipUpgradeHeights map[int64]bool,
	homePath string,
	invCheckPeriod uint,
	encodingConfig simappparams.EncodingConfig,
	appOpts servertypes.AppOptions,
	baseAppOptions ...func(*baseapp.BaseApp),
) *EvmM

NewEvmM returns a reference to a new initialized Ethermint application.

func Setup

func Setup(
	isCheckTx bool,
	feemarketGenesis *feemarkettypes.GenesisState,
) (*EvmM, []byte)

Setup initializes a new Evmos. A Nop logger is set in Evmos.

func (*EvmM) AppCodec

func (app *EvmM) AppCodec() codec.Codec

AppCodec returns EvmM'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 (*EvmM) BeginBlocker

func (app *EvmM) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock

BeginBlocker runs the CometBFT ABCI BeginBlock logic. It executes state changes at the beginning of the new block for every registered module. If there is a registered fork at the current height, BeginBlocker will schedule the upgrade plan and perform the state migration (if any).

func (*EvmM) BlockedAddrs

func (app *EvmM) BlockedAddrs() map[string]bool

BlockedAddrs returns all the app's module account addresses that are not allowed to receive external tokens.

func (*EvmM) DeliverTx

func (app *EvmM) DeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDeliverTx)

We are intentionally decomposing the DeliverTx method so as to calculate the transactions per second.

func (*EvmM) EndBlocker

func (app *EvmM) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock

EndBlocker updates every end block

func (*EvmM) ExportAppStateAndValidators

func (app *EvmM) ExportAppStateAndValidators(
	forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string,
) (servertypes.ExportedApp, error)

ExportAppStateAndValidators exports the state of the application for a genesis file.

func (*EvmM) GetBaseApp

func (app *EvmM) GetBaseApp() *baseapp.BaseApp

GetBaseApp implements the TestingApp interface.

func (*EvmM) GetKey

func (app *EvmM) GetKey(storeKey string) *storetypes.KVStoreKey

GetKey returns the KVStoreKey for the provided store key.

NOTE: This is solely to be used for testing purposes.

func (*EvmM) GetMemKey

func (app *EvmM) GetMemKey(storeKey string) *storetypes.MemoryStoreKey

GetMemKey returns the MemStoreKey for the provided mem key.

NOTE: This is solely used for testing purposes.

func (*EvmM) GetSubspace

func (app *EvmM) GetSubspace(moduleName string) paramstypes.Subspace

GetSubspace returns a param subspace for a given module name.

NOTE: This is solely to be used for testing purposes.

func (*EvmM) GetTKey

func (app *EvmM) GetTKey(storeKey string) *storetypes.TransientStoreKey

GetTKey returns the TransientStoreKey for the provided store key.

NOTE: This is solely to be used for testing purposes.

func (*EvmM) GetTxConfig

func (app *EvmM) GetTxConfig() client.TxConfig

GetTxConfig implements the TestingApp interface.

func (*EvmM) InitChainer

func (app *EvmM) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain

InitChainer updates at chain initialization

func (*EvmM) InterfaceRegistry

func (app *EvmM) InterfaceRegistry() types.InterfaceRegistry

InterfaceRegistry returns EvmM's InterfaceRegistry

func (*EvmM) LegacyAmino

func (app *EvmM) LegacyAmino() *codec.LegacyAmino

LegacyAmino returns EvmM'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 (*EvmM) LoadHeight

func (app *EvmM) LoadHeight(height int64) error

LoadHeight loads state at a particular height

func (*EvmM) ModuleAccountAddrs

func (app *EvmM) ModuleAccountAddrs() map[string]bool

ModuleAccountAddrs returns all the app's module account addresses.

func (*EvmM) Name

func (app *EvmM) Name() string

Name returns the name of the App

func (*EvmM) RegisterAPIRoutes

func (app *EvmM) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)

RegisterAPIRoutes registers all application module routes with the provided API server.

func (*EvmM) RegisterNodeService

func (app *EvmM) RegisterNodeService(clientCtx client.Context)

RegisterNodeService registers the node gRPC service on the provided application gRPC query router.

func (*EvmM) RegisterTendermintService

func (app *EvmM) RegisterTendermintService(clientCtx client.Context)

func (*EvmM) RegisterTxService

func (app *EvmM) RegisterTxService(clientCtx client.Context)

func (*EvmM) SimulationManager

func (app *EvmM) SimulationManager() *module.SimulationManager

SimulationManager implements the SimulationApp interface

Directories

Path Synopsis
evm

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL