verifyImportEvent verifies that one single event arrive on an import channel.
(t *testing.T, imported chan *types.Block, arrive bool)
| 223 | |
| 224 | // verifyImportEvent verifies that one single event arrive on an import channel. |
| 225 | func verifyImportEvent(t *testing.T, imported chan *types.Block, arrive bool) { |
| 226 | if arrive { |
| 227 | select { |
| 228 | case <-imported: |
| 229 | case <-time.After(time.Second): |
| 230 | t.Fatalf("import timeout") |
| 231 | } |
| 232 | } else { |
| 233 | select { |
| 234 | case <-imported: |
| 235 | t.Fatalf("import invoked") |
| 236 | case <-time.After(10 * time.Millisecond): |
| 237 | } |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | // verifyImportCount verifies that exactly count number of events arrive on an |
| 242 | // import hook channel. |
no outgoing calls
no test coverage detected