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

Function verifyFetchingEvent

protocols/cpc/fetcher/fetcher_test.go:191–205  ·  view source on GitHub ↗

verifyFetchingEvent verifies that one single event arrive on a fetching channel.

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

Source from the content-addressed store, hash-verified

189
190// verifyFetchingEvent verifies that one single event arrive on a fetching channel.
191func verifyFetchingEvent(t *testing.T, fetching chan []common.Hash, arrive bool) {
192 if arrive {
193 select {
194 case <-fetching:
195 case <-time.After(time.Second):
196 t.Fatalf("fetching timeout")
197 }
198 } else {
199 select {
200 case <-fetching:
201 t.Fatalf("fetching invoked")
202 case <-time.After(10 * time.Millisecond):
203 }
204 }
205}
206
207// verifyCompletingEvent verifies that one single event arrive on an completing channel.
208func verifyCompletingEvent(t *testing.T, completing chan []common.Hash, arrive bool) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected