app

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 195 Imported by: 0

README

Dependencies map

Keepers dependencies

commitment -> staking tokenomics -> commitment estaking -> staking, commitment, distr, tokenomics slashing -> estaking amm -> commitment stablestake -> commitment distr -> commitment, estaking masterchef -> tokenomics leveragelp -> stablestake, commitment

Hooks dependencies

staking -> slashing, distr, estaking amm -> perpetual, leveragelp, masterchef epochs -> oracle, commitment, perpetual perpetual -> accountedpool commitment -> estaking stablestake -> masterchef

The deepest stack actions

Eden uncommit

commitment hooks estaking with EdenUncommitted estaking calls commitment with BurnEdenBoost commitment hooks BeforeEdenBCommitChange, BeforeEdenCommitChange, CommitmentChanged estaking hooks staking with BeforeDelegationCreated, BeforeDelegationSharesModified, BeforeDelegationRemoved, AfterDelegationModified staking hooks estaking with AfterDelegationModified staking hooks distr with BeforeDelegationCreated, BeforeDelegationSharesModified, BeforeDelegationRemoved, AfterDelegationModified distr executes rewards claim on BeforeDelegationSharesModified

Elys unstake

staking hooks AfterDelegationModified estaking calls commitment with BurnEdenBoost commitment hooks BeforeEdenBCommitChange, BeforeEdenCommitChange, CommitmentChanged estaking hooks staking with BeforeDelegationCreated, BeforeDelegationSharesModified, BeforeDelegationRemoved, AfterDelegationModified staking hooks estaking with AfterDelegationModified staking hooks distr with BeforeDelegationCreated, BeforeDelegationSharesModified, BeforeDelegationRemoved, AfterDelegationModified distr executes rewards claim on BeforeDelegationSharesModified

Documentation

Index

Constants

View Source
const (
	AccountAddressPrefix = "elys"
	Name                 = "elys"

	// If EnabledSpecificProposals is "", and this is "true", then enable all x/wasm proposals.
	// If EnabledSpecificProposals is "", and this is not "true", then disable all x/wasm proposals.
	ProposalsEnabled = "false"
	// If set to non-empty string it must be comma-separated list of values that are all a subset
	// of "EnableAllProposals" (takes precedence over ProposalsEnabled)
	// https://github.com/CosmWasm/wasmd/blob/02a54d33ff2c064f3539ae12d75d027d9c665f05/x/wasm/internal/types/proposal.go#L28-L34
	EnableSpecificProposals = ""
)
View Source
const (
	// make sure to update these when you upgrade the version
	NextVersion = "v0.43.1"

	LocalNetVersion = "v999.999.999"
)

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{},
		authzmodule.AppModuleBasic{},
		genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator),
		bank.AppModuleBasic{},
		capability.AppModuleBasic{},
		staking.AppModuleBasic{},
		distr.AppModuleBasic{},
		gov.NewAppModuleBasic(getGovProposalHandlers()),
		params.AppModuleBasic{},
		crisis.AppModuleBasic{},
		slashing.AppModuleBasic{},
		feegrantmodule.AppModuleBasic{},
		groupmodule.AppModuleBasic{},
		ibc.AppModuleBasic{},
		ibctm.AppModuleBasic{},
		solomachine.AppModuleBasic{},
		upgrade.AppModuleBasic{},
		evidence.AppModuleBasic{},
		transfer.AppModuleBasic{},
		ica.AppModuleBasic{},
		ibcfee.AppModuleBasic{},
		vesting.AppModuleBasic{},
		consensus.AppModuleBasic{},
		wasmmodule.AppModuleBasic{},
		epochsmodule.AppModuleBasic{},
		assetprofilemodule.AppModuleBasic{},
		oraclemodule.AppModuleBasic{},
		commitmentmodule.AppModuleBasic{},
		tokenomicsmodule.AppModuleBasic{},
		incentivemodule.AppModuleBasic{},
		burnermodule.AppModuleBasic{},
		ammmodule.AppModuleBasic{},
		parametermodule.AppModuleBasic{},
		perpetualmodule.AppModuleBasic{},
		accountedpoolmodule.AppModuleBasic{},
		transferhook.AppModuleBasic{},
		clockmodule.AppModuleBasic{},
		stablestake.AppModuleBasic{},
		leveragelpmodule.AppModuleBasic{},
		masterchefmodule.AppModuleBasic{},
		estakingmodule.AppModuleBasic{},
		tiermodule.AppModuleBasic{},
		tradeshieldmodule.AppModuleBasic{},
	)
)

