Skip to content

Commit

Permalink
test: last cosmetic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
renaynay committed Oct 11, 2023
1 parent 8eb3f56 commit 16969fd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions store/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)
}

Expand Down
2 changes: 1 addition & 1 deletion sync/sync_getter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
2 changes: 1 addition & 1 deletion sync/sync_head_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions sync/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit 16969fd

Please sign in to comment.