Fix TestSectorStore

This commit is contained in:
Łukasz Magiera 2019-11-07 00:50:37 +01:00
parent 74ea4d71c5
commit cfac6f3272

View File

@ -3,6 +3,7 @@ package sector
import ( import (
"context" "context"
"fmt" "fmt"
"github.com/filecoin-project/lotus/lib/padreader"
"io" "io"
"math/rand" "math/rand"
"testing" "testing"
@ -74,7 +75,9 @@ func TestSectorStore(t *testing.T) {
store := NewStore(sb, ds, tktFn) store := NewStore(sb, ds, tktFn)
pr := io.LimitReader(rand.New(rand.NewSource(17)), 300) pr := io.LimitReader(rand.New(rand.NewSource(17)), 300)
sid, err := store.AddPiece("a", 300, pr, 1) pr, n := padreader.New(pr, 300)
sid, err := store.AddPiece("a", n, pr, 1)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }