Documentation ¶
Index ¶
- func GenerateTestAddrs() (string, string)
- func SetupAddr(index int) sdk.AccAddress
- func SetupAddrs(numAddrs int) []sdk.AccAddress
- type KeeperTestHelper
- func (s *KeeperTestHelper) AssertEventEmitted(ctx sdk.Context, eventTypeExpected string, numEventsExpected int)
- func (s *KeeperTestHelper) AssertEventValueEmitted(eventValue, message string)
- func (s *KeeperTestHelper) AssertEventValueNotEmitted(eventValue, message string)
- func (s *KeeperTestHelper) AssertNEventValuesEmitted(eventValue string, nEvents int)
- func (s *KeeperTestHelper) Commit()
- func (s *KeeperTestHelper) CreateTestContext() sdk.Context
- func (s *KeeperTestHelper) CreateTestContextWithMultiStore() (sdk.Context, sdk.CommitMultiStore)
- func (s *KeeperTestHelper) ExtractAttributes(event sdk.Event) map[string]string
- func (s *KeeperTestHelper) FindEvent(events []sdk.Event, name string) sdk.Event
- func (s *KeeperTestHelper) FundAcc(acc sdk.AccAddress, amounts sdk.Coins)
- func (s *KeeperTestHelper) Setup()
- func (s *KeeperTestHelper) SetupAddr(index int) sdk.AccAddress
- func (s *KeeperTestHelper) SetupAddrs(numAddrs int) []sdk.AccAddress
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateTestAddrs ¶
These are for testing msg.ValidateBasic() functions which need to validate for valid/invalid addresses. Should not be used for anything else because these addresses are totally uninterpretable (100% random).
func SetupAddr ¶
func SetupAddr(index int) sdk.AccAddress
setupAddr takes a balance, prefix, and address number. Then returns the respective account address byte array. If prefix is left blank, it will be replaced with a random prefix.
func SetupAddrs ¶
func SetupAddrs(numAddrs int) []sdk.AccAddress
Types ¶
type KeeperTestHelper ¶
type KeeperTestHelper struct { suite.Suite App *app.App Ctx sdk.Context GoCtx context.Context // Used for testing queries end to end. // You can wrap this in a module-specific QueryClient() // and then make calls as you would a normal GRPC client. QueryHelper *baseapp.QueryServiceTestHelper }
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) AssertEventValueEmitted ¶
func (s *KeeperTestHelper) AssertEventValueEmitted(eventValue, message string)
func (*KeeperTestHelper) AssertEventValueNotEmitted ¶
func (s *KeeperTestHelper) AssertEventValueNotEmitted(eventValue, message string)
func (*KeeperTestHelper) AssertNEventValuesEmitted ¶
func (s *KeeperTestHelper) AssertNEventValuesEmitted(eventValue string, nEvents int)
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) CreateTestContextWithMultiStore ¶
func (s *KeeperTestHelper) CreateTestContextWithMultiStore() (sdk.Context, sdk.CommitMultiStore)
CreateTestContextWithMultiStore creates a test context and returns it together with multi store.
func (*KeeperTestHelper) ExtractAttributes ¶
func (s *KeeperTestHelper) ExtractAttributes(event sdk.Event) map[string]string
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) SetupAddr ¶
func (s *KeeperTestHelper) SetupAddr(index int) sdk.AccAddress
func (*KeeperTestHelper) SetupAddrs ¶
func (s *KeeperTestHelper) SetupAddrs(numAddrs int) []sdk.AccAddress