mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-05 02:24:29 +00:00
24 lines
509 B
Go
24 lines
509 B
Go
|
package sync
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/require"
|
||
|
|
||
|
"github.com/ledgerwatch/erigon/core/types"
|
||
|
)
|
||
|
|
||
|
type testDifficultyCalculator struct {
|
||
|
}
|
||
|
|
||
|
func (*testDifficultyCalculator) HeaderDifficulty(*types.Header) (uint64, error) {
|
||
|
return 0, nil
|
||
|
}
|
||
|
|
||
|
func TestCanonicalChainBuilderConnectEmpty(t *testing.T) {
|
||
|
difficultyCalc := testDifficultyCalculator{}
|
||
|
builder := NewCanonicalChainBuilder(new(types.Header), &difficultyCalc)
|
||
|
err := builder.Connect([]*types.Header{})
|
||
|
require.Nil(t, err)
|
||
|
}
|