erigon-pulse/polygon/sync/canonical_chain_builder_test.go
2024-01-04 10:44:57 +01:00

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)
}