Fix lint errors

This commit is contained in:
Łukasz Magiera 2020-09-30 19:32:19 +02:00
parent 2d16af6ee6
commit e3ee4e4718
17 changed files with 38 additions and 39 deletions

View File

@ -12,6 +12,7 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
tbig "github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/messagepool/gasguess"
"github.com/filecoin-project/lotus/chain/types"

View File

@ -6,7 +6,6 @@ import (
"encoding/hex"
"encoding/json"
"fmt"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
"io/ioutil"
"os"
"path/filepath"
@ -31,6 +30,7 @@ import (
"github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper"
"github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper/basicfs"
"github.com/filecoin-project/lotus/extern/sector-storage/stores"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
"github.com/filecoin-project/lotus/genesis"
)

View File

@ -3,7 +3,6 @@ package main
import (
"encoding/json"
"fmt"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
"io/ioutil"
"os"
"path/filepath"
@ -20,11 +19,12 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/extern/sector-storage/fsutil"
"github.com/filecoin-project/lotus/extern/sector-storage/stores"
"github.com/filecoin-project/lotus/chain/types"
lcli "github.com/filecoin-project/lotus/cli"
"github.com/filecoin-project/lotus/extern/sector-storage/fsutil"
"github.com/filecoin-project/lotus/extern/sector-storage/stores"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
)
const metaFile = "sectorstore.json"

View File

@ -4,17 +4,15 @@ package ffiwrapper
import (
"context"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-state-types/abi"
ffi "github.com/filecoin-project/filecoin-ffi"
"go.opencensus.io/trace"
"golang.org/x/xerrors"
ffi "github.com/filecoin-project/filecoin-ffi"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
)
func (sb *Sealer) GenerateWinningPoSt(ctx context.Context, minerID abi.ActorID, sectorInfo []proof.SectorInfo, randomness abi.PoStRandomness) ([]proof.PoStProof, error) {

View File

@ -3,7 +3,6 @@ package sectorstorage
import (
"context"
"errors"
"github.com/filecoin-project/go-statestore"
"io"
"net/http"
"sync"
@ -15,6 +14,7 @@ import (
"golang.org/x/xerrors"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-statestore"
"github.com/filecoin-project/specs-storage/storage"
"github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper"

View File

@ -7,9 +7,10 @@ import (
"encoding/json"
"errors"
"fmt"
"golang.org/x/xerrors"
"os"
"golang.org/x/xerrors"
"github.com/filecoin-project/lotus/extern/sector-storage/sealtasks"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
)
@ -71,10 +72,6 @@ func (m *Manager) setupWorkTracker() {
for _, st := range ids {
wid := st.ID
if err := m.work.Get(wid).Get(&st); err != nil {
log.Errorf("getting work state for %s", wid)
continue
}
if os.Getenv("LOTUS_MINER_ABORT_UNFINISHED_WORK") == "1" {
st.Status = wsDone
@ -363,7 +360,7 @@ func (m *Manager) returnResult(callID storiface.CallID, r interface{}, serr stri
_, ok = m.results[wid]
if ok {
return xerrors.Errorf("result for call %v already reported")
return xerrors.Errorf("result for call %v already reported", wid)
}
m.results[wid] = res

View File

@ -265,7 +265,7 @@ func TestRestartManager(t *testing.T) {
cwg.Wait()
require.Error(t, perr)
m, lstor, _, _ = newTestMgr(ctx, t, ds)
m, _, _, _ = newTestMgr(ctx, t, ds)
tw.ret = m // simulate jsonrpc auto-reconnect
err = m.AddWorker(ctx, tw)
require.NoError(t, err)

View File

@ -2,13 +2,13 @@ package sectorstorage
import (
"context"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/extern/sector-storage/stores"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
)
type readonlyProvider struct {

View File

@ -2,7 +2,6 @@ package sectorstorage
import (
"context"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
"golang.org/x/xerrors"
@ -10,6 +9,7 @@ import (
"github.com/filecoin-project/lotus/extern/sector-storage/sealtasks"
"github.com/filecoin-project/lotus/extern/sector-storage/stores"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
)
type allocSelector struct {

View File

@ -2,7 +2,6 @@ package sectorstorage
import (
"context"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
"golang.org/x/xerrors"
@ -10,6 +9,7 @@ import (
"github.com/filecoin-project/lotus/extern/sector-storage/sealtasks"
"github.com/filecoin-project/lotus/extern/sector-storage/stores"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
)
type existingSelector struct {

View File

@ -1,8 +1,9 @@
package sectorstorage
import (
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
"time"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
)
func (m *Manager) WorkerStats() map[uint64]storiface.WorkerStats {

View File

@ -2,7 +2,6 @@ package stores
import (
"encoding/json"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
"io"
"net/http"
"os"
@ -11,6 +10,7 @@ import (
logging "github.com/ipfs/go-log/v2"
"golang.org/x/xerrors"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
"github.com/filecoin-project/lotus/extern/sector-storage/tarutil"
)

View File

@ -2,7 +2,6 @@ package stores
import (
"context"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
"net/url"
gopath "path"
"sort"
@ -11,10 +10,11 @@ import (
"golang.org/x/xerrors"
"github.com/filecoin-project/lotus/extern/sector-storage/fsutil"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/lotus/extern/sector-storage/fsutil"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
)
var HeartbeatInterval = 10 * time.Second

View File

@ -2,12 +2,13 @@ package stores
import (
"context"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
"sync"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
)
type sectorLock struct {

View File

@ -2,13 +2,14 @@ package stores
import (
"context"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
"testing"
"time"
"github.com/stretchr/testify/require"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
)
var aSector = abi.SectorID{

View File

@ -212,12 +212,12 @@ func (st *Local) Redeclare(ctx context.Context) error {
for id, p := range st.paths {
mb, err := ioutil.ReadFile(filepath.Join(p.local, MetaFile))
if err != nil {
return xerrors.Errorf("reading storage metadata for %s: %w", p, err)
return xerrors.Errorf("reading storage metadata for %s: %w", p.local, err)
}
var meta LocalStorageMeta
if err := json.Unmarshal(mb, &meta); err != nil {
return xerrors.Errorf("unmarshalling storage metadata for %s: %w", p, err)
return xerrors.Errorf("unmarshalling storage metadata for %s: %w", p.local, err)
}
fst, err := p.stat(st.localStorage)

View File

@ -3,13 +3,8 @@ package sealing
import (
"bytes"
"context"
"github.com/ipfs/go-cid"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
"github.com/filecoin-project/lotus/chain/actors/policy"
miner0 "github.com/filecoin-project/specs-actors/actors/builtin/miner"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-state-types/abi"
@ -18,7 +13,12 @@ import (
"github.com/filecoin-project/go-state-types/exitcode"
"github.com/filecoin-project/go-statemachine"
"github.com/filecoin-project/specs-actors/actors/builtin"
miner0 "github.com/filecoin-project/specs-actors/actors/builtin/miner"
"github.com/filecoin-project/specs-storage/storage"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
"github.com/filecoin-project/lotus/chain/actors/policy"
)
var DealSectorPriority = 1024