Versions in this module Expand all Collapse all v0 v0.0.1 Sep 1, 2021 Changes in this version + func AssertChannelEmpty(t TestingT, channel interface{}, errorMessage string) + func AssertContainsBlock(t TestingT, blks []blocks.Block, block blocks.Block) + func AssertContainsPeer(t TestingT, peers []peer.ID, p peer.ID) + func AssertDoesReceive(ctx context.Context, t TestingT, channel interface{}, errorMessage string) + func AssertDoesReceiveFirst(t TestingT, channel interface{}, errorMessage string, ...) + func AssertReceive(ctx context.Context, t TestingT, channel interface{}, out interface{}, ...) + func AssertReceiveFirst(t TestingT, channel interface{}, out interface{}, errorMessage string, ...) + func AssertSends(ctx context.Context, t TestingT, channel interface{}, in interface{}, ...) + func CollectErrors(ctx context.Context, t *testing.T, errChan <-chan error) []error + func CollectResponses(ctx context.Context, t TestingT, ...) []graphsync.ResponseProgress + func ContainsBlock(blks []blocks.Block, block blocks.Block) bool + func ContainsPeer(peers []peer.ID, p peer.ID) bool + func GenerateBlocksOfSize(n int, size int64) []blocks.Block + func GenerateCids(n int) []cid.Cid + func GeneratePeers(n int) []peer.ID + func IndexOf(blks []blocks.Block, c cid.Cid) int + func NewFakeBlockData() graphsync.BlockData + func NewInvalidSelectorSpec() ld.Node + func NewTestLink() ld.Link + func NewTestStore(blocksWritten map[ld.Link][]byte) ld.LinkSystem + func NewUnparsableSelectorSpec() ld.Node + func RandomBytes(n int64) []byte + func ReadNResponses(ctx context.Context, t TestingT, ...) []graphsync.ResponseProgress + func RefuteContainsBlock(t TestingT, blks []blocks.Block, block blocks.Block) + func RefuteContainsPeer(t TestingT, peers []peer.ID, p peer.ID) + func VerifyEmptyErrors(ctx context.Context, t TestingT, errChan <-chan error) + func VerifyEmptyResponse(ctx context.Context, t TestingT, ...) + func VerifyHasErrors(ctx context.Context, t TestingT, errChan <-chan error) + func VerifySingleTerminalError(ctx context.Context, t TestingT, errChan <-chan error) + type DispatchedEvent struct + Event notifications.Event + Topic notifications.Topic + type MockPublisher struct + func NewMockPublisher() *MockPublisher + func (mp *MockPublisher) AddNotifees(notifees []notifications.Notifee) + func (mp *MockPublisher) PublishEvents(events []notifications.Event) + func (mp *MockPublisher) PublishEventsOnTopicData(data []notifications.TopicData, events []notifications.Event) + func (mp *MockPublisher) PublishMatchingEvents(shouldPublish func(notifications.TopicData) bool, events []notifications.Event) + type NotifeeVerifier struct + func NewTestNotifee(data notifications.TopicData, bufferSize int) (notifications.Notifee, *NotifeeVerifier) + func (nv *NotifeeVerifier) ExpectClose(ctx context.Context, t *testing.T) + func (nv *NotifeeVerifier) ExpectEvents(ctx context.Context, t *testing.T, events []notifications.Event) + type TestBlockChain struct + GenisisLink ld.Link + GenisisNode ld.Node + MiddleLinks []ld.Link + MiddleNodes []ld.Node + TipLink ld.Link + TipNode ld.Node + func SetupBlockChain(ctx context.Context, t TestingT, lsys ld.LinkSystem, size uint64, ...) *TestBlockChain + func (tbc *TestBlockChain) AllBlocks() []blocks.Block + func (tbc *TestBlockChain) Blocks(from int, to int) []blocks.Block + func (tbc *TestBlockChain) Chooser(ld.Link, ld.LinkContext) (ld.NodePrototype, error) + func (tbc *TestBlockChain) LinkTipIndex(fromTip int) ld.Link + func (tbc *TestBlockChain) NodeTipIndex(fromTip int) ld.Node + func (tbc *TestBlockChain) RemainderBlocks(from int) []blocks.Block + func (tbc *TestBlockChain) Selector() ld.Node + func (tbc *TestBlockChain) VerifyRemainder(ctx context.Context, responseChan <-chan graphsync.ResponseProgress, from int) + func (tbc *TestBlockChain) VerifyRemainderSync(responses []graphsync.ResponseProgress, from int) + func (tbc *TestBlockChain) VerifyRemainderWithTypes(ctx context.Context, responseChan <-chan graphsync.ResponseProgress, from int) + func (tbc *TestBlockChain) VerifyResponseRange(ctx context.Context, responseChan <-chan graphsync.ResponseProgress, from int, ...) + func (tbc *TestBlockChain) VerifyResponseRangeSync(responses []graphsync.ResponseProgress, from int, to int) + func (tbc *TestBlockChain) VerifyWholeChain(ctx context.Context, responseChan <-chan graphsync.ResponseProgress) + func (tbc *TestBlockChain) VerifyWholeChainSync(responses []graphsync.ResponseProgress) + func (tbc *TestBlockChain) VerifyWholeChainWithTypes(ctx context.Context, responseChan <-chan graphsync.ResponseProgress) + type TestLDTree struct + LeafAlpha ld.Node + LeafAlphaBlock blocks.Block + LeafAlphaLnk ld.Link + LeafBeta ld.Node + LeafBetaBlock blocks.Block + LeafBetaLnk ld.Link + MiddleListBlock blocks.Block + MiddleListNode ld.Node + MiddleListNodeLnk ld.Link + MiddleMapBlock blocks.Block + MiddleMapNode ld.Node + MiddleMapNodeLnk ld.Link + RootBlock blocks.Block + RootNode ld.Node + RootNodeLnk ld.Link + Storage map[ld.Link][]byte + func NewTestLDTree() TestLDTree + type TestSubscriber struct + func NewTestSubscriber(bufferSize int) *TestSubscriber + func (ts *TestSubscriber) ExpectCloses(ctx context.Context, t *testing.T, topics []notifications.Topic) + func (ts *TestSubscriber) ExpectClosesAnyOrder(ctx context.Context, t *testing.T, topics []notifications.Topic) + func (ts *TestSubscriber) ExpectEvents(ctx context.Context, t *testing.T, events []DispatchedEvent) + func (ts *TestSubscriber) NoEventsReceived(t *testing.T) + func (ts *TestSubscriber) OnClose(topic notifications.Topic) + func (ts *TestSubscriber) OnNext(topic notifications.Topic, ev notifications.Event) + type TestingT interface + Errorf func(format string, args ...interface{}) + FailNow func() + Fatal func(args ...interface{})