app

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2022 License: Apache-2.0 Imports: 111 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Bech32PrefixAccAddr defines the Bech32 prefix of an account's address
	Bech32PrefixAccAddr = "gx"
	// Bech32PrefixAccPub defines the Bech32 prefix of an account's public key
	Bech32PrefixAccPub = "gxpub"
	// Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address
	Bech32PrefixValAddr = "gxvaloper"
	// Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key
	Bech32PrefixValPub = "gxvaloperpub"
	// Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address
	Bech32PrefixConsAddr = "gxvalcons"
	// Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key
	Bech32PrefixConsPub = "gxvalconspub"
)
View Source
const Name = "plugchain"

Variables

Functions

func DefaultCoinDenomRegex added in v0.6.0

func DefaultCoinDenomRegex() string

DefaultCoinDenomRegex returns the default regex string

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 RegisterDenoms added in v1.0.0

func RegisterDenoms()

RegisterDenoms registers the base and display denominations to the SDK.

func SetBech32Prefixes added in v1.0.0

func SetBech32Prefixes(config *sdk.Config)

SetBech32Prefixes sets the global prefixes to be used when serializing addresses and public keys to Bech32 strings.

func SetBip44CoinType added in v1.0.0

func SetBip44CoinType(config *sdk.Config)

SetBip44CoinType sets the global coin type to be used in hierarchical deterministic wallets.

Types

type App

type App 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
	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
	FeeGrantKeeper   feegrantkeeper.Keeper

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

	// onp keeper
	TokenKeeper tokenkeeper.Keeper
	// NftKeeper       nftkeeper.Keeper
	LiquidityKeeper liquiditykeeper.Keeper

	//ethermint keepers
	EvmKeeper       *evmkeeper.Keeper
	FeeMarketKeeper feemarketkeeper.Keeper
	// 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 New

func New(
	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),
) *App

New returns a reference to an initialized Gaia. NewSimApp returns a reference to an initialized SimApp.

func (*App) AppCodec

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

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

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

BeginBlocker application updates every begin block

func (*App) BlockAddrs added in v1.0.0

func (app *App) BlockAddrs() map[string]bool

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

func (*App) EndBlocker

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

EndBlocker application updates every end block

func (*App) ExportAppStateAndValidators

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

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

func (*App) GetKey

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

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

GetMemKey returns the MemStoreKey for the provided mem key.

NOTE: This is solely used for testing purposes.

func (*App) GetSubspace

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

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

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

InitChainer application update at chain initialization

func (*App) InterfaceRegistry

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

InterfaceRegistry returns Gaia's InterfaceRegistry

func (*App) LegacyAmino

func (app *App) 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 (*App) LoadHeight

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

LoadHeight loads a particular height

func (*App) ModuleAccountAddrs

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

ModuleAccountAddrs returns all the app's module account addresses.

func (*App) Name

func (app *App) Name() string

Name returns the name of the App

func (*App) RegisterAPIRoutes

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

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

func (*App) RegisterTendermintService

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

RegisterTendermintService implements the Application.RegisterTendermintService method.

func (*App) RegisterTxService

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

RegisterTxService implements the Application.RegisterTxService method.

func (*App) RegisterUpgradePlan added in v0.6.0

func (app *App) RegisterUpgradePlan(
	planName string,
	upgrades *store.StoreUpgrades,
	upgradeHandler upgradetypes.UpgradeHandler,
)

RegisterUpgradePlan implements the upgrade execution logic of the upgrade module

type PlugApp

type PlugApp interface {
	// The assigned name of the app.
	Name() string

	// The application types codec.
	// NOTE: This shoult be sealed before being returned.
	LegacyAmino() *codec.LegacyAmino

	// Application updates every begin block.
	BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock

	// Application updates every end block.
	EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock

	// Application update at chain (i.e app) initialization.
	InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain

	// Loads the app at a given height.
	LoadHeight(height int64) error

	// Exports the state of the application for a genesis file.
	ExportAppStateAndValidators(
		forZeroHeight bool, jailAllowedAddrs []string,
	) (types.ExportedApp, error)

	// All the registered module account addreses.
	ModuleAccountAddrs() map[string]bool
}

App implements the common methods for a Cosmos SDK-based application specific blockchain.

Jump to

Keyboard shortcuts

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