simapp

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AppName specifies the global application name.
	AppName = "CertiK"

	// DefaultKeyPass for certikd node daemon.
	DefaultKeyPass = "12345678"
)

Variables

View Source
var (
	// DefaultCLIHome specifies where the node client data is stored.
	DefaultCLIHome = os.ExpandEnv("$HOME/.certikcli")

	// DefaultNodeHome specifies where the node daemon data is stored.
	DefaultNodeHome = os.ExpandEnv("$HOME/.certikd")

	// ModuleBasics is in charge of setting up basic, non-dependant module
	// elements, such as codec registration and genesis verification.
	ModuleBasics = module.NewBasicManager(
		genutil.AppModuleBasic{},
		auth.AppModuleBasic{},
		bank.AppModuleBasic{},
		staking.AppModuleBasic{},
		mint.AppModuleBasic{},
		distr.AppModuleBasic{},
		gov.NewAppModuleBasic(
			distr.ProposalHandler,
			upgrade.ProposalHandler,
			cert.ProposalHandler,
			paramsclient.ProposalHandler,
			shield.ProposalHandler,
		),
		params.AppModuleBasic{},
		crisis.AppModuleBasic{},
		slashing.AppModuleBasic{},
		supply.AppModuleBasic{},
		upgrade.AppModuleBasic{},
		cvm.NewAppModuleBasic(),
		cert.NewAppModuleBasic(),
		oracle.NewAppModuleBasic(),
		shield.NewAppModuleBasic(),
	)
)

Functions

func AddCoinsToAcc

func AddCoinsToAcc(app *SimApp, ctx sdk.Context, addr sdk.AccAddress, toAdd sdk.Coins)

AddCoins adds coins to an account and increments the total supply accordingly.

func AddTestAddrs

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

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

func MakeCodec

func MakeCodec() *codec.Codec

MakeCodec generates the necessary codecs for Amino

Types

type SimApp

type SimApp struct {
	*bam.BaseApp

	AccountKeeper  auth.AccountKeeper
	BankKeeper     bank.Keeper
	StakingKeeper  staking.Keeper
	SlashingKeeper slashing.Keeper
	MintKeeper     mint.Keeper
	DistrKeeper    distr.Keeper
	CrisisKeeper   crisis.Keeper
	SupplyKeeper   supply.Keeper
	ParamsKeeper   params.Keeper
	UpgradeKeeper  upgrade.Keeper
	GovKeeper      gov.Keeper
	CertKeeper     cert.Keeper
	CvmKeeper      cvm.Keeper
	AuthKeeper     auth.Keeper
	OracleKeeper   oracle.Keeper
	ShieldKeeper   shield.Keeper
	// contains filtered or unexported fields
}

SimApp is the simulated CertiK Chain application type.

func NewSimApp

func NewSimApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, skipUpgradeHeights map[int64]bool,
	invCheckPeriod uint, baseAppOptions ...func(*bam.BaseApp)) *SimApp

NewSimApp returns a reference to an initialized SimApp.

func Setup

func Setup(isCheckTx bool) *SimApp

func (*SimApp) BeginBlocker

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

BeginBlocker processes application updates at the beginning of each block.

func (*SimApp) BlacklistedAccAddrs

func (app *SimApp) BlacklistedAccAddrs() map[string]bool

BlacklistedAccAddrs returns all the app's module account addresses black listed for receiving tokens.

func (*SimApp) Codec

func (app *SimApp) Codec() *codec.Codec

Codec returns app.cdc.

func (*SimApp) EndBlocker

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

EndBlocker processes application updates at the end of each block.

func (*SimApp) ExportAppStateAndValidators

func (app *SimApp) ExportAppStateAndValidators(forZeroHeight bool, jailWhiteList []string) (
	appState json.RawMessage, validators []tmtypes.GenesisValidator, err error)

ExportAppStateAndValidators exports the application state for a genesis file.

func (*SimApp) GetAppModuleGenesis added in v1.3.0

func (app *SimApp) GetAppModuleGenesis(ctx sdk.Context, moduleName string) module.AppModule

func (*SimApp) GetKey added in v1.3.0

func (app *SimApp) GetKey(storeKey string) types.StoreKey

GetKey returns the corresponding store key.

func (*SimApp) InitChainer

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

InitChainer defines application update at chain initialization

func (*SimApp) LoadHeight

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

LoadHeight loads a particular height

func (*SimApp) ModuleAccountAddrs

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

ModuleAccountAddrs returns all the app's module account addresses.

func (*SimApp) SimulationManager

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

SimulationManager returns app.sm.

Jump to

Keyboard shortcuts

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