simapp

package
v0.0.0-...-4ed9d07 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2020 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Overview

nolint

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultCLIHome represents the default home directory for the application CLI
	DefaultCLIHome = os.ExpandEnv("$HOME/.bondscli")

	// DefaultNodeHome sets the folder where the application data and configuration will be stored
	DefaultNodeHome = os.ExpandEnv("$HOME/.bondsd")

	// ModuleBasics is in charge of setting up basic module elements
	ModuleBasics = module.NewBasicManager(
		auth.AppModuleBasic{},
		genutil.AppModuleBasic{},
		bank.AppModuleBasic{},
		staking.AppModuleBasic{},
		mint.AppModuleBasic{},
		distr.AppModuleBasic{},
		gov.NewAppModuleBasic(
			paramsclient.ProposalHandler, distr.ProposalHandler, upgradeclient.ProposalHandler,
		),
		params.AppModuleBasic{},
		crisis.AppModuleBasic{},
		slashing.AppModuleBasic{},
		upgrade.AppModuleBasic{},
		supply.AppModuleBasic{},
		evidence.AppModuleBasic{},

		bonds.AppModuleBasic{},
	)
)

Functions

func ExportParamsToJSON

func ExportParamsToJSON(params simulation.Params, path string) error

ExportParamsToJSON util function to export the simulation parameters to JSON

func ExportStateToJSON

func ExportStateToJSON(app *SimApp, path string) error

ExportStateToJSON util function to export the app state to JSON

func GetSimulationLog

func GetSimulationLog(storeName string, sdr sdk.StoreDecoderRegistry, cdc *codec.Codec, kvAs, kvBs []tmkv.Pair) (log string)

GetSimulationLog unmarshals the KVPair's Value to the corresponding type based on the each's module store key and the prefix bytes of the KVPair's key.

func MakeCodec

func MakeCodec() *codec.Codec

MakeCodec constructs the *std.Codec and *codec.Codec instances used by SimApp.

func SimulationOperations

func SimulationOperations(app *SimApp, 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 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() GenesisState

NewDefaultGenesisState generates the default state for the application.

type SimApp

type SimApp struct {
	*bam.BaseApp

	// keepers
	AccountKeeper auth.AccountKeeper
	BankKeeper    bank.Keeper
	SupplyKeeper  supply.Keeper
	StakingKeeper staking.Keeper

	CrisisKeeper crisis.Keeper

	BondsKeeper bonds.Keeper
	// contains filtered or unexported fields
}

Extended ABCI application

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

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

func (*SimApp) BeginBlocker

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

BeginBlocker application updates every begin 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 the application's sealed codec.

func (*SimApp) EndBlocker

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

EndBlocker application updates every end block

func (*SimApp) ExportAppStateAndValidators

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

export the state of bonds module app for a genesis file

func (*SimApp) InitChainer

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

InitChainer 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) Name

func (app *SimApp) Name() string

Name returns the name of the App

func (*SimApp) SimulationManager

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

SimulationManager implements the SimulationApp interface

Jump to

Keyboard shortcuts

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