app

package
v1.0.0-alpha1 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: LGPL-3.0 Imports: 138 Imported by: 1

Documentation

Index

Constants

View Source
const Name = "tabid"

Name defines the application binary name

Variables

View Source
var (
	// MainnetMinGasPrices defines 20B atabi as the minimum gas price value on the fee market module.
	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 (
	// 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{},
		mint.AppModuleBasic{},
		distr.AppModuleBasic{},
		gov.NewAppModuleBasic(getGovProposalHandlers()),
		params.AppModuleBasic{},
		crisis.AppModuleBasic{},
		slashing.AppModuleBasic{},
		ibc.AppModuleBasic{},
		authzmodule.AppModuleBasic{},
		feegrantmodule.AppModuleBasic{},
		upgrade.AppModuleBasic{},
		evidence.AppModuleBasic{},
		ibctransfer.AppModuleBasic{},
		vesting.AppModuleBasic{},

		evm.AppModuleBasic{},
		feemarket.AppModuleBasic{},

		claims.AppModuleBasic{},
		captainnode.AppModule{},
		tokenconvert.AppModuleBasic{},
	)
)
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 Tabi testing.

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

DefaultTestingAppInit defines the IBC application used for testing

View Source
var EthDefaultConsensusParams = &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,
		},
	},
}

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

Functions

func GenesisStateWithValSet

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

SetupTestingApp initializes the IBC-go testing application

Types

type Tabi

type Tabi struct {
	*baseapp.BaseApp

	// keepers
	AccountKeeper    authkeeper.AccountKeeper
	BankKeeper       bankkeeper.Keeper
	CapabilityKeeper *capabilitykeeper.Keeper
	StakingKeeper    stakingkeeper.Keeper
	SlashingKeeper   slashingkeeper.Keeper
	MintKeeper       mintkeeper.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
	EvidenceKeeper   evidencekeeper.Keeper
	TransferKeeper   ibctransferkeeper.Keeper

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

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

	// Tabi keepers
	ClaimsKeeper       claimskeeper.Keeper
	CaptainsKeeper     captainskeeper.Keeper
	TokenConvertKeeper tokenconvertkeeper.Keeper
	// contains filtered or unexported fields
}

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

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

func EthSetupWithDB

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

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

func NewTabi

func NewTabi(
	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),
) *Tabi

NewTabi returns a reference to a new initialized Ethermint application.

func Setup

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

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

func (*Tabi) AppCodec

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

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

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

BeginBlocker runs the Tendermint ABCI BeginBlock logic.

func (*Tabi) BlockedAddrs

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

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

func (*Tabi) DeliverTx

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

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

func (*Tabi) EndBlocker

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

EndBlocker updates every end block

func (*Tabi) ExportAppStateAndValidators

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

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

func (*Tabi) GetBaseApp

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

GetBaseApp implements the TestingApp interface.

func (*Tabi) GetIBCKeeper

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

GetIBCKeeper implements the TestingApp interface.

func (*Tabi) GetKey

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

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

GetMemKey returns the MemStoreKey for the provided mem key.

NOTE: This is solely used for testing purposes.

func (*Tabi) GetScopedIBCKeeper

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

GetScopedIBCKeeper implements the TestingApp interface.

func (*Tabi) GetStakingKeeper

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

GetStakingKeeper implements the TestingApp interface.

func (*Tabi) GetStakingKeeperSDK

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

GetStakingKeeperSDK implements the TestingApp interface.

func (*Tabi) GetSubspace

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

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

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

GetTxConfig implements the TestingApp interface.

func (*Tabi) InitChainer

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

InitChainer updates at chain initialization

func (*Tabi) InterfaceRegistry

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

InterfaceRegistry returns Tabi's InterfaceRegistry

func (*Tabi) LegacyAmino

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

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

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

LoadHeight loads state at a particular height

func (*Tabi) ModuleAccountAddrs

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

ModuleAccountAddrs returns all the app's module account addresses.

func (*Tabi) Name

func (app *Tabi) Name() string

Name returns the name of the App

func (*Tabi) RegisterAPIRoutes

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

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

func (*Tabi) RegisterNodeService

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

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

func (*Tabi) RegisterTendermintService

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

RegisterTendermintService implements the Application.RegisterTendermintService method.

func (*Tabi) RegisterTxService

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

func (*Tabi) RegisterUpgradePlans

func (app *Tabi) RegisterUpgradePlans()

RegisterUpgradePlans register a handler of upgrade plan

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