diff --git a/cl/coverage b/cl/coverage new file mode 100644 index 000000000..e15ab5288 --- /dev/null +++ b/cl/coverage @@ -0,0 +1,15 @@ +#!/bin/bash + +SKIP_TESTS=( + "github.com\/ledgerwatch\/erigon\/cl\/beacon" + "github.com\/ledgerwatch\/erigon\/cl\/phase1" + "github.com\/ledgerwatch\/erigon\/cl\/phase1\/core" + "github.com\/ledgerwatch\/erigon\/cl\/phase1\/network" + "github.com\/ledgerwatch\/erigon\/cl\/phase1\/stages" + "github.com\/ledgerwatch\/erigon\/cl\/rpc" + "github.com\/ledgerwatch\/erigon\/cl\/spectest\/consensus_tests" +) + +FLAGS=$(printf " -e /%s\\\t/d" "${SKIP_TESTS[@]}") + +go test ./... --cover | sed ${FLAGS} diff --git a/cl/phase1/cache/cache_test.go b/cl/phase1/cache/cache_test.go new file mode 100644 index 000000000..7f0010d7c --- /dev/null +++ b/cl/phase1/cache/cache_test.go @@ -0,0 +1,18 @@ +package cache_test + +import ( + "testing" + + "github.com/ledgerwatch/erigon/cl/cltypes/solid" + "github.com/ledgerwatch/erigon/cl/phase1/cache" + "github.com/stretchr/testify/require" +) + +func TestAttestationsCache(t *testing.T) { + input := []uint64{1} + a := &solid.AttestationData{} + cache.StoreAttestation(a, []uint64{1}) + output, valid := cache.LoadAttestatingIndicies(a) + require.True(t, valid) + require.Equal(t, input, output) +}