testutil

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: May 26, 2023 License: Apache-2.0, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsBlock

func ContainsBlock(blks []blocks.Block, block blocks.Block) bool

ContainsBlock returns true if a block is found n a list of blocks

func ContainsKey

func ContainsKey(ks []cid.Cid, c cid.Cid) bool

ContainsKey returns true if a key is found n a list of CIDs.

func ContainsPeer

func ContainsPeer(peers []peer.ID, p peer.ID) bool

ContainsPeer returns true if a peer is found n a list of peers.

func GenerateBlocksOfSize

func GenerateBlocksOfSize(n int, size int64) []blocks.Block

GenerateBlocksOfSize generates a series of blocks of the given byte size

func GenerateCids

func GenerateCids(n int) []cid.Cid

GenerateCids produces n content identifiers.

func GenerateMessageEntries

func GenerateMessageEntries(n int, isCancel bool) []bsmsg.Entry

GenerateMessageEntries makes fake bitswap message entries.

func GeneratePeers

func GeneratePeers(n int) []peer.ID

GeneratePeers creates n peer ids.

func GenerateSessionID

func GenerateSessionID() uint64

GenerateSessionID make a unit session identifier.

func IndexOf

func IndexOf(blks []blocks.Block, c cid.Cid) int

IndexOf returns the index of a given cid in an array of blocks

func MatchKeysIgnoreOrder

func MatchKeysIgnoreOrder(ks1 []cid.Cid, ks2 []cid.Cid) bool

MatchKeysIgnoreOrder returns true if the lists of CIDs match (even if they're in a different order)

func MatchPeersIgnoreOrder

func MatchPeersIgnoreOrder(ps1 []peer.ID, ps2 []peer.ID) bool

MatchPeersIgnoreOrder returns true if the lists of peers match (even if they're in a different order)

Types

This section is empty.

Jump to

Keyboard shortcuts

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