Documentation ¶
Index ¶
- func ApplyMockIO(c *cobra.Command) (BufferReader, BufferWriter)
- func DefaultContext(key, tkey sdk.StoreKey) sdk.Context
- func GenerateCoinKey(algo keyring.SignatureAlgo) (sdk.AccAddress, string, error)
- func GenerateSaveCoinKey(keybase keyring.Keyring, keyName, mnemonic string, overwrite bool, ...) (sdk.AccAddress, string, error)
- func GetRequestWithHeaders(url string, headers map[string]string) ([]byte, error)
- func MustJSONMarshal(v any) []byte
- func TempFile(tb testing.TB) *os.File
- func W(input any) []byte
- func WriteToNewTempFile(tb testing.TB, s string) *os.File
- type BufferReader
- type BufferWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyMockIO ¶
func ApplyMockIO(c *cobra.Command) (BufferReader, BufferWriter)
ApplyMockIO replaces stdin/out/err with buffers that can be used during testing. Returns an input BufferReader and an output BufferWriter.
func DefaultContext ¶
DefaultContext creates a sdk.Context with a fresh dbm that can be used in tests.
func GenerateCoinKey ¶
func GenerateCoinKey(algo keyring.SignatureAlgo) (sdk.AccAddress, string, error)
GenerateCoinKey generates a new key mnemonic along with its addrress.
func GenerateSaveCoinKey ¶
func GenerateSaveCoinKey( keybase keyring.Keyring, keyName, mnemonic string, overwrite bool, algo keyring.SignatureAlgo, ) (sdk.AccAddress, string, error)
GenerateSaveCoinKey generates a new key mnemonic with its addrress. If mnemonic is provided then it's used for key generation. The key is saved in the keyring. The function returns error if overwrite=true and the key already exists.
func GetRequestWithHeaders ¶
GetRequestWithHeaders defines a wrapper around an HTTP GET request with a provided URL and custom headers An error is returned if the request or reading the body fails.
func MustJSONMarshal ¶ added in v0.48.0
Types ¶
type BufferReader ¶
BufferReader is implemented by types that read from a string buffer.
func ApplyMockIODiscardOutErr ¶
func ApplyMockIODiscardOutErr(c *cobra.Command) BufferReader
ApplyMockIODiscardOutputs replaces a cobra.Command output and error streams with a dummy io.Writer. Replaces and returns the io.Reader associated to the cobra.Command input stream.
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. |
Package rest provides HTTP types and primitives for REST requests validation and responses handling.
|
Package rest provides HTTP types and primitives for REST requests validation and responses handling. |