Documentation
¶
Index ¶
- Variables
- func ArgsMap(t *testing.T, inv ucan.Invocation) datamodel.Map
- func Must[T any](val T, err error) func(t *testing.T) T
- func RandomArgs(t *testing.T) *hdm.TestArgs
- func RandomBytes(t *testing.T, size int) []byte
- func RandomCID(t *testing.T) cid.Cid
- func RandomDID(t *testing.T) did.DID
- func RandomDigest(t *testing.T) multihash.Multihash
- func RandomSigner(t *testing.T) principal.Signer
- func ResultMap(t *testing.T, raw []byte) ipld.Map
Constants ¶
This section is empty.
Variables ¶
View Source
var ConsoleLogCommand, _ = command.Parse("/console/log")
logs a message to the console
View Source
var TestEchoCommand, _ = command.Parse("/test/echo")
echos the arguments back to the caller
Functions ¶
func ArgsMap ¶
ArgsMap decodes an invocation's args bytes into a generic datamodel.Map. Test convenience for echo handlers and ad-hoc key access; production code should decode ArgumentsBytes directly into a typed cborgen struct.
func Must ¶
Must takes return values from a function and returns the non-error one. If the error value is non-nil then it panics.
func RandomArgs ¶
RandomArgs returns a populated *hdm.TestArgs. It implements [cbg.CBORMarshaler] (and the dag-json equivalent) and can be passed directly to invocation.Invoke or marshalled into envelope bytes.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.