Documentation ¶
Index ¶
- Variables
- func AddTestAddrs(app *SimApp, ctx sdk.Context, accNum int, accAmt sdk.Int) []sdk.AccAddress
- func CheckBalance(t *testing.T, app *SimApp, addr sdk.AccAddress, exp sdk.Coins)
- func GenSequenceOfTxs(msgs []sdk.Msg, accnums []uint64, initSeqNums []uint64, numToGenerate int, ...) []auth.StdTx
- func GenTx(msgs []sdk.Msg, accnums []uint64, seq []uint64, priv ...crypto.PrivKey) auth.StdTx
- func GetMaccPerms() map[string][]string
- func MakeCodec() *codec.Codec
- func SignCheckDeliver(t *testing.T, cdc *codec.Codec, app *bam.BaseApp, header abci.Header, ...) sdk.Result
- type GenesisState
- type SimApp
- func (app *SimApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
- func (app *SimApp) Codec() *codec.Codec
- func (app *SimApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
- func (app *SimApp) GetKey(storeKey string) *sdk.KVStoreKey
- func (app *SimApp) GetTKey(storeKey string) *sdk.TransientStoreKey
- func (app *SimApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
- func (app *SimApp) LoadHeight(height int64) error
- func (app *SimApp) ModuleAccountAddrs() map[string]bool
Constants ¶
This section is empty.
Variables ¶
var ( // default home directories for the application CLI DefaultCLIHome = os.ExpandEnv("$HOME/.simapp") // default home directories for the application daemon DefaultNodeHome = os.ExpandEnv("$HOME/.simapp") // 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{}, supply.AppModuleBasic{}, genutil.AppModuleBasic{}, bank.AppModuleBasic{}, staking.AppModuleBasic{}, mint.AppModuleBasic{}, distr.AppModuleBasic{}, gov.NewAppModuleBasic(paramsclient.ProposalHandler, distr.ProposalHandler), params.AppModuleBasic{}, crisis.AppModuleBasic{}, slashing.AppModuleBasic{}, nft.AppModuleBasic{}, ) )
Functions ¶
func AddTestAddrs ¶
AddTestAddrs constructs and returns accNum amount of accounts with an initial balance of accAmt
func CheckBalance ¶
CheckBalance checks the balance of an account.
func GenSequenceOfTxs ¶
func GenSequenceOfTxs(msgs []sdk.Msg, accnums []uint64, initSeqNums []uint64, numToGenerate int, priv ...crypto.PrivKey) []auth.StdTx
GenSequenceOfTxs generates a set of signed transactions of messages, such that they differ only by having the sequence numbers incremented between every transaction.
func GetMaccPerms ¶
GetMaccPerms returns a copy of the module account permissions
func SignCheckDeliver ¶
func SignCheckDeliver( t *testing.T, cdc *codec.Codec, app *bam.BaseApp, header abci.Header, msgs []sdk.Msg, accNums, seq []uint64, expSimPass, expPass bool, priv ...crypto.PrivKey, ) sdk.Result
SignCheckDeliver checks a generated signed transaction and simulates a block commitment with the given transaction. A test assertion is made using the parameter 'expPass' against the result. A corresponding result is returned.
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 SlashingKeeper slashing.Keeper MintKeeper mint.Keeper DistrKeeper distr.Keeper GovKeeper gov.Keeper CrisisKeeper crisis.Keeper ParamsKeeper params.Keeper NFTKeeper nft.Keeper // contains filtered or unexported fields }
SimApp 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 NewSimApp ¶
func NewSimApp( logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, invCheckPeriod uint, baseAppOptions ...func(*bam.BaseApp), ) *SimApp
NewSimApp returns a reference to an initialized SimApp.
func SetupWithGenesisAccounts ¶
func SetupWithGenesisAccounts(genAccs []authexported.GenesisAccount) *SimApp
SetupWithGenesisAccounts initializes a new SimApp with the passed in genesis accounts.
func (*SimApp) BeginBlocker ¶
func (app *SimApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
application updates every begin block
func (*SimApp) EndBlocker ¶
func (app *SimApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
application updates every end block
func (*SimApp) GetKey ¶
func (app *SimApp) GetKey(storeKey string) *sdk.KVStoreKey
GetKey returns the KVStoreKey for the provided store key
func (*SimApp) GetTKey ¶
func (app *SimApp) GetTKey(storeKey string) *sdk.TransientStoreKey
GetTKey returns the TransientStoreKey for the provided store key
func (*SimApp) InitChainer ¶
func (app *SimApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
application update at chain initialization
func (*SimApp) LoadHeight ¶
load a particular height
func (*SimApp) ModuleAccountAddrs ¶
ModuleAccountAddrs returns all the app's module account addresses.