fix tests
This commit is contained in:
parent
58e3246ffc
commit
6f7333fd5f
|
@ -45,10 +45,16 @@ func (is *IndexerService) OnStart() error {
|
||||||
var batch *Batch
|
var batch *Batch
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case e := <-blockHeadersCh:
|
case e, ok := <-blockHeadersCh:
|
||||||
|
if !ok {
|
||||||
|
return
|
||||||
|
}
|
||||||
numTxs = e.(types.EventDataNewBlockHeader).Header.NumTxs
|
numTxs = e.(types.EventDataNewBlockHeader).Header.NumTxs
|
||||||
batch = NewBatch(numTxs)
|
batch = NewBatch(numTxs)
|
||||||
case e := <-txsCh:
|
case e, ok := <-txsCh:
|
||||||
|
if !ok {
|
||||||
|
return
|
||||||
|
}
|
||||||
if batch == nil {
|
if batch == nil {
|
||||||
panic("Expected pubsub to send block header first, but got tx event")
|
panic("Expected pubsub to send block header first, but got tx event")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue