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

Function verifyCompletingEvent

protocols/cpc/fetcher/fetcher_test.go:208–222  ·  view source on GitHub ↗

verifyCompletingEvent verifies that one single event arrive on an completing channel.

(t *testing.T, completing chan []common.Hash, arrive bool)

Source from the content-addressed store, hash-verified

206
207// verifyCompletingEvent verifies that one single event arrive on an completing channel.
208func verifyCompletingEvent(t *testing.T, completing chan []common.Hash, arrive bool) {
209 if arrive {
210 select {
211 case <-completing:
212 case <-time.After(time.Second):
213 t.Fatalf("completing timeout")
214 }
215 } else {
216 select {
217 case <-completing:
218 t.Fatalf("completing invoked")
219 case <-time.After(10 * time.Millisecond):
220 }
221 }
222}
223
224// verifyImportEvent verifies that one single event arrive on an import channel.
225func verifyImportEvent(t *testing.T, imported chan *types.Block, arrive bool) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected