apptesting

package
v0.0.38 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

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

func GenerateTestAddrs() (string, string)

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) 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()

CreateTestContext creates a test context.

func (*KeeperTestHelper) CreateTestContext

func (s *KeeperTestHelper) CreateTestContext() sdk.Context

CreateTestContext creates a test context.

func (*KeeperTestHelper) EndBlock

func (s *KeeperTestHelper) EndBlock()

EndBlock ends the block.

func (*KeeperTestHelper) FundAcc

func (s *KeeperTestHelper) FundAcc(acc sdk.AccAddress, amounts sdk.Coins)

FundAcc funds target address with specified amount.

func (*KeeperTestHelper) Setup

func (s *KeeperTestHelper) Setup()

Setup sets up basic environment for suite (App, Ctx, and test accounts)

func (*KeeperTestHelper) SetupTokenFactory

func (s *KeeperTestHelper) SetupTokenFactory()

SetupTokenFactory sets up a token module account for the TokenFactoryKeeper.

func (*KeeperTestHelper) SetupValidator

func (s *KeeperTestHelper) SetupValidator(bondStatus stakingtypes.BondStatus) sdk.ValAddress

SetupValidator sets up a validator and returns the ValAddress.

Jump to

Keyboard shortcuts

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