Files
prysm/beacon-chain/verification/initializer_test.go
Potuz 7794a77ae6 Use Head to validate sidecars when possible (#15977)
* Use Head to validate sidecars when possible

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>

* LazyHeadStateProvider that avoids service registry

* Remove extra file

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
2025-11-06 18:43:38 +00:00

28 lines
757 B
Go

package verification
import (
"bytes"
"testing"
"time"
"github.com/OffchainLabs/prysm/v7/beacon-chain/startup"
"github.com/OffchainLabs/prysm/v7/encoding/bytesutil"
"github.com/OffchainLabs/prysm/v7/testing/require"
)
func TestInitializerWaiter(t *testing.T) {
ctx := t.Context()
vr := bytesutil.ToBytes32([]byte{0, 1, 1, 2, 3, 5})
gen := time.Now()
c := startup.NewClock(gen, vr)
cs := startup.NewClockSynchronizer()
require.NoError(t, cs.SetClock(c))
w := NewInitializerWaiter(cs, &mockForkchoicer{}, &mockStateByRooter{}, &mockHeadStateProvider{})
ini, err := w.WaitForInitializer(ctx)
require.NoError(t, err)
csc, ok := ini.shared.sc.(*sigCache)
require.Equal(t, true, ok)
require.Equal(t, true, bytes.Equal(vr[:], csc.valRoot))
}