app

package
v2.2.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: Apache-2.0 Imports: 104 Imported by: 0

Documentation

Overview

Mostly copied from https://github.com/cosmos/gaia/tree/master/app

Mostly copied from https://github.com/cosmos/gaia/tree/master/app

Index

Constants

View Source
const (
	// Bech32PrefixAccAddr defines the Bech32 prefix of an account's address
	Bech32PrefixAccAddr = "regen"
	// Bech32PrefixAccPub defines the Bech32 prefix of an account's public key
	Bech32PrefixAccPub = "regenpub"
	// Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address
	Bech32PrefixValAddr = "regenvaloper"
	// Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key
	Bech32PrefixValPub = "regenvaloperpub"
	// Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address
	Bech32PrefixConsAddr = "regenvalcons"
	// Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key
	Bech32PrefixConsPub = "regenvalconspub"
)

Variables

View Source
var (
	// DefaultNodeHome default home directories for regen
	DefaultNodeHome = os.ExpandEnv("$HOME/.regen")

	// The ModuleBasicManager is in charge of setting up basic,
	// non-dependant module elements, such as codec registration
	// and genesis verification.
	ModuleBasics = module.NewBasicManager(
		append([]module.AppModuleBasic{
			auth.AppModuleBasic{},

			genutil.AppModuleBasic{},
			bank.AppModuleBasic{},
			capability.AppModuleBasic{},
			staking.AppModuleBasic{},
			mint.AppModuleBasic{},
			distr.AppModuleBasic{},
			params.AppModuleBasic{},
			crisis.AppModuleBasic{},
			slashing.AppModuleBasic{},
			ibc.AppModuleBasic{},
			upgrade.AppModuleBasic{},
			evidence.AppModuleBasic{},
			transfer.AppModuleBasic{},
			vesting.AppModuleBasic{},
			feegrantmodule.AppModuleBasic{},
			authzmodule.AppModuleBasic{},
			ecocreditmodule.Module{},
		}, setCustomModuleBasics()...)...,
	)
)

Functions

func GetMaccPerms

func GetMaccPerms() map[string][]string

GetMaccPerms returns a copy of the module account permissions

func MakeCodecs

func MakeCodecs() (codec.Codec, *codec.LegacyAmino)

MakeCodecs constructs the *std.Codec and *codec.LegacyAmino instances used by Regenapp. It is useful for tests and clients who do not want to construct the full Regenapp

func MakeEncodingConfig

func MakeEncodingConfig() params.EncodingConfig

MakeEncodingConfig creates an EncodingConfig

func RegisterSwaggerAPI

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

RegisterSwaggerAPI registers swagger route with API Server

func SimulationOperations

func SimulationOperations(app *RegenApp, cdc codec.Codec, config simulation.Config) []simulation.WeightedOperation

SimulationOperations retrieves the simulation params from the provided file path and returns all the modules weighted operations

Types

type BlockTimerExecutor

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

BlockTimerExecutor is responsible for checking the permission to execute patches

func NewBlockTimerExecutor

func NewBlockTimerExecutor() *BlockTimerExecutor

func (*BlockTimerExecutor) Start

func (bte *BlockTimerExecutor) Start(ctx sdk.Context)

type Execute

type Execute = func(ctx sdk.Context) error

Execute is responsible for checking the permission to execute patches

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 RegenApp

type RegenApp 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
	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
	AuthzKeeper      authzkeeper.Keeper

	// make scoped keepers public for test purposes
	ScopedIBCKeeper      capabilitykeeper.ScopedKeeper
	ScopedTransferKeeper capabilitykeeper.ScopedKeeper
	ScopedIBCMockKeeper  capabilitykeeper.ScopedKeeper
	// contains filtered or unexported fields
}

Extended ABCI application

func NewRegenApp

func NewRegenApp(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)) *RegenApp

NewRegenApp returns a reference to an initialized RegenApp.

func (*RegenApp) AddPatch

func (app *RegenApp) AddPatch(height int64, patch Execute)

func (*RegenApp) AppCodec

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

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

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

BeginBlocker application updates every begin block

func (*RegenApp) EndBlocker

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

EndBlocker application updates every end block

func (*RegenApp) ExportAppStateAndValidators

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

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

func (*RegenApp) GetKey

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

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

GetMemKey returns the MemStoreKey for the provided mem key.

NOTE: This is solely used for testing purposes.

func (*RegenApp) GetSubspace

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

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

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

InitChainer application update at chain initialization

func (*RegenApp) InterfaceRegistry

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

InterfaceRegistry returns RegenApp's InterfaceRegistry

func (*RegenApp) LegacyAmino

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

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

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

LoadHeight loads a particular height

func (*RegenApp) ModuleAccountAddrs

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

ModuleAccountAddrs returns all the app's module account addresses.

func (*RegenApp) Name

func (app *RegenApp) Name() string

Name returns the name of the App

func (*RegenApp) RegisterAPIRoutes

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

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

func (*RegenApp) RegisterTendermintService

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

RegisterTendermintService implements the Application.RegisterTendermintService method.

func (*RegenApp) RegisterTxService

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

RegisterTxService implements the Application.RegisterTxService method.

func (*RegenApp) SimulationManager

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

SimulationManager implements the SimulationApp interface

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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