Skip to content

Commit 1baacf9

Browse files
committed
updates
1 parent e270fab commit 1baacf9

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

pkg/sync/sync_service_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ package sync
33
import (
44
"context"
55
cryptoRand "crypto/rand"
6+
"errors"
67
"math/rand"
78
"path/filepath"
89
"sync/atomic"
910
"testing"
1011
"time"
1112

13+
"github.com/celestiaorg/go-header"
1214
"github.com/evstack/ev-node/pkg/config"
1315
genesispkg "github.com/evstack/ev-node/pkg/genesis"
1416
"github.com/evstack/ev-node/pkg/p2p"
@@ -248,6 +250,12 @@ func TestBackgroundRetryEventuallySucceeds(t *testing.T) {
248250
// Verify the syncer hasn't started yet (no peers to get headers from)
249251
require.False(t, svc.syncerStatus.isStarted(), "syncer should not be started without peers")
250252

253+
// Verify that querying the header store before syncer starts returns an empty store error
254+
_, headErr := svc.Store().Head(ctx)
255+
require.Error(t, headErr, "querying head before syncer starts should return an error")
256+
require.True(t, errors.Is(headErr, header.ErrNotFound) || errors.Is(headErr, header.ErrEmptyStore),
257+
"error should be ErrNotFound or ErrEmptyStore, got: %v", headErr)
258+
251259
// Create the genesis header that we'll add to the DA store
252260
headerConfig := types.HeaderConfig{
253261
Height: genesisDoc.InitialHeight,

0 commit comments

Comments
 (0)