testutil

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2024 License: Apache-2.0, MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Alice, _ = signer.Parse("MgCZT5vOnYZoVAeyjnzuJIVY9J4LNtJ+f8Js0cTPuKUpFne0BVEDJjEu6quFIU8yp91/TY/+MYK8GvlKoTDnqOCovCVM=")

did:key:z6Mkk89bC3JrVqKie71YEcc5M1SMVxuCgNx6zLZ8SYJsxALi

View Source
var Bob, _ = signer.Parse("MgCYbj5AJfVvdrjkjNCxB3iAUwx7RQHVQ7H1sKyHy46Iose0BEevXgL1V73PD9snOCIoONgb+yQ9sycYchQC8kygR4qY=")

did:key:z6MkffDZCkCTWreg8868fG1FGFogcJj5X6PY93pPcWDn9bob

View Source
var Mallory, _ = signer.Parse("MgCYtH0AvYxiQwBG6+ZXcwlXywq9tI50G2mCAUJbwrrahkO0B0elFYkl3Ulf3Q3A/EvcVY0utb4etiSE8e6pi4H0FEmU=")

did:key:z6MktafZTREjJkvV5mfJxcLpNBoVPwDLhTuMg9ng7dY4zMAL

View Source
var Service, _ = signer.Parse("MgCYKXoHVy7Vk4/QjcEGi+MCqjntUiasxXJ8uJKY0qh11e+0Bs8WsdqGK7xothgrDzzWD0ME7ynPjz2okXDh8537lId8=")

did:key:z6MkrZ1r5XBFZjBU34qyD8fueMbMRkKw17BZaq2ivKFjnz2z

View Source
var TestURL, _ = url.Parse("https://storacha.network")

Functions

func Must

func Must[T any](val T, err error) func(*testing.T) T

Must takes return values from a function and returns the non-error one. If the error value is non-nil then it fails the test

func Must2

func Must2[T, U any](val1 T, val2 U, err error) func(*testing.T) (T, U)

Must2 takes return values from a 3 return function and returns the non-error ones. If the error value is non-nil then it fails the test.

func RandomBitswapProviderResult added in v1.0.0

func RandomBitswapProviderResult() model.ProviderResult

func RandomBytes

func RandomBytes(size int) []byte

func RandomCAR

func RandomCAR(size int) (datamodel.Link, mh.Multihash, []byte)

RandomCAR creates a CAR with a single block of random bytes of the specified size. It returns the link of the root block, the hash of the CAR itself and the bytes of the CAR.

func RandomCID

func RandomCID() datamodel.Link

func RandomIndexClaim

func RandomIndexClaim() ucan.Capability[assert.IndexCaveats]

func RandomIndexDelegation

func RandomIndexDelegation() delegation.Delegation

func RandomLocationClaim

func RandomLocationClaim() ucan.Capability[assert.LocationCaveats]

func RandomLocationCommitmentProviderResult added in v1.0.0

func RandomLocationCommitmentProviderResult() model.ProviderResult

func RandomLocationDelegation

func RandomLocationDelegation() delegation.Delegation

func RandomMultiaddr

func RandomMultiaddr() multiaddr.Multiaddr

func RandomMultihash

func RandomMultihash() mh.Multihash

func RandomMultihashes

func RandomMultihashes(count int) []mh.Multihash

func RandomPeer

func RandomPeer() peer.ID

func RandomPrincipal added in v1.0.0

func RandomPrincipal() ucan.Principal

func RandomProviderResult

func RandomProviderResult() model.ProviderResult

func RandomShardedDagIndexView

func RandomShardedDagIndexView(size int) (mh.Multihash, blobindex.ShardedDagIndexView)

func RandomSigner added in v1.0.0

func RandomSigner() principal.Signer

func RequireEqualDelegation

func RequireEqualDelegation(t *testing.T, expectedDelegation delegation.Delegation, actualDelegation delegation.Delegation)

RequireEqualDelegation compares two delegations to verify their equality

func RequireEqualIndex

func RequireEqualIndex(t *testing.T, expectedIndex blobindex.ShardedDagIndexView, actualIndex blobindex.ShardedDagIndexView)

RequireEqualIndex compares two sharded dag indexes to verify their equality

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL