Fix mock ReadPiece
This commit is contained in:
parent
46ba2b6b4f
commit
dafdb7689c
8
extern/sector-storage/mock/mock.go
vendored
8
extern/sector-storage/mock/mock.go
vendored
@ -390,14 +390,16 @@ func (mgr *SectorMgr) ReadPiece(ctx context.Context, sector storage.SectorRef, o
|
|||||||
panic("implme")
|
panic("implme")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
br := bytes.NewReader(mgr.pieces[mgr.sectors[sector.ID].pieces[0]][:size])
|
||||||
|
|
||||||
return struct {
|
return struct {
|
||||||
io.ReadCloser
|
io.ReadCloser
|
||||||
io.Seeker
|
io.Seeker
|
||||||
io.ReaderAt
|
io.ReaderAt
|
||||||
}{
|
}{
|
||||||
ReadCloser: ioutil.NopCloser(bytes.NewReader(mgr.pieces[mgr.sectors[sector.ID].pieces[0]][:size])),
|
ReadCloser: ioutil.NopCloser(br),
|
||||||
Seeker: nil,
|
Seeker: br,
|
||||||
ReaderAt: nil,
|
ReaderAt: br,
|
||||||
}, false, nil
|
}, false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user