Register Subscribers After Node Is Synced (#7468)

* wait for synced

* fix again

* add test

* fix all

* fixes deepsource reported issue

Co-authored-by: Victor Farazdagi <simple.square@gmail.com>
This commit is contained in:
Nishant Das
2020-10-10 16:50:28 +08:00
committed by GitHub
parent 4c09e59b3b
commit 43765b5cb0
6 changed files with 215 additions and 66 deletions

View File

@@ -2,7 +2,6 @@ package initialsync
import (
"context"
"fmt"
"testing"
eth "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
@@ -333,6 +332,7 @@ func TestService_processBlock(t *testing.T) {
Epoch: 0,
},
},
StateNotifier: &mock.MockStateNotifier{},
})
ctx := context.Background()
genesis := makeGenesisTime(32)
@@ -392,6 +392,7 @@ func TestService_processBlockBatch(t *testing.T) {
Epoch: 0,
},
},
StateNotifier: &mock.MockStateNotifier{},
})
ctx := context.Background()
genesis := makeGenesisTime(32)
@@ -439,8 +440,7 @@ func TestService_processBlockBatch(t *testing.T) {
ctx context.Context, blocks []*eth.SignedBeaconBlock, blockRoots [][32]byte) error {
return nil
})
expectedErr := fmt.Sprintf("no good blocks in batch")
assert.ErrorContains(t, expectedErr, err)
assert.ErrorContains(t, "no good blocks in batch", err)
var badBatch2 []*eth.SignedBeaconBlock
for i, b := range batch2 {