app

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: LGPL-3.0 Imports: 158 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "qomd"

Name defines the application binary name

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.AppModuleBasic{},
		bank.AppModuleBasic{},
		capability.AppModuleBasic{},
		staking.AppModuleBasic{},
		distr.AppModuleBasic{},
		gov.NewAppModuleBasic(
			[]govclient.ProposalHandler{
				paramsclient.ProposalHandler, distrclient.ProposalHandler, upgradeclient.LegacyProposalHandler, upgradeclient.LegacyCancelProposalHandler,
				ibcclientclient.UpdateClientProposalHandler, ibcclientclient.UpgradeProposalHandler,

				erc20client.RegisterCoinProposalHandler, erc20client.RegisterERC20ProposalHandler, erc20client.ToggleTokenConversionProposalHandler,
				incentivesclient.RegisterIncentiveProposalHandler, incentivesclient.CancelIncentiveProposalHandler,
			},
		),
		params.AppModuleBasic{},
		crisis.AppModuleBasic{},
		slashing.AppModuleBasic{},
		ibc.AppModuleBasic{},
		ica.AppModuleBasic{},
		authzmodule.AppModuleBasic{},
		feegrantmodule.AppModuleBasic{},
		upgrade.AppModuleBasic{},
		evidence.AppModuleBasic{},
		transfer.AppModuleBasic{AppModuleBasic: &ibctransfer.AppModuleBasic{}},
		vesting.AppModuleBasic{},
		evm.AppModuleBasic{},
		feemarket.AppModuleBasic{},
		inflation.AppModuleBasic{},
		erc20.AppModuleBasic{},
		incentives.AppModuleBasic{},
		epochs.AppModuleBasic{},
		claims.AppModuleBasic{},
		recovery.AppModuleBasic{},
		revenue.AppModuleBasic{},
	)
)
View Source
var (
	// MainnetMinGasPrices defines 20B aevmos (or atevmos) 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 = &abci.ConsensusParams{
	Block: &abci.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 Qom testing.

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

DefaultTestingAppInit defines the IBC application used for testing

Functions

func ConsumeMultisignatureVerificationGas

func ConsumeMultisignatureVerificationGas(
	meter sdk.GasMeter, sig *signing.MultiSignatureData, pubkey multisig.PubKey,
	params authtypes.Params, accSeq uint64,
) error

ConsumeMultisignatureVerificationGas consumes gas from a GasMeter for verifying a multisig pubkey signature

func GenesisStateWithValSet

func GenesisStateWithValSet(app *Qom, 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 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() (ibctesting.TestingApp, map[string]json.RawMessage)

SetupTestingApp initializes the IBC-go testing application

func SigVerificationGasConsumer

func SigVerificationGasConsumer(
	meter sdk.GasMeter, sig signing.SignatureV2, params authtypes.Params,
) error

SigVerificationGasConsumer is the Qom implementation of SignatureVerificationGasConsumer. It consumes gas for signature verification based upon the public key type. The cost is fetched from the given params and is matched by the concrete type. The types of keys supported are:

- ethsecp256k1 (Ethereum keys)

- ed25519 (Validators)

- multisig (Cosmos SDK multisigs)

Types

type Qom

type Qom 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

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

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

	// Qom keepers
	InflationKeeper  inflationkeeper.Keeper
	ClaimsKeeper     *claimskeeper.Keeper
	Erc20Keeper      erc20keeper.Keeper
	IncentivesKeeper incentiveskeeper.Keeper
	EpochsKeeper     epochskeeper.Keeper
	VestingKeeper    vestingkeeper.Keeper
	RecoveryKeeper   *recoverykeeper.Keeper
	RevenueKeeper    revenuekeeper.Keeper
	// contains filtered or unexported fields
}

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

func NewQom

func NewQom(
	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),
) *Qom

NewQom returns a reference to a new initialized Ethermint application.

func Setup

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

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

func (*Qom) AppCodec

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

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

func (app *Qom) 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 (*Qom) BlockedAddrs

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

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

func (*Qom) DeliverTx

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

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

func (*Qom) EndBlocker

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

EndBlocker updates every end block

func (*Qom) ExportAppStateAndValidators

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

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

func (*Qom) GetBaseApp

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

GetBaseApp implements the TestingApp interface.

func (*Qom) GetIBCKeeper

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

GetIBCKeeper implements the TestingApp interface.

func (*Qom) GetKey

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

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

GetMemKey returns the MemStoreKey for the provided mem key.

NOTE: This is solely used for testing purposes.

func (*Qom) GetScopedIBCKeeper

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

GetScopedIBCKeeper implements the TestingApp interface.

func (*Qom) GetStakingKeeper

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

GetStakingKeeper implements the TestingApp interface.

func (*Qom) GetStakingKeeperSDK

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

GetStakingKeeperSDK implements the TestingApp interface.

func (*Qom) GetSubspace

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

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

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

GetTxConfig implements the TestingApp interface.

func (*Qom) InitChainer

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

InitChainer updates at chain initialization

func (*Qom) InterfaceRegistry

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

InterfaceRegistry returns Qom's InterfaceRegistry

func (*Qom) LegacyAmino

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

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

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

LoadHeight loads state at a particular height

func (*Qom) ModuleAccountAddrs

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

ModuleAccountAddrs returns all the app's module account addresses.

func (*Qom) Name

func (app *Qom) Name() string

Name returns the name of the App

func (*Qom) RegisterAPIRoutes

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

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

func (*Qom) RegisterNodeService

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

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

func (*Qom) RegisterTendermintService

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

RegisterTendermintService implements the Application.RegisterTendermintService method.

func (*Qom) RegisterTxService

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

func (*Qom) ScheduleForkUpgrade

func (app *Qom) 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).

Jump to

Keyboard shortcuts

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