app

package
v0.4.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: LGPL-3.0 Imports: 124 Imported by: 0

Documentation

Overview

Copyright 2022 Evmos Foundation This file is part of the Evmos Network packages.

Evmos is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The Evmos packages are distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with the Evmos packages. If not, see https://github.com/evmos/evmos/blob/main/LICENSE

Index

Constants

View Source
const Name = "mezod"

Name defines the application binary name

Variables

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

	DefaultOracleTimeout = time.Second

	// 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(
		consensusparams.AppModuleBasic{},
		auth.AppModuleBasic{},
		bank.AppModuleBasic{},
		poa.AppModuleBasic{},
		params.AppModuleBasic{},
		crisis.AppModuleBasic{},
		authzmodule.AppModuleBasic{},
		upgrade.AppModuleBasic{},
		evm.AppModuleBasic{},
		feemarket.AppModuleBasic{},
		bridge.AppModuleBasic{},
		marketmap.AppModuleBasic{},
		oracle.AppModuleBasic{},
	)
)
View Source
var (
	// MainnetMinGasPrices defines 20B abtc as the minimum gas price value on the fee market module.
	// See https://commonwealth.im/evmos/discussion/5073-global-min-gas-price-value-for-cosmos-sdk-and-evm-transaction-choosing-a-value for reference
	MainnetMinGasPrices = sdkmath.LegacyNewDec(20_000_000_000)
	// MainnetMinGasMultiplier defines the min gas multiplier value on the fee market module.
	// 50% of the leftover gas will be refunded
	MainnetMinGasMultiplier = sdkmath.LegacyNewDecWithPrec(5, 1)
)
View Source
var (
	Upgrades = []upgrades.Upgrade{v0_3.Upgrade}
	Forks    = []upgrades.Fork{v0_3.Fork, v0_4.Fork}
)
View Source
var DefaultConsensusParams = &tmproto.ConsensusParams{
	Block: &tmproto.BlockParams{
		MaxBytes: 200000,
		MaxGas:   10000000,
	},
	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 Mezo testing.

Functions

func GenesisStateWithValSet

func GenesisStateWithValSet(
	app *Mezo,
	genesisState simapp.GenesisState,
	owner sdk.AccAddress,
	valSet *tmtypes.ValidatorSet,
	genAccs []authtypes.GenesisAccount,
	balances ...banktypes.Balance,
) simapp.GenesisState

func NewDefaultGenesisState

func NewDefaultGenesisState() simapp.GenesisState

NewDefaultGenesisState generates the default state for the application.

func NewTestGenesisState

func NewTestGenesisState(codec codec.Codec) simapp.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 ConnectVEExtractionCodec

type ConnectVEExtractionCodec struct {
	// contains filtered or unexported fields
}

func (*ConnectVEExtractionCodec) Decode

Decode takes a set of vote extension data and returns the OracleVoteExtension

func (*ConnectVEExtractionCodec) Encode

Encode just passes through to the wrapped VoteExtensionCodec

type Mezo

type Mezo struct {
	*baseapp.BaseApp

	// keepers
	ConsensusParamsKeeper consensusparamskeeper.Keeper
	AccountKeeper         authkeeper.AccountKeeper
	BankKeeper            bankkeeper.Keeper
	PoaKeeper             poakeeper.Keeper
	CrisisKeeper          *crisiskeeper.Keeper
	UpgradeKeeper         *upgradekeeper.Keeper
	ParamsKeeper          paramskeeper.Keeper
	AuthzKeeper           authzkeeper.Keeper
	EvmKeeper             *evmkeeper.Keeper
	FeeMarketKeeper       feemarketkeeper.Keeper
	BridgeKeeper          bridgekeeper.Keeper
	OracleKeeper          oraclekeeper.Keeper
	MarketMapKeeper       marketmapkeeper.Keeper
	// contains filtered or unexported fields
}

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

func EthSetup

func EthSetup(isCheckTx bool, patchGenesis func(*Mezo, simapp.GenesisState) simapp.GenesisState) *Mezo

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

func EthSetupWithDB

func EthSetupWithDB(isCheckTx bool, patchGenesis func(*Mezo, simapp.GenesisState) simapp.GenesisState, db dbm.DB) *Mezo

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

func NewMezo

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

NewMezo returns a reference to a new initialized Ethermint application.

func Setup

func Setup(
	isCheckTx bool,
	feemarketGenesis *feemarkettypes.GenesisState,
) *Mezo

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

func (*Mezo) AppCodec

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

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

func (app *Mezo) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error)

func (*Mezo) BlockedAddrs

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

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

func (*Mezo) EndBlocker

func (app *Mezo) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error)

func (*Mezo) ExportAppStateAndValidators

func (app *Mezo) ExportAppStateAndValidators(
	forZeroHeight bool, _ []string,
) (servertypes.ExportedApp, error)

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

func (*Mezo) FinalizeBlock

func (app *Mezo) FinalizeBlock(req *abci.RequestFinalizeBlock) (
	res *abci.ResponseFinalizeBlock,
	err error,
)

FinalizeBlock method is intentionally decomposed to calculate the transactions per second.

func (*Mezo) GetBaseApp

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

GetBaseApp implements the TestingApp interface.

func (*Mezo) GetKeepers

func (app *Mezo) GetKeepers() *upgrades.Keepers

func (*Mezo) GetKey

func (app *Mezo) 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 (*Mezo) GetSubspace

func (app *Mezo) 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 (*Mezo) GetTKey

func (app *Mezo) 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 (*Mezo) GetTxConfig

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

GetTxConfig implements the TestingApp interface.

func (*Mezo) InitChainer

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

InitChainer updates at chain initialization

func (*Mezo) InterfaceRegistry

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

InterfaceRegistry returns Mezo's InterfaceRegistry

func (*Mezo) LegacyAmino

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

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

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

LoadHeight loads state at a particular height

func (*Mezo) ModuleAccountAddrs

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

ModuleAccountAddrs returns all the app's module account addresses.

func (*Mezo) Name

func (app *Mezo) Name() string

Name returns the name of the App

func (*Mezo) PreBlocker

func (app *Mezo) PreBlocker(
	ctx sdk.Context,
	req *abci.RequestFinalizeBlock,
) (*sdk.ResponsePreBlock, error)

func (*Mezo) RegisterAPIRoutes

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

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

func (*Mezo) RegisterNodeService

func (app *Mezo) RegisterNodeService(
	clientCtx client.Context,
	cfg config.Config,
)

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

func (*Mezo) RegisterTendermintService

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

RegisterTendermintService implements the Application.RegisterTendermintService method.

func (*Mezo) RegisterTxService

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

Directories

Path Synopsis
Package ante defines the SDK auth module's AnteHandler as well as an internal AnteHandler for an Ethereum transaction (i.e MsgEthereumTx).
Package ante defines the SDK auth module's AnteHandler as well as an internal AnteHandler for an Ethereum transaction (i.e MsgEthereumTx).
evm

Jump to

Keyboard shortcuts

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