mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 21:08:10 -05:00
* 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>
28 lines
757 B
Go
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))
|
|
}
|