Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JekaMas committed Jun 3, 2022
1 parent 01b6d6c commit 208133b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
7 changes: 7 additions & 0 deletions eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,13 @@ func (s *Ethereum) Start() error {
// StartCheckpointWhitelistService starts the goroutine to fetch checkpoints and update the
// checkpoint whitelist map.
func (s *Ethereum) startCheckpointWhitelistService() {
// a shortcut helps with tests and early exit
select {
case <-s.closeCh:
return
default:
}

// first run the checkpoint whitelist
err := s.handleWhitelistCheckpoint()
if err != nil {
Expand Down
10 changes: 9 additions & 1 deletion tests/bor/bor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,18 @@ func TestInsertingSpanSizeBlocks(t *testing.T) {
engine := init.ethereum.Engine()
_bor := engine.(*bor.Bor)

defer engine.Close()

h, heimdallSpan, ctrl := getMockedHeimdallClient(t)
defer ctrl.Finish()

h.EXPECT().FetchLatestCheckpoint().Return(&bor.Checkpoint{}, nil).AnyTimes()
_, span := loadSpanFromFile(t)

h.EXPECT().FetchLatestCheckpoint().Return(&bor.Checkpoint{
Proposer: span.SelectedProducers[0].Address,
StartBlock: big.NewInt(0),
EndBlock: big.NewInt(int64(spanSize)),
}, nil).Times(1)

_bor.SetHeimdallClient(h)

Expand Down

0 comments on commit 208133b

Please sign in to comment.