Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
cristaloleg committed Jun 25, 2024
1 parent bbd0e5d commit 9cb6944
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sync/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestSyncSimpleRequestingHead(t *testing.T) {
require.NoError(t, err)
require.Equal(t, exp.Height(), h101.Height())

localStore := newTestStore(t, ctx, head)
localStore := newTestStore(t, ctx, head, store.WithWriteBatchSize(10))
syncer, err := NewSyncer(
local.NewExchange(remoteStore),
localStore,
Expand Down Expand Up @@ -403,7 +403,9 @@ func (d *delayedGetter[H]) GetRangeByHeight(ctx context.Context, from H, to uint
}

// newTestStore creates initialized and started in memory header Store which is useful for testing.
func newTestStore(tb testing.TB, ctx context.Context, head *headertest.DummyHeader) header.Store[*headertest.DummyHeader] {
func newTestStore(tb testing.TB, ctx context.Context, head *headertest.DummyHeader,
opts ...store.Option,
) header.Store[*headertest.DummyHeader] {
ds := sync.MutexWrap(datastore.NewMapDatastore())
return store.NewTestStore(tb, ctx, ds, head)
return store.NewTestStore(tb, ctx, ds, head, opts...)
}

0 comments on commit 9cb6944

Please sign in to comment.