Documentation ¶
Overview ¶
Package simapp contains utils to bootstrap the chain.
Index ¶
- func GenAccountAddress() sdk.AccAddress
- type GenesisState
- type Option
- type SimApp
- func (s *SimApp) BeginNextBlock()
- func (s *SimApp) CreateProposal(t *testing.T, content govtypes.Content, deposit sdk.Coin, ...)
- func (s *SimApp) CreateValidator(t *testing.T, selfDelegation sdk.Coin, description stakingtypes.Description, ...)
- func (s *SimApp) CurrentContext() sdk.Context
- func (s *SimApp) EndBlock(ctx sdk.Context)
- func (s *SimApp) EndBlockAndCommit(ctx sdk.Context)
- func (s *SimApp) NewContext() sdk.Context
- func (s *SimApp) NewNextContext() sdk.Context
- func (s *SimApp) OnomyApp() *app.OnomyApp
- func (s *SimApp) VoteProposal(t *testing.T, proposalID uint64, option govtypes.VoteOption, ...)
- type ValReq
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenAccountAddress ¶ added in v0.0.8
func GenAccountAddress() sdk.AccAddress
GenAccountAddress generates random account.
Types ¶
type GenesisState ¶
type GenesisState map[string]json.RawMessage
GenesisState 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 Option ¶
type Option struct {
// contains filtered or unexported fields
}
Option is an option pattern function used fot the test simapp customisations.
func WithAppCommit ¶
func WithAppCommit() Option
WithAppCommit commits the app state after the initialisation.
func WithGenesisAccountsAndBalances ¶
WithGenesisAccountsAndBalances returns genesis override Option for initial balances.
func WithGenesisOverride ¶
func WithGenesisOverride(override func(map[string]json.RawMessage) map[string]json.RawMessage) Option
WithGenesisOverride returns genesis override ConfigOption.
type SimApp ¶
type SimApp struct {
// contains filtered or unexported fields
}
The SimApp is OnomyApp wrapper with the advance testing capabilities.
func SetupWithValidators ¶
func SetupWithValidators(t *testing.T, vals map[string]ValReq, opts ...Option) (*SimApp, map[string]*secp256k1.PrivKey)
SetupWithValidators create new simApp with the defined list of the validators.
func (*SimApp) BeginNextBlock ¶
func (s *SimApp) BeginNextBlock()
BeginNextBlock begins new SimApp block.
func (*SimApp) CreateProposal ¶
func (s *SimApp) CreateProposal( t *testing.T, content govtypes.Content, deposit sdk.Coin, priv cryptotypes.PrivKey, )
CreateProposal creates a new proposal with the provided contant.
func (*SimApp) CreateValidator ¶
func (s *SimApp) CreateValidator( t *testing.T, selfDelegation sdk.Coin, description stakingtypes.Description, commission stakingtypes.CommissionRates, minSelfDelegation sdk.Int, priv cryptotypes.PrivKey, )
CreateValidator creates the validator.
func (*SimApp) CurrentContext ¶
CurrentContext returns current context for the SimApp.
func (*SimApp) EndBlockAndCommit ¶
EndBlockAndCommit ends the current block and commit the state.
func (*SimApp) NewContext ¶
NewContext returns empty sdk context for the SimApp.
func (*SimApp) NewNextContext ¶
NewNextContext creates next block sdk context for the SimApp.
func (*SimApp) VoteProposal ¶
func (s *SimApp) VoteProposal( t *testing.T, proposalID uint64, option govtypes.VoteOption, priv cryptotypes.PrivKey, )
VoteProposal votes for the proposal.
type ValReq ¶
type ValReq struct { Balance sdk.Coins SelfBondCoin sdk.Coin Commission stakingtypes.CommissionRates Reward sdk.Coin }
ValReq is simplified struct for the validator creation.