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

22 lines
600 B
Go

package sync
import (
"github.com/ledgerwatch/log/v3"
"testing"
"github.com/stretchr/testify/require"
"github.com/ledgerwatch/erigon/consensus/bor/borcfg"
heimdallspan "github.com/ledgerwatch/erigon/consensus/bor/heimdall/span"
"github.com/ledgerwatch/erigon/core/types"
)
func TestHeaderDifficultyNoSignature(t *testing.T) {
borConfig := borcfg.BorConfig{}
span := heimdallspan.HeimdallSpan{}
logger := log.New()
calc := NewDifficultyCalculator(&borConfig, &span, logger)
_, err := calc.HeaderDifficulty(new(types.Header))
require.ErrorContains(t, err, "signature suffix missing")
}