mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 11:32:09 +00:00
5a66807989
* First take at updating everything to v5 * Patch gRPC gateway to use prysm v5 Fix patch * Update go ssz --------- Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
29 lines
754 B
Go
29 lines
754 B
Go
package verification
|
|
|
|
import (
|
|
"bytes"
|
|
"context"
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/prysmaticlabs/prysm/v5/beacon-chain/startup"
|
|
"github.com/prysmaticlabs/prysm/v5/encoding/bytesutil"
|
|
"github.com/prysmaticlabs/prysm/v5/testing/require"
|
|
)
|
|
|
|
func TestInitializerWaiter(t *testing.T) {
|
|
ctx := context.Background()
|
|
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{})
|
|
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))
|
|
}
|