app

package
v12.2.4 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: LGPL-3.0 Imports: 144 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// MainnetMinGasPrices defines 20B (20 gas-aservo) 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 = sdk.NewDec(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 = 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 Serv testing.

View Source
var DefaultTestingAppInit func(chainId string) func() (ibctesting.TestingApp, map[string]json.RawMessage) = SetupTestingApp

DefaultTestingAppInit defines the IBC application used for 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 Serv app testing.

Functions

func GenesisStateWithValSet

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

func GetMaccPerms

func GetMaccPerms() map[string][]string

GetMaccPerms returns a copy of the module account permissions

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

func SetupTestingApp

func SetupTestingApp(chainID string) func() (ibctesting.TestingApp, map[string]json.RawMessage)

SetupTestingApp initializes the IBC-go testing application

Types

type Serv

type Serv 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
	IBCKeeper             *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
	ICAHostKeeper         icahostkeeper.Keeper
	EvidenceKeeper        evidencekeeper.Keeper
	TransferKeeper        transferkeeper.Keeper
	ConsensusParamsKeeper consensusparamkeeper.Keeper
	MintKeeper            mintkeeper.Keeper

	// make scoped keepers public for test purposes
	ScopedIBCKeeper      capabilitykeeper.ScopedKeeper
	ScopedTransferKeeper capabilitykeeper.ScopedKeeper

	// Ethermint keepers
	EvmKeeper       *evmkeeper.Keeper
	FeeMarketKeeper feemarketkeeper.Keeper

	// Serv keepers
	Erc20Keeper   erc20keeper.Keeper
	VestingKeeper vestingkeeper.Keeper
	// contains filtered or unexported fields
}

Serv 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(*Serv, simapp.GenesisState) simapp.GenesisState) *Serv

EthSetup initializes a new Serv app. A Nop logger is set in Serv app.

func EthSetupWithDB

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

EthSetupWithDB initializes a new Serv app. A Nop logger is set in Serv app.

func NewServ

func NewServ(
	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),
) *Serv

NewServ returns a reference to a new initialized Ethermint application.

func Setup

func Setup(
	isCheckTx bool,
	feemarketGenesis *feemarkettypes.GenesisState,
	chainID string,
) *Serv

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

func (*Serv) AppCodec

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

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

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

BeginBlocker runs the Tendermint 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 (*Serv) BlockedAddrs

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

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

func (*Serv) DeliverTx

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

The DeliverTx method is intentionally decomposed to calculate the transactions per second.

func (*Serv) EndBlocker

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

EndBlocker updates every end block

func (*Serv) ExportAppStateAndValidators

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

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

func (*Serv) GetBaseApp

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

GetBaseApp implements the TestingApp interface.

func (*Serv) GetIBCKeeper

func (app *Serv) GetIBCKeeper() *ibckeeper.Keeper

GetIBCKeeper implements the TestingApp interface.

func (*Serv) GetKey

func (app *Serv) 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 (*Serv) GetMemKey

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

GetMemKey returns the MemStoreKey for the provided mem key.

NOTE: This is solely used for testing purposes.

func (*Serv) GetScopedIBCKeeper

func (app *Serv) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper

GetScopedIBCKeeper implements the TestingApp interface.

func (*Serv) GetStakingKeeper

func (app *Serv) GetStakingKeeper() ibctestingtypes.StakingKeeper

GetStakingKeeper implements the TestingApp interface.

func (*Serv) GetStakingKeeperSDK

func (app *Serv) GetStakingKeeperSDK() stakingkeeper.Keeper

GetStakingKeeperSDK implements the TestingApp interface.

func (*Serv) GetSubspace

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

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

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

GetTxConfig implements the TestingApp interface.

func (*Serv) InitChainer

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

InitChainer updates at chain initialization

func (*Serv) InterfaceRegistry

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

InterfaceRegistry returns Serv's InterfaceRegistry

func (*Serv) LegacyAmino

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

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

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

LoadHeight loads state at a particular height

func (*Serv) ModuleAccountAddrs

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

ModuleAccountAddrs returns all the app's module account addresses.

func (*Serv) Name

func (app *Serv) Name() string

Name returns the name of the App

func (*Serv) RegisterAPIRoutes

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

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

func (*Serv) RegisterNodeService

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

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

func (*Serv) RegisterTendermintService

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

RegisterTendermintService implements the Application.RegisterTendermintService method.

func (*Serv) RegisterTxService

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

func (*Serv) ScheduleForkUpgrade

func (app *Serv) ScheduleForkUpgrade(ctx sdk.Context)

ScheduleForkUpgrade executes any necessary fork logic for based upon the current block height and chain ID (mainnet or testnet). It sets an upgrade plan once the chain reaches the pre-defined upgrade height.

CONTRACT: for this logic to work properly it is required to:

  1. Release a non-breaking patch version so that the chain can set the scheduled upgrade plan at upgrade-height.
  2. Release the software defined in the upgrade-info

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
upgrades

Jump to

Keyboard shortcuts

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