app

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: Apache-2.0 Imports: 152 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "teleport"

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(
			paramsclient.ProposalHandler,
			distrclient.ProposalHandler,
			upgradeclient.ProposalHandler,
			upgradeclient.CancelProposalHandler,

			ibcclientclient.UpdateClientProposalHandler,
			ibcclientclient.UpgradeProposalHandler,

			xibcclientcli.CreateClientProposalHandler,
			xibcclientcli.UpgradeClientProposalHandler,
			xibcclientcli.ToggleClientProposalHandler,
			xibcclientcli.RegisterRelayerProposalHandler,

			aggregateclient.AddCoinProposalHandler,
			aggregateclient.RegisterCoinProposalHandler,
			aggregateclient.RegisterERC20PairProposalHandler,
			aggregateclient.ToggleTokenRelayProposalHandler,
			aggregateclient.UpdateTokenPairERC20Proposal,
			aggregateclient.RegisterERC20TraceProposalHandler,
			aggregateclient.EnableTimeBasedSupplyLimitProposalHandler,
			aggregateclient.DisableTimeBasedSupplyLimitProposalHandler,
		),
		params.AppModuleBasic{},
		crisis.AppModuleBasic{},
		slashing.AppModuleBasic{},
		ibc.AppModuleBasic{},
		ica.AppModuleBasic{},
		ibctransfer.AppModuleBasic{},
		authzmodule.AppModuleBasic{},
		feegrantmodule.AppModuleBasic{},
		upgrade.AppModuleBasic{},
		evidence.AppModuleBasic{},
		vesting.AppModuleBasic{},
		feemarket.AppModuleBasic{},
		evm.AppModuleBasic{},
		aggregatemodule.AppModuleBasic{},
		xibcmodule.AppModuleBasic{},
		xibctransfer.AppModuleBasic{},
		xibcrcc.AppModuleBasic{},
		xibcmulticall.AppModuleBasic{},
		rvestingmodule.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 Teleport testing.

Functions

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 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 SignAndDeliver

func SignAndDeliver(
	t *testing.T, txCfg client.TxConfig, app *bam.BaseApp, header tmproto.Header, msgs []sdk.Msg,
	chainID string, accNums, accSeqs []uint64, expSimPass, expPass bool, priv ...cryptotypes.PrivKey,
) (sdk.GasInfo, *sdk.Result, error)

SignAndDeliver signs and delivers a transaction. No simulation occurs as the xibc testing package causes checkState and deliverState to diverge in block time.

Types

type Teleport

type Teleport 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
	IBCTransferKeeper   ibctransferkeeper.Keeper
	XIBCKeeper          *xibckeeper.Keeper // XIBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
	XIBCTransferKeeper  xibctransferkeeper.Keeper
	XIBCRCCKeeper       xibcrcckeeper.Keeper
	XIBCMultiCallKeeper xibcmulticallkeeper.Keeper
	EvidenceKeeper      evidencekeeper.Keeper
	ICAControllerKeeper icacontrollerkeeper.Keeper
	ICAHostKeeper       icahostkeeper.Keeper

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

	// make scoped keepers public for test purposes
	ScopedXIBCKeeper          capabilitykeeper.ScopedKeeper
	ScopedXIBCTransferKeeper  capabilitykeeper.ScopedKeeper
	ScopedXIBCRCCKeeper       capabilitykeeper.ScopedKeeper
	ScopedXIBCMultiCallKeeper capabilitykeeper.ScopedKeeper
	ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper
	ScopedICAHostKeeper       capabilitykeeper.ScopedKeeper

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

	// Teleport keepers
	AggregateKeeper *aggregatekeeper.Keeper
	RVestingKeeper  rvestingkeeper.Keeper
	// contains filtered or unexported fields
}

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

func NewTeleport

func NewTeleport(
	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),
) *Teleport

NewTeleport returns a reference to a new initialized Ethermint application.

func Setup

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

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

func (*Teleport) AppCodec

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

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

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

BeginBlocker updates every begin block

func (*Teleport) BlockedAddrs

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

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

func (*Teleport) EndBlocker

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

EndBlocker updates every end block

func (*Teleport) ExportAppStateAndValidators

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

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

func (*Teleport) GetBaseApp

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

GetBaseApp implements the TestingApp interface.

func (*Teleport) GetIBCKeeper

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

GetIBCKeeper implements the TestingApp interface.

func (*Teleport) GetKey

func (app *Teleport) GetKey(storeKey string) *sdk.KVStoreKey

GetKey returns the KVStoreKey for the provided store key.

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

func (*Teleport) GetMemKey

func (app *Teleport) GetMemKey(storeKey string) *sdk.MemoryStoreKey

GetMemKey returns the MemStoreKey for the provided mem key.

NOTE: This is solely used for testing purposes.

func (*Teleport) GetScopedIBCKeeper

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

GetScopedIBCKeeper implements the TestingApp interface.

func (*Teleport) GetStakingKeeper

func (app *Teleport) GetStakingKeeper() stakingkeeper.Keeper

GetStakingKeeper implements the TestingApp interface.

func (*Teleport) GetSubspace

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

func (app *Teleport) GetTKey(storeKey string) *sdk.TransientStoreKey

GetTKey returns the TransientStoreKey for the provided store key.

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

func (*Teleport) GetTxConfig

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

GetTxConfig implements the TestingApp interface.

func (*Teleport) InitChainer

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

InitChainer updates at chain initialization

func (*Teleport) InterfaceRegistry

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

InterfaceRegistry returns Teleport's InterfaceRegistry

func (*Teleport) LegacyAmino

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

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

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

LoadHeight loads state at a particular height

func (*Teleport) ModuleAccountAddrs

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

ModuleAccountAddrs returns all the app's module account addresses.

func (*Teleport) Name

func (app *Teleport) Name() string

Name returns the name of the App

func (*Teleport) RegisterAPIRoutes

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

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

func (*Teleport) RegisterTendermintService

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

func (*Teleport) RegisterTxService

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

func (*Teleport) SetEVMCode

func (app *Teleport) SetEVMCode(ctx sdk.Context, addr common.Address, code []byte)

SetEVMCode set code in evm

func (*Teleport) SimulationManager

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

SimulationManager implements the SimulationApp interface

Jump to

Keyboard shortcuts

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