Documentation ¶
Index ¶
- func CreateRandomAccounts(numAccts int) []sdk.AccAddress
- func GenerateTestAddrs() (string, string)
- type KeeperTestHelper
- func (s *KeeperTestHelper) AllocateRewardsToValidator(valAddr sdk.ValAddress, rewardAmt sdk.Int)
- func (s *KeeperTestHelper) AssertEventEmitted(ctx sdk.Context, eventTypeExpected string, numEventsExpected int)
- func (s *KeeperTestHelper) BeginNewBlock(executeNextEpoch bool)
- func (s *KeeperTestHelper) BeginNewBlockWithProposer(executeNextEpoch bool, proposer sdk.ValAddress)
- func (s *KeeperTestHelper) BuildTx(txBuilder client.TxBuilder, msgs []sdk.Msg, sigV2 signing.SignatureV2, ...) authsigning.Tx
- func (s *KeeperTestHelper) Commit()
- func (s *KeeperTestHelper) CreateTestContext() sdk.Context
- func (s *KeeperTestHelper) CreateTestContextWithMultiStore() (sdk.Context, sdk.CommitMultiStore)
- func (s *KeeperTestHelper) EndBlock()
- func (s *KeeperTestHelper) FundAcc(acc sdk.AccAddress, amounts sdk.Coins)
- func (s *KeeperTestHelper) FundModuleAcc(moduleName string, amounts sdk.Coins)
- func (s *KeeperTestHelper) MintCoins(coins sdk.Coins)
- func (s *KeeperTestHelper) RunMsg(msg sdk.Msg) (*sdk.Result, error)
- func (s *KeeperTestHelper) Setup()
- func (s *KeeperTestHelper) SetupMultipleValidators(numValidator int) []string
- func (s *KeeperTestHelper) SetupTestForInitGenesis()
- func (s *KeeperTestHelper) SetupValidator(bondStatus stakingtypes.BondStatus) sdk.ValAddress
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateRandomAccounts ¶
func CreateRandomAccounts(numAccts int) []sdk.AccAddress
CreateRandomAccounts is a function return a list of randomly generated AccAddresses
func GenerateTestAddrs ¶
Types ¶
type KeeperTestHelper ¶
type KeeperTestHelper struct { suite.Suite App *app.App Ctx sdk.Context QueryHelper *baseapp.QueryServiceTestHelper TestAccs []sdk.AccAddress }
func (*KeeperTestHelper) AllocateRewardsToValidator ¶
func (s *KeeperTestHelper) AllocateRewardsToValidator(valAddr sdk.ValAddress, rewardAmt sdk.Int)
AllocateRewardsToValidator allocates reward tokens to a distribution module then allocates rewards to the validator address.
func (*KeeperTestHelper) AssertEventEmitted ¶
func (s *KeeperTestHelper) AssertEventEmitted(ctx sdk.Context, eventTypeExpected string, numEventsExpected int)
AssertEventEmitted asserts that ctx's event manager has emitted the given number of events of the given type.
func (*KeeperTestHelper) BeginNewBlock ¶
func (s *KeeperTestHelper) BeginNewBlock(executeNextEpoch bool)
BeginNewBlock starts a new block.
func (*KeeperTestHelper) BeginNewBlockWithProposer ¶
func (s *KeeperTestHelper) BeginNewBlockWithProposer(executeNextEpoch bool, proposer sdk.ValAddress)
BeginNewBlockWithProposer begins a new block with a proposer.
func (*KeeperTestHelper) BuildTx ¶
func (s *KeeperTestHelper) BuildTx( txBuilder client.TxBuilder, msgs []sdk.Msg, sigV2 signing.SignatureV2, memo string, txFee sdk.Coins, gasLimit uint64, ) authsigning.Tx
BuildTx builds a transaction.
func (*KeeperTestHelper) Commit ¶
func (s *KeeperTestHelper) Commit()
func (*KeeperTestHelper) CreateTestContext ¶
func (s *KeeperTestHelper) CreateTestContext() sdk.Context
CreateTestContext creates a test context.
func (*KeeperTestHelper) CreateTestContextWithMultiStore ¶
func (s *KeeperTestHelper) CreateTestContextWithMultiStore() (sdk.Context, sdk.CommitMultiStore)
CreateTestContextWithMultiStore creates a test context and returns it together with multi store.
func (*KeeperTestHelper) EndBlock ¶
func (s *KeeperTestHelper) EndBlock()
EndBlock ends the block, and runs commit
func (*KeeperTestHelper) FundAcc ¶
func (s *KeeperTestHelper) FundAcc(acc sdk.AccAddress, amounts sdk.Coins)
FundAcc funds target address with specified amount.
func (*KeeperTestHelper) FundModuleAcc ¶
func (s *KeeperTestHelper) FundModuleAcc(moduleName string, amounts sdk.Coins)
FundModuleAcc funds target modules with specified amount.
func (*KeeperTestHelper) MintCoins ¶
func (s *KeeperTestHelper) MintCoins(coins sdk.Coins)
func (*KeeperTestHelper) Setup ¶
func (s *KeeperTestHelper) Setup()
Setup sets up basic environment for suite (App, Ctx, and test accounts)
func (*KeeperTestHelper) SetupMultipleValidators ¶
func (s *KeeperTestHelper) SetupMultipleValidators(numValidator int) []string
SetupMultipleValidators setups "numValidator" validators and returns their address in string
func (*KeeperTestHelper) SetupTestForInitGenesis ¶
func (s *KeeperTestHelper) SetupTestForInitGenesis()
func (*KeeperTestHelper) SetupValidator ¶
func (s *KeeperTestHelper) SetupValidator(bondStatus stakingtypes.BondStatus) sdk.ValAddress
SetupValidator sets up a validator and returns the ValAddress.