MCPcopy Create free account
hub / github.com/CPChain/chain / verifyImportCount

Function verifyImportCount

protocols/cpc/fetcher/fetcher_test.go:243–252  ·  view source on GitHub ↗

verifyImportCount verifies that exactly count number of events arrive on an import hook channel.

(t *testing.T, imported chan *types.Block, count int)

Source from the content-addressed store, hash-verified

241// verifyImportCount verifies that exactly count number of events arrive on an
242// import hook channel.
243func verifyImportCount(t *testing.T, imported chan *types.Block, count int) {
244 for i := 0; i < count; i++ {
245 select {
246 case <-imported:
247 case <-time.After(time.Second):
248 t.Fatalf("block %d: import timeout", i+1)
249 }
250 }
251 verifyImportDone(t, imported)
252}
253
254// verifyImportDone verifies that no more events are arriving on an import channel.
255func verifyImportDone(t *testing.T, imported chan *types.Block) {

Callers 6

TestRandomArrivalImportFunction · 0.85
TestQueueGapFillFunction · 0.85
TestImportDeduplicationFunction · 0.85

Calls 1

verifyImportDoneFunction · 0.85

Tested by

no test coverage detected