Documentation ¶
Overview ¶
Package nullify provides methods to init nil values structs for test assertion.
Index ¶
- Constants
- Variables
- func AccAddress() sdk.AccAddress
- func AssertEventPresent(events sdk.Events, eventType string) error
- func AssertEventsPresent(events sdk.Events, eventTypes []string) (err error)
- func BeforeIntegrationSuite(suiteT *testing.T)
- func BlankContext(storeKeyName string) sdk.Context
- func EventHasAttributeValue(abciEvent sdk.Event, key string, want string) error
- func Fill(x any) any
- func FilterNewEvents(beforeEvents, afterEvents sdk.Events) sdk.Events
- func GetPackageDir() (string, error)
- func GovModuleAddr() sdk.AccAddress
- func PrivKey() (*secp256k1.PrivKey, sdk.AccAddress)
- func PrivKeyAddressPairs(n int) (keys []cryptotypes.PrivKey, addrs []sdk.AccAddress)
- func RandLetters(n int) string
- func RequireContainsTypedEvent(t require.TestingT, ctx sdk.Context, event proto.Message)
- func RequireNotHasTypedEvent(t require.TestingT, ctx sdk.Context, event proto.Message)
- func RunFunctionTests(t *testing.T, testCases []FunctionTestCase)
- func SetupClientCtx(t *testing.T) context.Context
- type FunctionTestCase
- type FunctionTestCases
- type TypeLatin
Constants ¶
const ( ADDR_GUARD_CREAM = "nibi1zaavvzxez0elundtn32qnk9lkm8kmcsz44g7xl" ADDR_SUDO_ROOT = "nibi1qqx5reauy4glpskmppy88pz25qp2py5yxvpxdt" )
Variables ¶
var Latin = TypeLatin{
Letters: "abcdefghijklmnopqrstuvwxyz",
CapLetters: "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
Numbers: "0123456789",
}
Functions ¶
func AccAddress ¶
func AccAddress() sdk.AccAddress
AccAddress returns a sample address (sdk.AccAddress) created using secp256k1. Note that AccAddress().String() can be used to get a string representation.
func AssertEventPresent ¶
AssertEventsPresent: Errors if the given event type is not present in events
func AssertEventsPresent ¶
AssertEventsPresent: Errors if the given event types are not present in events
func BeforeIntegrationSuite ¶
BeforeIntegrationSuite: Skips a test if the `-short` flag is used:
All tests: `go test ./...` Unit tests only: `go test ./... -short` Integration tests only: `go test ./... -run Integration`
func BlankContext ¶
func EventHasAttributeValue ¶
EventHasAttributeValue parses the given ABCI event at a key to see if it matches (contains) the wanted value.
Args:
- abciEvent: The event under test
- key: The key for which we'll check the value
- want: The desired value
func Fill ¶
Fill analyze all struct fields and slices with reflection and initialize the nil and empty slices, structs, and pointers.
func FilterNewEvents ¶
FilterNewEvents returns only the new events from afterEvents that were not present in beforeEvents
func GetPackageDir ¶
GetPackageDir: Returns the absolute path of the Golang package that calls this function.
func GovModuleAddr ¶
func GovModuleAddr() sdk.AccAddress
func PrivKey ¶
func PrivKey() (*secp256k1.PrivKey, sdk.AccAddress)
PrivKey returns a private key and corresponding on-chain address.
func PrivKeyAddressPairs ¶
func PrivKeyAddressPairs(n int) (keys []cryptotypes.PrivKey, addrs []sdk.AccAddress)
PrivKeyAddressPairs generates (deterministically) a total of n private keys and addresses.
func RandLetters ¶
func RequireNotHasTypedEvent ¶
RequireNotHasTypedEvent: Error if an event type matches the proto.Message name
func RunFunctionTests ¶
func RunFunctionTests(t *testing.T, testCases []FunctionTestCase)
Types ¶
type FunctionTestCase ¶
type FunctionTestCase struct { Name string Test func() }
type FunctionTestCases ¶
type FunctionTestCases = []FunctionTestCase
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package "testnetwork" implements and exposes a fully operational in-process Tendermint test network that consists of at least one or potentially many validators.
|
Package "testnetwork" implements and exposes a fully operational in-process Tendermint test network that consists of at least one or potentially many validators. |