app

package
v1.5.0-develop Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: LGPL-3.0 Imports: 150 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 TreasurenetApp testing.

View Source
var DefaultConsensusParamsNew = &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

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

DefaultTestingAppInit defines the IBC application used for testing

Functions

func GetMaccPerms

func GetMaccPerms() map[string][]string

GetMaccPerms returns a copy of the module account permissions

func Int64ToBytes

func Int64ToBytes(i int64) []byte

int64 return []byte

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 SetupTestingApp

func SetupTestingApp() (ibctesting.TestingApp, map[string]json.RawMessage)

SetupTestingApp initializes the IBC-go testing application

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 EventLog

type EventLog struct {
	Code int             `json:"code"`
	Msg  string          `json:"msg"`
	Data [][]interface{} `json:"data"` // `json:"-"`No serialization
}
var Even EventLog

type EventLogNew

type EventLogNew struct {
	Code int             `json:"code"`
	Msg  string          `json:"msg"`
	Data [][]interface{} `json:"data"` // `json:"-"`No serialization
}
type EventLog struct {
	Code int           `json:"code"`
	Msg  string        `json:"msg"`
	Data []interface{} `json:"data"` // `json:"-"`No serialization
}
var EvenNew EventLogNew

type TreasurenetApp

type TreasurenetApp struct {
	*baseapp.BaseApp

	// keepers
	AccountKeeper authkeeper.AccountKeeper
	// BankKeeper    bankkeeper.Keeper
	BankKeeper       bankkeeper.BaseKeeper
	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
	GravityKeeper    keeper.Keeper
	Bech32IbcKeeper  bech32ibckeeper.Keeper
	// make scoped keepers public for test purposes
	ScopedIBCKeeper      capabilitykeeper.ScopedKeeper
	ScopedTransferKeeper capabilitykeeper.ScopedKeeper

	// Treasurenet keepers
	EvmKeeper       *evmkeeper.Keeper
	FeeMarketKeeper feemarketkeeper.Keeper
	InflationKeeper inflationkeeper.Keeper
	// ClaimsKeeper     *claimskeeper.Keeper
	Erc20Keeper      erc20keeper.Keeper
	IncentivesKeeper incentiveskeeper.Keeper
	EpochsKeeper     epochskeeper.Keeper
	VestingKeeper    vestingkeeper.Keeper
	// contains filtered or unexported fields
}

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

func NewTreasurenetApp

func NewTreasurenetApp(
	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),
) *TreasurenetApp

NewTreasurenetApp returns a reference to a new initialized Treasurenet application.

func Setup

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

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

func SetupNew

func SetupNew(
	isCheckTx bool,
	feemarketGenesis *feemarkettypes.GenesisState,
) *TreasurenetApp

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

func (*TreasurenetApp) AppCodec

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

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

BeginBlocker updates every begin block

func (*TreasurenetApp) BlockedAddrs

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

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

func (*TreasurenetApp) EndBlocker

func (*TreasurenetApp) ExportAppStateAndValidators

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

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

func (*TreasurenetApp) GetBaseApp

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

GetBaseApp implements the TestingApp interface.

func (*TreasurenetApp) GetIBCKeeper

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

GetIBCKeeper implements the TestingApp interface.

func (*TreasurenetApp) GetKey

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

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

GetMemKey returns the MemStoreKey for the provided mem key.

NOTE: This is solely used for testing purposes.

func (*TreasurenetApp) GetScopedIBCKeeper

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

GetScopedIBCKeeper implements the TestingApp interface.

func (*TreasurenetApp) GetStakingKeeper

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

GetStakingKeeper implements the TestingApp interface.

func (*TreasurenetApp) GetSubspace

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

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

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

GetTxConfig implements the TestingApp interface.

func (*TreasurenetApp) InitChainer

InitChainer updates at chain initialization

func (*TreasurenetApp) InterfaceRegistry

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

InterfaceRegistry returns TreasurenetApp's InterfaceRegistry

func (*TreasurenetApp) LegacyAmino

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

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

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

LoadHeight loads state at a particular height

func (*TreasurenetApp) ModuleAccountAddrs

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

ModuleAccountAddrs returns all the app's module account addresses.

func (*TreasurenetApp) Name

func (app *TreasurenetApp) Name() string

Name returns the name of the App

func (*TreasurenetApp) RegisterAPIRoutes

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

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

func (*TreasurenetApp) RegisterTendermintService

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

func (*TreasurenetApp) RegisterTxService

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

func (*TreasurenetApp) SimulationManager

func (app *TreasurenetApp) 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).
Package params defines the simulation parameters in the simapp.
Package params defines the simulation parameters in the simapp.

Jump to

Keyboard shortcuts

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