diff --git a/cmd/lotus-seal-worker/sealworker/rpc.go b/cmd/lotus-seal-worker/sealworker/rpc.go index 65755b846..f7e5ca90f 100644 --- a/cmd/lotus-seal-worker/sealworker/rpc.go +++ b/cmd/lotus-seal-worker/sealworker/rpc.go @@ -2,24 +2,25 @@ package sealworker import ( "context" - "github.com/filecoin-project/go-jsonrpc" - "github.com/filecoin-project/go-jsonrpc/auth" - "github.com/filecoin-project/lotus/lib/rpcenc" - "github.com/filecoin-project/lotus/metrics/proxy" - "github.com/gorilla/mux" "net/http" "sync/atomic" "github.com/google/uuid" + "github.com/gorilla/mux" "github.com/mitchellh/go-homedir" "golang.org/x/xerrors" + "github.com/filecoin-project/go-jsonrpc" + "github.com/filecoin-project/go-jsonrpc/auth" + "github.com/filecoin-project/lotus/api" apitypes "github.com/filecoin-project/lotus/api/types" "github.com/filecoin-project/lotus/build" sectorstorage "github.com/filecoin-project/lotus/extern/sector-storage" "github.com/filecoin-project/lotus/extern/sector-storage/stores" "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/lotus/lib/rpcenc" + "github.com/filecoin-project/lotus/metrics/proxy" ) func WorkerHandler(authv func(ctx context.Context, token string) ([]auth.Permission, error), remote http.HandlerFunc, a api.Worker, permissioned bool) http.Handler { diff --git a/extern/sector-storage/mock/mock.go b/extern/sector-storage/mock/mock.go index 7fef91a5e..2a14c9e72 100644 --- a/extern/sector-storage/mock/mock.go +++ b/extern/sector-storage/mock/mock.go @@ -5,7 +5,6 @@ import ( "context" "crypto/sha256" "fmt" - "github.com/filecoin-project/specs-actors/v6/actors/runtime/proof" "io" "io/ioutil" "math/rand" diff --git a/extern/sector-storage/sched_post.go b/extern/sector-storage/sched_post.go index 941b12e40..b04142059 100644 --- a/extern/sector-storage/sched_post.go +++ b/extern/sector-storage/sched_post.go @@ -6,11 +6,11 @@ import ( "sync" "time" + xerrors "golang.org/x/xerrors" + sealtasks "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" - - xerrors "golang.org/x/xerrors" ) type poStScheduler struct { diff --git a/extern/sector-storage/stores/local.go b/extern/sector-storage/stores/local.go index 3b270d8d3..eed7cf09e 100644 --- a/extern/sector-storage/stores/local.go +++ b/extern/sector-storage/stores/local.go @@ -3,7 +3,6 @@ package stores import ( "context" "encoding/json" - ffi "github.com/filecoin-project/filecoin-ffi" "io/ioutil" "math/bits" "math/rand" @@ -14,6 +13,7 @@ import ( "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/specs-storage/storage" diff --git a/extern/sector-storage/storiface/worker.go b/extern/sector-storage/storiface/worker.go index 1e9ea4bbc..d8f327e29 100644 --- a/extern/sector-storage/storiface/worker.go +++ b/extern/sector-storage/storiface/worker.go @@ -4,13 +4,13 @@ import ( "context" "errors" "fmt" - "github.com/filecoin-project/specs-actors/actors/runtime/proof" "time" "github.com/google/uuid" "github.com/ipfs/go-cid" "github.com/filecoin-project/go-state-types/abi" + "github.com/filecoin-project/specs-actors/actors/runtime/proof" "github.com/filecoin-project/specs-storage/storage" "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" diff --git a/itests/kit/ensemble.go b/itests/kit/ensemble.go index 88f94cf43..5219a027a 100644 --- a/itests/kit/ensemble.go +++ b/itests/kit/ensemble.go @@ -5,10 +5,6 @@ import ( "context" "crypto/rand" "fmt" - "github.com/filecoin-project/go-statestore" - "github.com/filecoin-project/lotus/cmd/lotus-seal-worker/sealworker" - "github.com/filecoin-project/lotus/extern/sector-storage/stores" - "github.com/ipfs/go-datastore/namespace" "io/ioutil" "net" "net/http" @@ -16,12 +12,22 @@ import ( "testing" "time" + "github.com/ipfs/go-datastore" + "github.com/ipfs/go-datastore/namespace" + libp2pcrypto "github.com/libp2p/go-libp2p-core/crypto" + "github.com/libp2p/go-libp2p-core/peer" + mocknet "github.com/libp2p/go-libp2p/p2p/net/mock" + "github.com/stretchr/testify/require" + "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/go-state-types/exitcode" "github.com/filecoin-project/go-state-types/network" + "github.com/filecoin-project/go-statestore" "github.com/filecoin-project/go-storedcounter" + miner2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/miner" + power2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/power" "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/api/v1api" @@ -36,10 +42,12 @@ import ( "github.com/filecoin-project/lotus/chain/stmgr" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/wallet" + "github.com/filecoin-project/lotus/cmd/lotus-seal-worker/sealworker" "github.com/filecoin-project/lotus/cmd/lotus-seed/seed" sectorstorage "github.com/filecoin-project/lotus/extern/sector-storage" "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" "github.com/filecoin-project/lotus/extern/sector-storage/mock" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" "github.com/filecoin-project/lotus/genesis" lotusminer "github.com/filecoin-project/lotus/miner" "github.com/filecoin-project/lotus/node" @@ -49,13 +57,6 @@ import ( testing2 "github.com/filecoin-project/lotus/node/modules/testing" "github.com/filecoin-project/lotus/node/repo" "github.com/filecoin-project/lotus/storage/mockstorage" - miner2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/miner" - power2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/power" - "github.com/ipfs/go-datastore" - libp2pcrypto "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/peer" - mocknet "github.com/libp2p/go-libp2p/p2p/net/mock" - "github.com/stretchr/testify/require" ) func init() { diff --git a/itests/kit/rpc.go b/itests/kit/rpc.go index 3b5cc878b..228809195 100644 --- a/itests/kit/rpc.go +++ b/itests/kit/rpc.go @@ -3,17 +3,19 @@ package kit import ( "context" "fmt" - "github.com/filecoin-project/lotus/cmd/lotus-seal-worker/sealworker" "net" "net/http" "net/http/httptest" "testing" - "github.com/filecoin-project/lotus/api/client" - "github.com/filecoin-project/lotus/node" + "github.com/stretchr/testify/require" + "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr/net" - "github.com/stretchr/testify/require" + + "github.com/filecoin-project/lotus/api/client" + "github.com/filecoin-project/lotus/cmd/lotus-seal-worker/sealworker" + "github.com/filecoin-project/lotus/node" ) func CreateRPCServer(t *testing.T, handler http.Handler, listener net.Listener) (*httptest.Server, multiaddr.Multiaddr) { diff --git a/itests/worker_test.go b/itests/worker_test.go index 7a124b5c1..70532c87d 100644 --- a/itests/worker_test.go +++ b/itests/worker_test.go @@ -2,17 +2,17 @@ package itests import ( "context" - "github.com/filecoin-project/lotus/build" - "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/storage" - logging "github.com/ipfs/go-log/v2" "testing" "time" + logging "github.com/ipfs/go-log/v2" "github.com/stretchr/testify/require" + "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" "github.com/filecoin-project/lotus/itests/kit" + "github.com/filecoin-project/lotus/storage" ) func TestWorkerPledge(t *testing.T) { diff --git a/node/repo/memrepo.go b/node/repo/memrepo.go index fab1a5cab..6c5bcacdf 100644 --- a/node/repo/memrepo.go +++ b/node/repo/memrepo.go @@ -3,13 +3,12 @@ package repo import ( "context" "encoding/json" - "github.com/filecoin-project/lotus/node/config" - "github.com/google/uuid" "io/ioutil" "os" "path/filepath" "sync" + "github.com/google/uuid" "github.com/ipfs/go-datastore" "github.com/ipfs/go-datastore/namespace" dssync "github.com/ipfs/go-datastore/sync" @@ -20,6 +19,7 @@ import ( "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" "github.com/filecoin-project/lotus/extern/sector-storage/stores" + "github.com/filecoin-project/lotus/node/config" ) type MemRepo struct { diff --git a/storage/wdpost_run_test.go b/storage/wdpost_run_test.go index 322d5966b..0afad3bd3 100644 --- a/storage/wdpost_run_test.go +++ b/storage/wdpost_run_test.go @@ -3,14 +3,8 @@ package storage import ( "bytes" "context" - "github.com/filecoin-project/specs-actors/v6/actors/runtime/proof" "testing" - proof7 "github.com/filecoin-project/specs-actors/v7/actors/runtime/proof" - - builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin" - miner5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/miner" - "github.com/stretchr/testify/require" "golang.org/x/xerrors" @@ -20,11 +14,21 @@ import ( "github.com/filecoin-project/go-bitfield" "github.com/filecoin-project/specs-storage/storage" + builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" + miner2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/miner" + proof2 "github.com/filecoin-project/specs-actors/v2/actors/runtime/proof" + tutils "github.com/filecoin-project/specs-actors/v2/support/testing" + builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin" + miner5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/miner" + "github.com/filecoin-project/specs-actors/v6/actors/runtime/proof" + proof7 "github.com/filecoin-project/specs-actors/v7/actors/runtime/proof" + "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/go-state-types/crypto" "github.com/filecoin-project/go-state-types/dline" "github.com/filecoin-project/go-state-types/network" + "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/actors/builtin/miner" @@ -32,10 +36,6 @@ import ( "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/extern/sector-storage/storiface" "github.com/filecoin-project/lotus/journal" - builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" - miner2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/miner" - proof2 "github.com/filecoin-project/specs-actors/v2/actors/runtime/proof" - tutils "github.com/filecoin-project/specs-actors/v2/support/testing" ) type mockStorageMinerAPI struct {