Documentation
      ¶
    
    
  
    
  
    Overview ¶
Package nullify provides methods to init nil values structs for test assertion.
Index ¶
- Variables
 - func AccAddress() sdk.AccAddress
 - func AssertEventsPresent(t *testing.T, events sdk.Events, eventsType []string)
 - func BlankContext(storeKeyName string) sdk.Context
 - func EventHasAttributeValue(abciEvent sdk.Event, key string, want string) error
 - func Fill(x interface{}) interface{}
 - func FilterNewEvents(beforeEvents, afterEvents sdk.Events) sdk.Events
 - func PrivKey() (*secp256k1.PrivKey, sdk.AccAddress)
 - func PrivKeyAddressPairs(n int) (keys []cryptotypes.PrivKey, addrs []sdk.AccAddress)
 - func RandStringBytes(n int) string
 - func RequireContainsTypedEvent(t require.TestingT, ctx sdk.Context, event proto.Message)
 - func RequireHasTypedEvent(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 ¶
This section is empty.
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 AssertEventsPresent ¶ added in v0.21.9
AssertEventsPresent fails the test if the given eventsType are not present in the events
func BlankContext ¶
func EventHasAttributeValue ¶ added in v0.21.6
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 ¶
func Fill(x interface{}) interface{}
    Fill analyze all struct fields and slices with reflection and initialize the nil and empty slices, structs, and pointers.
func FilterNewEvents ¶ added in v0.21.9
FilterNewEvents returns only the new events from afterEvents that were not present in beforeEvents
func PrivKey ¶ added in v0.21.0
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 RandStringBytes ¶
func RequireHasTypedEvent ¶
func RequireNotHasTypedEvent ¶
func RunFunctionTests ¶
func RunFunctionTests(t *testing.T, testCases []FunctionTestCase)
Types ¶
type FunctionTestCase ¶
type FunctionTestCase struct {
	Name string
	Test func()
}
    type FunctionTestCases ¶
type FunctionTestCases = []FunctionTestCase
      
      Directories
      ¶
    
    | Path | Synopsis | 
|---|---|
| 
       Package network implements and exposes a fully operational in-process Tendermint test network that consists of at least one or potentially many validators. 
         | 
      Package network implements and exposes a fully operational in-process Tendermint test network that consists of at least one or potentially many validators. |