app

package
v0.8.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: Apache-2.0 Imports: 98 Imported by: 1

Documentation

Index

Constants

View Source
const (
	AccountAddressPrefix = "bitsong"
)
View Source
const Name = "bitsongd"

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{},
		genutil.AppModuleBasic{},
		bank.AppModuleBasic{},
		capability.AppModuleBasic{},
		staking.AppModuleBasic{},
		mint.AppModuleBasic{},
		distr.AppModuleBasic{},
		gov.NewAppModuleBasic(getGovProposalHandlers()...),
		params.AppModuleBasic{},
		crisis.AppModuleBasic{},
		slashing.AppModuleBasic{},
		ibc.AppModuleBasic{},
		upgrade.AppModuleBasic{},
		evidence.AppModuleBasic{},
		transfer.AppModuleBasic{},
		vesting.AppModuleBasic{},
	)
)
View Source
var (
	AccountPubKeyPrefix    = AccountAddressPrefix + "pub"
	ValidatorAddressPrefix = AccountAddressPrefix + "valoper"
	ValidatorPubKeyPrefix  = AccountAddressPrefix + "valoperpub"
	ConsNodeAddressPrefix  = AccountAddressPrefix + "valcons"
	ConsNodePubKeyPrefix   = AccountAddressPrefix + "valconspub"
)

Functions

func AppStateFn added in v0.8.0

func AppStateFn(cdc codec.JSONMarshaler, simManager *module.SimulationManager) simtypes.AppStateFn

AppStateFn returns the initial application state using a genesis or the simulation parameters. It panics if the user provides files for both of them. If a file is not given for the genesis or the sim params, it creates a randomized one.

func AppStateFromGenesisFileFn added in v0.8.0

func AppStateFromGenesisFileFn(r io.Reader, cdc codec.JSONMarshaler, genesisFile string) (tmtypes.GenesisDoc, []simtypes.Account)

AppStateFromGenesisFileFn util function to generate the genesis AppState from a genesis.json file.

func AppStateRandomizedFn added in v0.8.0

func AppStateRandomizedFn(
	simManager *module.SimulationManager, r *rand.Rand, cdc codec.JSONMarshaler,
	accs []simtypes.Account, genesisTimestamp time.Time, appParams simtypes.AppParams,
) (json.RawMessage, []simtypes.Account)

AppStateRandomizedFn creates calls each module's GenesisState generator function and creates the simulation params

func GetMaccPerms added in v0.4.0

func GetMaccPerms() map[string][]string

GetMaccPerms returns a copy of the module account permissions

func MakeEncodingConfig added in v0.8.0

func MakeEncodingConfig() params.EncodingConfig

MakeEncodingConfig creates an EncodingConfig for testing

func NewConfig added in v0.8.0

func NewConfig() network.Config

func QueryBalanceExec added in v0.8.0

func QueryBalanceExec(clientCtx client.Context, address string, denom string, extraArgs ...string) (testutil.BufferWriter, error)

func SetConfig added in v0.8.0

func SetConfig()

func SimAppConstructor added in v0.8.0

func SimAppConstructor(val network.Validator) servertypes.Application

Types

type Bitsong added in v0.8.0

type Bitsong 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

	// make scoped keepers public for test purposes
	ScopedIBCKeeper      capabilitykeeper.ScopedKeeper
	ScopedTransferKeeper capabilitykeeper.ScopedKeeper
	// 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 added in v0.8.0

func New(
	logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, skipUpgradeHeights map[int64]bool,
	homePath string, invCheckPeriod uint, encodingConfig appparams.EncodingConfig,
	appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp),
) *Bitsong

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

func Setup added in v0.8.0

func Setup(isCheckTx bool) *Bitsong

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

func (*Bitsong) AppCodec added in v0.8.0

func (app *Bitsong) AppCodec() codec.Marshaler

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 (*Bitsong) BeginBlocker added in v0.8.0

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

BeginBlocker application updates every begin block

func (*Bitsong) EndBlocker added in v0.8.0

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

EndBlocker application updates every end block

func (*Bitsong) ExportAppStateAndValidators added in v0.8.0

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

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

func (*Bitsong) GetKey added in v0.8.0

func (app *Bitsong) 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 (*Bitsong) GetMemKey added in v0.8.0

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

GetMemKey returns the MemStoreKey for the provided mem key.

NOTE: This is solely used for testing purposes.

func (*Bitsong) GetSubspace added in v0.8.0

func (app *Bitsong) 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 (*Bitsong) GetTKey added in v0.8.0

func (app *Bitsong) 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 (*Bitsong) InitChainer added in v0.8.0

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

InitChainer application update at chain initialization

func (*Bitsong) InterfaceRegistry added in v0.8.0

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

InterfaceRegistry returns Gaia's InterfaceRegistry

func (*Bitsong) LegacyAmino added in v0.8.0

func (app *Bitsong) 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 (*Bitsong) LoadHeight added in v0.8.0

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

LoadHeight loads a particular height

func (*Bitsong) ModuleAccountAddrs added in v0.8.0

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

ModuleAccountAddrs returns all the app's module account addresses.

func (*Bitsong) Name added in v0.8.0

func (app *Bitsong) Name() string

Name returns the name of the App

func (*Bitsong) RegisterAPIRoutes added in v0.8.0

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

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

func (*Bitsong) RegisterTendermintService added in v0.8.0

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

RegisterTendermintService implements the Application.RegisterTendermintService method.

func (*Bitsong) RegisterTxService added in v0.8.0

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

RegisterTxService implements the Application.RegisterTxService method.

func (*Bitsong) SimulationManager added in v0.8.0

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

SimulationManager implements the SimulationApp interface

type CosmosApp added in v0.8.0

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

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

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

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

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

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

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

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

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

type GenesisState added in v0.5.0

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 added in v0.5.0

func NewDefaultGenesisState(cdc codec.JSONMarshaler) 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