verifyImportCount verifies that exactly count number of events arrive on an import hook channel.
(t *testing.T, imported chan *types.Block, count int)
| 241 | // verifyImportCount verifies that exactly count number of events arrive on an |
| 242 | // import hook channel. |
| 243 | func 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. |
| 255 | func verifyImportDone(t *testing.T, imported chan *types.Block) { |
no test coverage detected