app

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: LGPL-3.0 Imports: 113 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "marad"

Variables

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 MaraApp 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 RandomAccounts

func RandomAccounts(r *rand.Rand, n int) []simtypes.Account

RandomAccounts creates random accounts with an ethsecp256k1 private key TODO: replace secp256k1.GenPrivKeyFromSecret() with similar function in go-ethereum

func RandomGenesisAccounts

func RandomGenesisAccounts(simState *module.SimulationState) authtypes.GenesisAccounts

RandomGenesisAccounts is used by the auth module to create random genesis accounts in simulation when a genesis.json is not specified. In contrast, the default auth module's RandomGenesisAccounts implementation creates only base accounts and vestings accounts.

func RegisterSwaggerAPI

func RegisterSwaggerAPI(_ client.Context, rtr *mux.Router)

RegisterSwaggerAPI registers swagger route with API Server

func StateFn

func StateFn(cdc codec.JSONCodec, simManager *module.SimulationManager) simtypes.AppStateFn

StateFn returns the initial application state using a genesis or the simulation parameters. It is a wrapper of simapp.AppStateFn to replace evm param EvmDenom with staking param BondDenom.

Types

type MaraApp added in v0.2.0

type MaraApp 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
	// contains filtered or unexported fields
}

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

func NewMaraApp added in v0.2.0

func NewMaraApp(
	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),
) *MaraApp

NewMaraApp returns a reference to a new initialized Mara application.

func Setup

func Setup(isCheckTx bool, patchGenesis func(*MaraApp, simapp.GenesisState) simapp.GenesisState) *MaraApp

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

func (*MaraApp) AppCodec added in v0.2.0

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

AppCodec returns MaraApp'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 (*MaraApp) BeginBlocker added in v0.2.0

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

BeginBlocker updates every begin block

func (*MaraApp) BlockedAddrs added in v0.2.0

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

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

func (*MaraApp) EndBlocker added in v0.2.0

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

EndBlocker updates every end block

func (*MaraApp) ExportAppStateAndValidators added in v0.2.0

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

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

func (*MaraApp) GetKey added in v0.2.0

func (app *MaraApp) 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 (*MaraApp) GetMemKey added in v0.2.0

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

GetMemKey returns the MemStoreKey for the provided mem key.

NOTE: This is solely used for testing purposes.

func (*MaraApp) GetSubspace added in v0.2.0

func (app *MaraApp) 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 (*MaraApp) GetTKey added in v0.2.0

func (app *MaraApp) 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 (*MaraApp) InitChainer added in v0.2.0

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

InitChainer updates at chain initialization

func (*MaraApp) InterfaceRegistry added in v0.2.0

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

InterfaceRegistry returns MaraApp's InterfaceRegistry

func (*MaraApp) LegacyAmino added in v0.2.0

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

LegacyAmino returns MaraApp'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 (*MaraApp) LoadHeight added in v0.2.0

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

LoadHeight loads state at a particular height

func (*MaraApp) ModuleAccountAddrs added in v0.2.0

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

ModuleAccountAddrs returns all the app's module account addresses.

func (*MaraApp) Name added in v0.2.0

func (app *MaraApp) Name() string

Name returns the name of the App

func (*MaraApp) RegisterAPIRoutes added in v0.2.0

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

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

func (*MaraApp) RegisterTendermintService added in v0.2.0

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

func (*MaraApp) RegisterTxService added in v0.2.0

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

func (*MaraApp) SimulationManager added in v0.2.0

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

Jump to

Keyboard shortcuts

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