From 16969fd953b578e3488309609c929f1831e97d4f Mon Sep 17 00:00:00 2001 From: rene <41963722+renaynay@users.noreply.github.com> Date: Wed, 11 Oct 2023 15:08:47 +0200 Subject: [PATCH] test: last cosmetic changes --- store/store_test.go | 8 ++++---- sync/sync_getter_test.go | 2 +- sync/sync_head_test.go | 2 +- sync/sync_test.go | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/store/store_test.go b/store/store_test.go index fadbb75d..ac0fdb12 100644 --- a/store/store_test.go +++ b/store/store_test.go @@ -34,7 +34,7 @@ func TestStore(t *testing.T) { err = store.Append(ctx, in...) require.NoError(t, err) - out, err := store.getRangeByHeight(ctx, 2, 12) + out, err := store.GetRange(ctx, 2, 12) require.NoError(t, err) for i, h := range in { assert.Equal(t, h.Hash(), out[i].Hash()) @@ -75,7 +75,7 @@ func TestStore(t *testing.T) { assert.NotNil(t, out) assert.Len(t, out, 1) - out, err = store.getRangeByHeight(ctx, 2, 2) + out, err = store.GetRange(ctx, 2, 2) require.Error(t, err) assert.Nil(t, out) @@ -237,10 +237,10 @@ func TestStorePendingCacheMiss(t *testing.T) { err = store.Append(ctx, suite.GenDummyHeaders(50)...) require.NoError(t, err) - _, err = store.getRangeByHeight(ctx, 1, 101) + _, err = store.GetRange(ctx, 1, 101) require.NoError(t, err) - _, err = store.getRangeByHeight(ctx, 101, 151) + _, err = store.GetRange(ctx, 101, 151) require.NoError(t, err) } diff --git a/sync/sync_getter_test.go b/sync/sync_getter_test.go index 80fe99e6..16ddc196 100644 --- a/sync/sync_getter_test.go +++ b/sync/sync_getter_test.go @@ -67,6 +67,6 @@ func (f *fakeGetter[H]) GetByHeight(ctx context.Context, u uint64) (H, error) { panic("implement me") } -func (f *fakeGetter[H]) GetRangeByHeight(ctx context.Context, from H, amount uint64) ([]H, error) { +func (f *fakeGetter[H]) GetRangeByHeight(ctx context.Context, from H, to uint64) ([]H, error) { panic("implement me") } diff --git a/sync/sync_head_test.go b/sync/sync_head_test.go index 27fbbb4f..29b75ff4 100644 --- a/sync/sync_head_test.go +++ b/sync/sync_head_test.go @@ -138,7 +138,7 @@ func (t *wrappedGetter) GetByHeight(ctx context.Context, u uint64) (*headertest. func (t *wrappedGetter) GetRangeByHeight( ctx context.Context, from *headertest.DummyHeader, - amount uint64, + to uint64, ) ([]*headertest.DummyHeader, error) { //TODO implement me panic("implement me") diff --git a/sync/sync_test.go b/sync/sync_test.go index 07c44560..dc108cc5 100644 --- a/sync/sync_test.go +++ b/sync/sync_test.go @@ -388,10 +388,10 @@ type delayedGetter[H header.Header[H]] struct { header.Getter[H] } -func (d *delayedGetter[H]) GetRangeByHeight(ctx context.Context, from H, amount uint64) ([]H, error) { +func (d *delayedGetter[H]) GetRangeByHeight(ctx context.Context, from H, to uint64) ([]H, error) { select { case <-time.After(time.Millisecond * 100): - return d.Getter.GetRangeByHeight(ctx, from, amount) + return d.Getter.GetRangeByHeight(ctx, from, to) case <-ctx.Done(): return nil, ctx.Err() }