diff --git a/objstorage/test_utils.go b/objstorage/test_utils.go index ca225f534a..c0a287de31 100644 --- a/objstorage/test_utils.go +++ b/objstorage/test_utils.go @@ -57,7 +57,24 @@ func (f *MemObj) Size() int64 { return int64(f.buf.Len()) } +type memObjReadHandle MemObj + +var _ ReadHandle = (*memObjReadHandle)(nil) + +func (h *memObjReadHandle) ReadAt(ctx context.Context, p []byte, off int64) error { + return (*MemObj)(h).ReadAt(ctx, p, off) +} + +func (h *memObjReadHandle) Close() error { +} + +func (h *memObjReadHandle) SetupForCompaction() { +} + +func (h *memObjReadHandle) RecordCacheHit(ctx context.Context, offset, size int64) { +} + // NewReadHandle is part of the Readable interface. func (f *MemObj) NewReadHandle(readBeforeSize ReadBeforeSize) ReadHandle { - return &NoopReadHandle{readable: f} + return (*memObjReadHandle)(f) }