app

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 182 Imported by: 0

Documentation

Index

Constants

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

	// Dex revenue consolidating wallet
	DexRevenueCollectorName = "dexRevenueCollector"

	// 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 Bech32Prefix = "elys"

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{},
		mint.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{},
	)
)

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, rewardsUnclaimed sdk.Coins)

Add testing commitments

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 NewAnteHandler

func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)

NewAnteHandler returns an AnteHandler that checks and increments sequence numbers, checks signatures & account numbers, and deducts fees from the first signer.

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
	MintKeeper            mintkeeper.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

	// Middleware wrapper
	Ics20WasmHooks   *ibc_hooks.WasmHooks
	HooksICS4Wrapper ibc_hooks.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.

type HandlerOptions

type HandlerOptions struct {
	ante.HandlerOptions
	Cdc               codec.BinaryCodec
	StakingKeeper     *stakingkeeper.Keeper
	BankKeeper        bankkeeper.Keeper
	IBCKeeper         *ibckeeper.Keeper
	WasmConfig        *wasmtypes.WasmConfig
	ParameterKeeper   parameterkeeper.Keeper
	TXCounterStoreKey storetypes.StoreKey
}

HandlerOptions extends the SDK's AnteHandler options by requiring the IBC channel keeper.

type MinCommissionDecorator

type MinCommissionDecorator struct {
	// contains filtered or unexported fields
}

func (MinCommissionDecorator) AnteHandle

func (min MinCommissionDecorator) AnteHandle(
	ctx sdk.Context, tx sdk.Tx,
	simulate bool, next sdk.AnteHandler,
) (newCtx sdk.Context, err error)

func (MinCommissionDecorator) CalculateDelegateProjectedVotingPower

func (min MinCommissionDecorator) CalculateDelegateProjectedVotingPower(ctx sdk.Context, validator stakingtypes.ValidatorI, delegateAmount sdk.Dec) sdk.Dec

Returns the projected voting power as a percentage (not a fraction)

func (MinCommissionDecorator) CalculateRedelegateProjectedVotingPower

func (min MinCommissionDecorator) CalculateRedelegateProjectedVotingPower(ctx sdk.Context, validator stakingtypes.ValidatorI, delegateAmount sdk.Dec) sdk.Dec

Returns the projected voting power as a percentage (not a fraction)

func (MinCommissionDecorator) CalculateValidatorProjectedVotingPower

func (min MinCommissionDecorator) CalculateValidatorProjectedVotingPower(ctx sdk.Context, delegateAmount sdk.Dec) sdk.Dec

Returns the projected voting power as a percentage (not a fraction)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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