Functions

func AddTestAddrs

func AddTestAddrs(app *ElysApp, ctx sdk.Context, accNum int, accAmt math.Int) []sdk.AccAddress

AddTestAddrs constructs and returns accNum amount of accounts with an initial balance of accAmt in random order

func AddTestCommitment

func AddTestCommitment(app *ElysApp, ctx sdk.Context, address sdk.AccAddress, committed sdk.Coins)

Add testing commitments

func CreateRandomAccounts added in v0.45.0

func CreateRandomAccounts(accNum int) []sdk.AccAddress

CreateRandomAccounts is a strategy used by addTestAddrs() in order to generated addresses in random order.

func GetEnabledProposals added in v0.10.0

func GetEnabledProposals() []wasmmodule.ProposalType

GetEnabledProposals parses the ProposalsEnabled / EnableSpecificProposals values to produce a list of enabled proposals to pass into wasmd app.

func GetMaccPerms

func GetMaccPerms() map[string][]string

GetMaccPerms returns a copy of the module account permissions

func MakeEncodingConfig

func MakeEncodingConfig() params.EncodingConfig

MakeEncodingConfig creates an EncodingConfig for testing

func SetupHandlers

func SetupHandlers(app *ElysApp)

Types

type ElysApp

type ElysApp struct {
	*baseapp.BaseApp

	// keepers
	AccountKeeper         authkeeper.AccountKeeper
	AuthzKeeper           authzkeeper.Keeper
	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
	IBCKeeper             *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
	IBCFeeKeeper          ibcfeekeeper.Keeper
	IBCHooksKeeper        *ibchookskeeper.Keeper
	EvidenceKeeper        evidencekeeper.Keeper
	TransferKeeper        ibctransferkeeper.Keeper
	ICAHostKeeper         icahostkeeper.Keeper
	FeeGrantKeeper        feegrantkeeper.Keeper
	GroupKeeper           groupkeeper.Keeper
	ConsensusParamsKeeper consensusparamkeeper.Keeper
	WasmKeeper            wasmmodulekeeper.Keeper

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

	EpochsKeeper       epochsmodulekeeper.Keeper
	AssetprofileKeeper assetprofilemodulekeeper.Keeper
	ScopedOracleKeeper capabilitykeeper.ScopedKeeper
	OracleKeeper       oraclekeeper.Keeper
	CommitmentKeeper   commitmentmodulekeeper.Keeper
	TokenomicsKeeper   tokenomicsmodulekeeper.Keeper
	IncentiveKeeper    incentivemodulekeeper.Keeper
	BurnerKeeper       burnermodulekeeper.Keeper
	AmmKeeper          ammmodulekeeper.Keeper
	ParameterKeeper    parametermodulekeeper.Keeper
	PerpetualKeeper    perpetualmodulekeeper.Keeper
	TransferhookKeeper transferhookkeeper.Keeper
	ContractKeeper     *wasmmodulekeeper.PermissionedKeeper
	ClockKeeper        clockmodulekeeper.Keeper

	AccountedPoolKeeper accountedpoolmodulekeeper.Keeper

	StablestakeKeeper stablestakekeeper.Keeper

	LeveragelpKeeper leveragelpmodulekeeper.Keeper

	MasterchefKeeper masterchefmodulekeeper.Keeper

	EstakingKeeper estakingmodulekeeper.Keeper

	TierKeeper tiermodulekeeper.Keeper

	TradeshieldKeeper tradeshieldmodulekeeper.Keeper

	// Middleware wrapper
	Ics20WasmHooks   *ibchooks.WasmHooks
	HooksICS4Wrapper ibchooks.ICS4Middleware
	// contains filtered or unexported fields
}

App extends an ABCI application, but with most of its parameters exported. They are exported for convenience in creating helper functions, as object capabilities aren't needed for testing.

func InitElysTestApp

func InitElysTestApp(initChain bool) *ElysApp

Initializes a new ElysApp without IBC functionality

func InitElysTestAppWithGenAccount

func InitElysTestAppWithGenAccount() (*ElysApp, sdk.AccAddress, sdk.ValAddress)

Initializes a new ElysApp without IBC functionality and returns genesis account (delegator)

func InitiateNewElysApp

func InitiateNewElysApp(opts ...wasm.Option) *ElysApp

Initiate a new ElysApp object - Common function used by the following 2 functions.

func NewElysApp

func NewElysApp(
	logger log.Logger,
	db dbm.DB,
	traceStore io.Writer,
	loadLatest bool,
	enabledProposals []wasmmodule.ProposalType,
	appOpts servertypes.AppOptions,
	wasmOpts []wasmmodule.Option,
	baseAppOptions ...func(*baseapp.BaseApp),
) *ElysApp

New returns a reference to an initialized blockchain app

func (*ElysApp) AppCodec

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

AppCodec returns an 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 (*ElysApp) BeginBlocker

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

BeginBlocker application updates every begin block

func (*ElysApp) BlockedModuleAccountAddrs

func (app *ElysApp) BlockedModuleAccountAddrs() map[string]bool

BlockedModuleAccountAddrs returns all the app's blocked module account addresses.

func (*ElysApp) Configurator added in v0.10.0

func (app *ElysApp) Configurator() module.Configurator

Configurator get app configurator

func (*ElysApp) EndBlocker

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

EndBlocker application updates every end block

func (*ElysApp) ExportAppStateAndValidators

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

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

func (*ElysApp) GetKey

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

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

GetMemKey returns the MemStoreKey for the provided mem key.

NOTE: This is solely used for testing purposes.

func (*ElysApp) GetSubspace

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

func (app *ElysApp) 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 (*ElysApp) InitChainer

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

InitChainer application update at chain initialization

func (*ElysApp) InterfaceRegistry

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

InterfaceRegistry returns an InterfaceRegistry

func (*ElysApp) LegacyAmino

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

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

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

LoadHeight loads a particular height

func (*ElysApp) ModuleAccountAddrs

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

ModuleAccountAddrs returns all the app's module account addresses.

func (*ElysApp) ModuleManager

func (app *ElysApp) ModuleManager() *module.Manager

ModuleManager returns the app ModuleManager

func (*ElysApp) Name

func (app *ElysApp) Name() string

Name returns the name of the App

func (*ElysApp) RegisterAPIRoutes

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

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

func (*ElysApp) RegisterNodeService

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

RegisterNodeService implements the Application.RegisterNodeService method.

func (*ElysApp) RegisterTendermintService

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

RegisterTendermintService implements the Application.RegisterTendermintService method.

func (*ElysApp) RegisterTxService

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

RegisterTxService implements the Application.RegisterTxService method.

func (*ElysApp) SimulationManager

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

SimulationManager returns the app SimulationManager

func (*ElysApp) TxConfig added in v0.10.0

func (app *ElysApp) TxConfig() client.TxConfig

TxConfig returns App's TxConfig.

type GenerateAccountStrategy

type GenerateAccountStrategy func(int) []sdk.AccAddress

type GenesisState

type GenesisState map[string]json.RawMessage

The genesis state of the blockchain is represented here as a map of raw json messages key'd by a identifier string. The identifier is used to determine which module genesis information belongs to so it may be appropriately routed during init chain. Within this application default genesis information is retrieved from the ModuleBasicManager which populates json from each BasicModule object provided to it during init.

func NewDefaultGenesisState

func NewDefaultGenesisState(cdc codec.JSONCodec) GenesisState

NewDefaultGenesisState generates the default state for the application.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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