fix lint errors.
This commit is contained in:
parent
2e30891005
commit
932767d014
@ -65,7 +65,6 @@ func (m *lotusAccessor) IsUnsealed(ctx context.Context, pieceCid cid.Cid) (bool,
|
|||||||
return false, xerrors.Errorf("failed while waiting for accessor to start: %w", err)
|
return false, xerrors.Errorf("failed while waiting for accessor to start: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var pieceInfo piecestore.PieceInfo
|
var pieceInfo piecestore.PieceInfo
|
||||||
err = m.throttle.Do(ctx, func(ctx context.Context) (err error) {
|
err = m.throttle.Do(ctx, func(ctx context.Context) (err error) {
|
||||||
pieceInfo, err = m.pieceStore.GetPieceInfo(pieceCid)
|
pieceInfo, err = m.pieceStore.GetPieceInfo(pieceCid)
|
||||||
|
@ -45,9 +45,9 @@ func TestLotusAccessorFetchUnsealedPiece(t *testing.T) {
|
|||||||
name string
|
name string
|
||||||
deals []abi.SectorNumber
|
deals []abi.SectorNumber
|
||||||
fetchedData string
|
fetchedData string
|
||||||
isUnsealed bool
|
isUnsealed bool
|
||||||
|
|
||||||
expectErr bool
|
expectErr bool
|
||||||
}{{
|
}{{
|
||||||
// Expect error if there is no deal info for piece CID
|
// Expect error if there is no deal info for piece CID
|
||||||
name: "no deals",
|
name: "no deals",
|
||||||
@ -58,13 +58,13 @@ func TestLotusAccessorFetchUnsealedPiece(t *testing.T) {
|
|||||||
name: "prefer unsealed deal",
|
name: "prefer unsealed deal",
|
||||||
deals: []abi.SectorNumber{unsealedSectorID, sealedSectorID},
|
deals: []abi.SectorNumber{unsealedSectorID, sealedSectorID},
|
||||||
fetchedData: unsealedSectorData,
|
fetchedData: unsealedSectorData,
|
||||||
isUnsealed: true,
|
isUnsealed: true,
|
||||||
}, {
|
}, {
|
||||||
// Expect the API to unseal the data if there are no unsealed deals
|
// Expect the API to unseal the data if there are no unsealed deals
|
||||||
name: "unseal if necessary",
|
name: "unseal if necessary",
|
||||||
deals: []abi.SectorNumber{sealedSectorID},
|
deals: []abi.SectorNumber{sealedSectorID},
|
||||||
fetchedData: sealedSectorData,
|
fetchedData: sealedSectorData,
|
||||||
isUnsealed: false,
|
isUnsealed: false,
|
||||||
}}
|
}}
|
||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
@ -194,7 +194,7 @@ func getPieceStore(t *testing.T) piecestore.PieceStore {
|
|||||||
|
|
||||||
err = ps.Start(context.Background())
|
err = ps.Start(context.Background())
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
<- ch
|
<-ch
|
||||||
return ps
|
return ps
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ func (l *LotusMount) Stat(ctx context.Context) (mount.Stat, error) {
|
|||||||
return mount.Stat{
|
return mount.Stat{
|
||||||
Exists: true,
|
Exists: true,
|
||||||
Size: int64(size),
|
Size: int64(size),
|
||||||
Ready: isUnsealed,
|
Ready: isUnsealed,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,7 +92,8 @@ func TestWrapperBackground(t *testing.T) {
|
|||||||
w.dagStore = mock
|
w.dagStore = mock
|
||||||
|
|
||||||
// Start up the wrapper
|
// Start up the wrapper
|
||||||
w.Start(ctx)
|
err = w.Start(ctx)
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
// Expect GC to be called automatically
|
// Expect GC to be called automatically
|
||||||
tctx, cancel := context.WithTimeout(ctx, time.Second)
|
tctx, cancel := context.WithTimeout(ctx, time.Second)
|
||||||
|
Loading…
Reference in New Issue
Block a user