fix tests/lint

This commit is contained in:
Łukasz Magiera 2023-05-23 11:59:40 +02:00
parent 587c3fde58
commit 6c62e6d8e2
8 changed files with 13 additions and 12 deletions

View File

@ -653,7 +653,7 @@ fr32 padding is removed from the output.`,
return xerrors.Errorf("getting reader: %w", err)
}
rd, err := readStarter(0)
rd, err := readStarter(0, storiface.PaddedByteIndex(length))
if err != nil {
return xerrors.Errorf("starting reader: %w", err)
}

View File

@ -207,8 +207,8 @@ func TestRemoteGetAllocated(t *testing.T) {
pfhandler := mocks.NewMockPartialFileHandler(mockCtrl)
handler := &paths.FetchHandler{
lstore,
pfhandler,
Local: lstore,
PfHandler: pfhandler,
}
// run http server

View File

@ -2,9 +2,10 @@ package paths
import (
"context"
"github.com/filecoin-project/go-state-types/abi"
"io"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/storage/sealer/fsutil"
"github.com/filecoin-project/lotus/storage/sealer/partialfile"
"github.com/filecoin-project/lotus/storage/sealer/storiface"

View File

@ -5,7 +5,7 @@
package mocks
import (
os "os"
io "io"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
@ -84,10 +84,10 @@ func (mr *MockPartialFileHandlerMockRecorder) OpenPartialFile(arg0, arg1 interfa
}
// Reader mocks base method.
func (m *MockPartialFileHandler) Reader(arg0 *partialfile.PartialFile, arg1 storiface.PaddedByteIndex, arg2 abi.PaddedPieceSize) (*os.File, error) {
func (m *MockPartialFileHandler) Reader(arg0 *partialfile.PartialFile, arg1 storiface.PaddedByteIndex, arg2 abi.PaddedPieceSize) (io.Reader, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Reader", arg0, arg1, arg2)
ret0, _ := ret[0].(*os.File)
ret0, _ := ret[0].(io.Reader)
ret1, _ := ret[1].(error)
return ret0, ret1
}

View File

@ -477,7 +477,7 @@ func TestReader(t *testing.T) {
require.Nil(t, rdg)
require.Contains(t, err.Error(), tc.errStr)
} else {
rd, err = rdg(0)
rd, err = rdg(0, storiface.PaddedByteIndex(size))
require.Error(t, err)
require.Nil(t, rd)
require.Contains(t, err.Error(), tc.errStr)
@ -490,7 +490,7 @@ func TestReader(t *testing.T) {
require.Nil(t, rd)
} else {
require.NotNil(t, rdg)
rd, err := rdg(0)
rd, err := rdg(0, storiface.PaddedByteIndex(size))
require.NoError(t, err)
defer func() {

View File

@ -2,7 +2,6 @@ package partialfile
import (
"encoding/binary"
"github.com/filecoin-project/lotus/lib/readerutil"
"io"
"os"
"syscall"
@ -14,6 +13,7 @@ import (
rlepluslazy "github.com/filecoin-project/go-bitfield/rle"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/lib/readerutil"
"github.com/filecoin-project/lotus/storage/sealer/fsutil"
"github.com/filecoin-project/lotus/storage/sealer/storiface"
)

View File

@ -3,10 +3,10 @@ package sealer
import (
"bufio"
"context"
pool "github.com/libp2p/go-buffer-pool"
"io"
"github.com/ipfs/go-cid"
pool "github.com/libp2p/go-buffer-pool"
"golang.org/x/xerrors"
"github.com/filecoin-project/dagstore/mount"

View File

@ -6,13 +6,13 @@ import (
"io"
"sync"
lru "github.com/hashicorp/golang-lru/v2"
"github.com/ipfs/go-cid"
"go.opencensus.io/stats"
"golang.org/x/xerrors"
"github.com/filecoin-project/dagstore/mount"
"github.com/filecoin-project/go-state-types/abi"
lru "github.com/hashicorp/golang-lru/v2"
"github.com/filecoin-project/lotus/metrics"
)