app

package
v2.2.5 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2023 License: Apache-2.0 Imports: 128 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// Name defines the application binary name
	Name = "astrad"
	// MainnetChainID defines the Astra EIP155 chain ID for mainnet
	MainnetChainID = "astra_11110"
	// TestnetChainID defines the Astra EIP155 chain ID for testnet
	TestnetChainID = "astra_11115"
)

Variables

View Source
var DefaultConsensusParams = &abci.ConsensusParams{
	Block: &abci.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 Astra testing.

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

DefaultTestingAppInit defines the IBC application used for testing

Functions

func BeginBlockForks added in v2.2.4

func BeginBlockForks(ctx sdk.Context, app *Astra)

BeginBlockForks executes any necessary fork logic based upon the current block height.

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

type Astra 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
	EvidenceKeeper   evidencekeeper.Keeper
	TransferKeeper   ibctransferkeeper.Keeper

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

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

	// Astra keepers
	MintKeeper    mintkeeper.Keeper
	VestingKeeper vestingkeeper.Keeper
	FeeBurnKeeper feeBurnKeeper.Keeper
	// contains filtered or unexported fields
}

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

func NewAstraApp

func NewAstraApp(
	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),
) *Astra

NewAstraApp returns a reference to a new initialized Ethermint application.

func Setup

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

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

func (*Astra) AppCodec

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

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

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

BeginBlocker updates every begin block

func (*Astra) BlockedAddrs

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

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

func (*Astra) DeliverTx

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

DeliverTx We are intentionally decomposing the DeliverTx method so as to calculate the transactions per second.

func (*Astra) EndBlocker

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

EndBlocker updates every end block

func (*Astra) ExportAppStateAndValidators

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

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

func (*Astra) GetBaseApp

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

GetBaseApp implements the TestingApp interface.

func (*Astra) GetIBCKeeper

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

GetIBCKeeper implements the TestingApp interface.

func (*Astra) GetKey

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

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

GetMemKey returns the MemStoreKey for the provided mem key.

NOTE: This is solely used for testing purposes.

func (*Astra) GetScopedIBCKeeper

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

GetScopedIBCKeeper implements the TestingApp interface.

func (*Astra) GetStakingKeeper

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

GetStakingKeeper implements the TestingApp interface.

func (*Astra) GetSubspace

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

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

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

GetTxConfig implements the TestingApp interface.

func (*Astra) InitChainer

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

InitChainer updates at chain initialization

func (*Astra) InterfaceRegistry

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

InterfaceRegistry returns Astra's InterfaceRegistry

func (*Astra) LegacyAmino

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

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

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

LoadHeight loads state at a particular height

func (*Astra) ModuleAccountAddrs

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

ModuleAccountAddrs returns all the app's module account addresses.

func (*Astra) Name

func (app *Astra) Name() string

Name returns the name of the App

func (*Astra) RegisterAPIRoutes

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

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

func (*Astra) RegisterTendermintService

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

func (*Astra) RegisterTxService

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

func (*Astra) SimulationManager

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

SimulationManager implements the SimulationApp interface

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).
upgrades
v1

Jump to

Keyboard shortcuts

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