From 86b0b066c2bc836dc38f76da31ab3c5c6a92dad7 Mon Sep 17 00:00:00 2001 From: laser Date: Fri, 13 Mar 2020 15:38:08 -0700 Subject: [PATCH 1/4] use multi-import grouping --- filestore/mocks/File.go | 7 ++- filestore/mocks/FileStore.go | 7 ++- pieceio/mocks/CarIO.go | 19 ++++--- pieceio/mocks/PieceIO.go | 19 ++++--- pieceio/mocks/PreparedCar.go | 7 ++- pieceio/mocks/ReadStore.go | 9 ++-- pieceio/mocks/SectorCalculator.go | 7 ++- pieceio/mocks/WriteStore.go | 6 ++- pieceio/types.go | 3 +- piecestore/piecestore_test.go | 3 +- retrievalmarket/discovery/discovery.go | 3 +- .../blockunsealing/blockunsealing_test.go | 3 +- retrievalmarket/impl/client.go | 5 +- retrievalmarket/impl/client_test.go | 3 +- .../impl/clientstates/client_fsm.go | 3 +- .../impl/clientstates/client_states.go | 5 +- .../impl/clientstates/client_states_test.go | 9 ++-- retrievalmarket/impl/integration_test.go | 7 +-- retrievalmarket/impl/provider.go | 5 +- retrievalmarket/impl/provider_test.go | 3 +- .../impl/providerstates/provider_fsm.go | 3 +- .../impl/providerstates/provider_states.go | 5 +- .../providerstates/provider_states_test.go | 9 ++-- .../testnodes/test_retrieval_client_node.go | 3 +- .../testnodes/test_retrieval_provider_node.go | 3 +- retrievalmarket/network/libp2p_impl_test.go | 3 +- retrievalmarket/network/query_stream.go | 1 + shared_testutil/mocknet.go | 3 +- shared_testutil/test_piecestore.go | 5 +- shared_testutil/test_types.go | 7 +-- storagemarket/impl/client.go | 8 +-- storagemarket/impl/clientstates/client_fsm.go | 3 +- .../impl/clientstates/client_states.go | 7 +-- .../impl/clientstates/cliest_states_test.go | 9 ++-- storagemarket/impl/clientutils/clientutils.go | 5 +- .../impl/clientutils/clientutils_test.go | 54 +++++++++---------- storagemarket/impl/connmanager/connmanager.go | 3 +- .../impl/connmanager/connmanager_test.go | 5 +- storagemarket/impl/provider.go | 5 +- .../impl/providerstates/provider_fsm.go | 5 +- .../impl/providerstates/provider_states.go | 5 +- .../providerstates/provider_states_test.go | 9 ++-- .../impl/providerutils/providerutils.go | 5 +- .../impl/providerutils/providerutils_test.go | 7 +-- .../client_request_validator.go | 3 +- .../provider_request_validator.go | 3 +- .../request_validation_test.go | 5 +- storagemarket/impl/storedask/storedask.go | 3 +- .../impl/storedask/storedask_test.go | 5 +- storagemarket/integration_test.go | 5 +- storagemarket/network/libp2p_impl.go | 3 +- storagemarket/network/types.go | 3 +- storagemarket/network/types_cbor_gen.go | 3 +- storagemarket/testnodes/testnodes.go | 5 +- storagemarket/types.go | 3 +- storagemarket/types_cbor_gen.go | 3 +- storedcounter/storedcounter_test.go | 8 ++- 57 files changed, 217 insertions(+), 140 deletions(-) diff --git a/filestore/mocks/File.go b/filestore/mocks/File.go index 20a36a63..dfeac9ee 100644 --- a/filestore/mocks/File.go +++ b/filestore/mocks/File.go @@ -2,8 +2,11 @@ package mocks -import filestore "github.com/filecoin-project/go-fil-markets/filestore" -import mock "github.com/stretchr/testify/mock" +import ( + mock "github.com/stretchr/testify/mock" + + filestore "github.com/filecoin-project/go-fil-markets/filestore" +) // File is an autogenerated mock type for the File type type File struct { diff --git a/filestore/mocks/FileStore.go b/filestore/mocks/FileStore.go index 44efeb9a..de3d6680 100644 --- a/filestore/mocks/FileStore.go +++ b/filestore/mocks/FileStore.go @@ -2,8 +2,11 @@ package mocks -import filestore "github.com/filecoin-project/go-fil-markets/filestore" -import mock "github.com/stretchr/testify/mock" +import ( + mock "github.com/stretchr/testify/mock" + + filestore "github.com/filecoin-project/go-fil-markets/filestore" +) // FileStore is an autogenerated mock type for the FileStore type type FileStore struct { diff --git a/pieceio/mocks/CarIO.go b/pieceio/mocks/CarIO.go index f354576f..5997d1c0 100644 --- a/pieceio/mocks/CarIO.go +++ b/pieceio/mocks/CarIO.go @@ -2,12 +2,19 @@ package mocks -import cid "github.com/ipfs/go-cid" -import context "context" -import io "io" -import ipld "github.com/ipld/go-ipld-prime" -import mock "github.com/stretchr/testify/mock" -import pieceio "github.com/filecoin-project/go-fil-markets/pieceio" +import ( + context "context" + + cid "github.com/ipfs/go-cid" + + io "io" + + ipld "github.com/ipld/go-ipld-prime" + + mock "github.com/stretchr/testify/mock" + + pieceio "github.com/filecoin-project/go-fil-markets/pieceio" +) // CarIO is an autogenerated mock type for the CarIO type type CarIO struct { diff --git a/pieceio/mocks/PieceIO.go b/pieceio/mocks/PieceIO.go index 2343e323..8b087d20 100644 --- a/pieceio/mocks/PieceIO.go +++ b/pieceio/mocks/PieceIO.go @@ -2,12 +2,19 @@ package mocks -import cid "github.com/ipfs/go-cid" -import filestore "github.com/filecoin-project/go-fil-markets/filestore" -import io "io" -import ipld "github.com/ipld/go-ipld-prime" -import mock "github.com/stretchr/testify/mock" -import pieceio "github.com/filecoin-project/go-fil-markets/pieceio" +import ( + io "io" + + cid "github.com/ipfs/go-cid" + + filestore "github.com/filecoin-project/go-fil-markets/filestore" + + ipld "github.com/ipld/go-ipld-prime" + + mock "github.com/stretchr/testify/mock" + + pieceio "github.com/filecoin-project/go-fil-markets/pieceio" +) // PieceIO is an autogenerated mock type for the PieceIO type type PieceIO struct { diff --git a/pieceio/mocks/PreparedCar.go b/pieceio/mocks/PreparedCar.go index 5b6573cd..0ad17eab 100644 --- a/pieceio/mocks/PreparedCar.go +++ b/pieceio/mocks/PreparedCar.go @@ -2,8 +2,11 @@ package mocks -import io "io" -import mock "github.com/stretchr/testify/mock" +import ( + io "io" + + mock "github.com/stretchr/testify/mock" +) // PreparedCar is an autogenerated mock type for the PreparedCar type type PreparedCar struct { diff --git a/pieceio/mocks/ReadStore.go b/pieceio/mocks/ReadStore.go index 6f4c596b..19053142 100644 --- a/pieceio/mocks/ReadStore.go +++ b/pieceio/mocks/ReadStore.go @@ -2,9 +2,12 @@ package mocks -import blocks "github.com/ipfs/go-block-format" -import cid "github.com/ipfs/go-cid" -import mock "github.com/stretchr/testify/mock" +import ( + blocks "github.com/ipfs/go-block-format" + cid "github.com/ipfs/go-cid" + + mock "github.com/stretchr/testify/mock" +) // ReadStore is an autogenerated mock type for the ReadStore type type ReadStore struct { diff --git a/pieceio/mocks/SectorCalculator.go b/pieceio/mocks/SectorCalculator.go index 820f7f0a..43f0923f 100644 --- a/pieceio/mocks/SectorCalculator.go +++ b/pieceio/mocks/SectorCalculator.go @@ -2,8 +2,11 @@ package mocks -import io "io" -import mock "github.com/stretchr/testify/mock" +import ( + io "io" + + mock "github.com/stretchr/testify/mock" +) // SectorCalculator is an autogenerated mock type for the SectorCalculator type type SectorCalculator struct { diff --git a/pieceio/mocks/WriteStore.go b/pieceio/mocks/WriteStore.go index 6808f0ac..b186eef3 100644 --- a/pieceio/mocks/WriteStore.go +++ b/pieceio/mocks/WriteStore.go @@ -2,8 +2,10 @@ package mocks -import blocks "github.com/ipfs/go-block-format" -import mock "github.com/stretchr/testify/mock" +import ( + blocks "github.com/ipfs/go-block-format" + mock "github.com/stretchr/testify/mock" +) // WriteStore is an autogenerated mock type for the WriteStore type type WriteStore struct { diff --git a/pieceio/types.go b/pieceio/types.go index 4c345295..d4bf696d 100644 --- a/pieceio/types.go +++ b/pieceio/types.go @@ -3,9 +3,10 @@ package pieceio import ( "io" - "github.com/filecoin-project/go-fil-markets/filestore" "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/go-fil-markets/filestore" + blocks "github.com/ipfs/go-block-format" "github.com/ipfs/go-cid" "github.com/ipld/go-ipld-prime" diff --git a/piecestore/piecestore_test.go b/piecestore/piecestore_test.go index 53d80979..0961be29 100644 --- a/piecestore/piecestore_test.go +++ b/piecestore/piecestore_test.go @@ -8,9 +8,10 @@ import ( "github.com/ipfs/go-datastore" "github.com/stretchr/testify/assert" + "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/go-fil-markets/piecestore" "github.com/filecoin-project/go-fil-markets/shared_testutil" - "github.com/filecoin-project/specs-actors/actors/abi" ) func TestStorePieceInfo(t *testing.T) { diff --git a/retrievalmarket/discovery/discovery.go b/retrievalmarket/discovery/discovery.go index 86771eeb..824a0a6c 100644 --- a/retrievalmarket/discovery/discovery.go +++ b/retrievalmarket/discovery/discovery.go @@ -1,8 +1,9 @@ package discovery import ( - "github.com/filecoin-project/go-fil-markets/retrievalmarket" cbor "github.com/ipfs/go-ipld-cbor" + + "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) func init() { diff --git a/retrievalmarket/impl/blockunsealing/blockunsealing_test.go b/retrievalmarket/impl/blockunsealing/blockunsealing_test.go index 42262fcb..b93ac20b 100644 --- a/retrievalmarket/impl/blockunsealing/blockunsealing_test.go +++ b/retrievalmarket/impl/blockunsealing/blockunsealing_test.go @@ -17,12 +17,13 @@ import ( "github.com/ipld/go-ipld-prime/traversal/selector/builder" "github.com/stretchr/testify/require" + "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/go-fil-markets/pieceio/cario" "github.com/filecoin-project/go-fil-markets/piecestore" "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/blockunsealing" "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/testnodes" tut "github.com/filecoin-project/go-fil-markets/shared_testutil" - "github.com/filecoin-project/specs-actors/actors/abi" ) func TestNewLoaderWithUnsealing(t *testing.T) { diff --git a/retrievalmarket/impl/client.go b/retrievalmarket/impl/client.go index b78f915f..0f934735 100644 --- a/retrievalmarket/impl/client.go +++ b/retrievalmarket/impl/client.go @@ -16,13 +16,14 @@ import ( "golang.org/x/xerrors" "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-statemachine/fsm" + "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/go-fil-markets/retrievalmarket" "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/blockio" "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/clientstates" rmnet "github.com/filecoin-project/go-fil-markets/retrievalmarket/network" "github.com/filecoin-project/go-fil-markets/storedcounter" - "github.com/filecoin-project/go-statemachine/fsm" - "github.com/filecoin-project/specs-actors/actors/abi" ) var log = logging.Logger("retrieval") diff --git a/retrievalmarket/impl/client_test.go b/retrievalmarket/impl/client_test.go index f48a49ee..9095944d 100644 --- a/retrievalmarket/impl/client_test.go +++ b/retrievalmarket/impl/client_test.go @@ -14,6 +14,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/go-fil-markets/retrievalmarket" retrievalimpl "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl" "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/testnodes" @@ -21,7 +23,6 @@ import ( rmnet "github.com/filecoin-project/go-fil-markets/retrievalmarket/network" tut "github.com/filecoin-project/go-fil-markets/shared_testutil" "github.com/filecoin-project/go-fil-markets/storedcounter" - "github.com/filecoin-project/specs-actors/actors/abi" ) func TestClient_Query(t *testing.T) { diff --git a/retrievalmarket/impl/clientstates/client_fsm.go b/retrievalmarket/impl/clientstates/client_fsm.go index def08e7e..11e9e3b9 100644 --- a/retrievalmarket/impl/clientstates/client_fsm.go +++ b/retrievalmarket/impl/clientstates/client_fsm.go @@ -4,11 +4,12 @@ import ( "fmt" "github.com/filecoin-project/go-address" - rm "github.com/filecoin-project/go-fil-markets/retrievalmarket" "github.com/filecoin-project/go-statemachine/fsm" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" "golang.org/x/xerrors" + + rm "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) func recordPaymentOwed(deal *rm.ClientDealState, totalProcessed uint64, paymentOwed abi.TokenAmount) error { diff --git a/retrievalmarket/impl/clientstates/client_states.go b/retrievalmarket/impl/clientstates/client_states.go index d5c6dd0f..7f4867f5 100644 --- a/retrievalmarket/impl/clientstates/client_states.go +++ b/retrievalmarket/impl/clientstates/client_states.go @@ -3,11 +3,12 @@ package clientstates import ( "context" - rm "github.com/filecoin-project/go-fil-markets/retrievalmarket" - rmnet "github.com/filecoin-project/go-fil-markets/retrievalmarket/network" "github.com/filecoin-project/go-statemachine/fsm" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" + + rm "github.com/filecoin-project/go-fil-markets/retrievalmarket" + rmnet "github.com/filecoin-project/go-fil-markets/retrievalmarket/network" ) // ClientDealEnvironment is a bridge to the environment a client deal is executing in diff --git a/retrievalmarket/impl/clientstates/client_states_test.go b/retrievalmarket/impl/clientstates/client_states_test.go index 36b05324..7539ca46 100644 --- a/retrievalmarket/impl/clientstates/client_states_test.go +++ b/retrievalmarket/impl/clientstates/client_states_test.go @@ -13,15 +13,16 @@ import ( "github.com/stretchr/testify/require" "github.com/filecoin-project/go-address" + fsmtest "github.com/filecoin-project/go-statemachine/fsm/testutil" + "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/specs-actors/actors/abi/big" + "github.com/filecoin-project/specs-actors/actors/builtin/paych" + "github.com/filecoin-project/go-fil-markets/retrievalmarket" clientstates "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/clientstates" "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/testnodes" rmnet "github.com/filecoin-project/go-fil-markets/retrievalmarket/network" testnet "github.com/filecoin-project/go-fil-markets/shared_testutil" - fsmtest "github.com/filecoin-project/go-statemachine/fsm/testutil" - "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/specs-actors/actors/abi/big" - "github.com/filecoin-project/specs-actors/actors/builtin/paych" ) type consumeBlockResponse struct { diff --git a/retrievalmarket/impl/integration_test.go b/retrievalmarket/impl/integration_test.go index fca92fbe..055d0878 100644 --- a/retrievalmarket/impl/integration_test.go +++ b/retrievalmarket/impl/integration_test.go @@ -13,6 +13,10 @@ import ( "github.com/filecoin-project/go-address" + "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/specs-actors/actors/abi/big" + "github.com/filecoin-project/specs-actors/actors/builtin/paych" + "github.com/filecoin-project/go-fil-markets/pieceio/cario" "github.com/filecoin-project/go-fil-markets/piecestore" "github.com/filecoin-project/go-fil-markets/retrievalmarket" @@ -20,9 +24,6 @@ import ( "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/testnodes" rmnet "github.com/filecoin-project/go-fil-markets/retrievalmarket/network" tut "github.com/filecoin-project/go-fil-markets/shared_testutil" - "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/specs-actors/actors/abi/big" - "github.com/filecoin-project/specs-actors/actors/builtin/paych" ) func TestClientCanMakeQueryToProvider(t *testing.T) { diff --git a/retrievalmarket/impl/provider.go b/retrievalmarket/impl/provider.go index cf87388e..2a9cc200 100644 --- a/retrievalmarket/impl/provider.go +++ b/retrievalmarket/impl/provider.go @@ -14,6 +14,9 @@ import ( "golang.org/x/xerrors" "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-statemachine/fsm" + "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/go-fil-markets/pieceio/cario" "github.com/filecoin-project/go-fil-markets/piecestore" "github.com/filecoin-project/go-fil-markets/retrievalmarket" @@ -21,8 +24,6 @@ import ( "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/blockunsealing" "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/providerstates" rmnet "github.com/filecoin-project/go-fil-markets/retrievalmarket/network" - "github.com/filecoin-project/go-statemachine/fsm" - "github.com/filecoin-project/specs-actors/actors/abi" ) // ProviderDsPrefix is the datastore for the provider key diff --git a/retrievalmarket/impl/provider_test.go b/retrievalmarket/impl/provider_test.go index a94d4a53..72141045 100644 --- a/retrievalmarket/impl/provider_test.go +++ b/retrievalmarket/impl/provider_test.go @@ -10,13 +10,14 @@ import ( "github.com/libp2p/go-libp2p-core/peer" "github.com/stretchr/testify/require" + "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/go-fil-markets/piecestore" "github.com/filecoin-project/go-fil-markets/retrievalmarket" retrievalimpl "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl" "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/testnodes" "github.com/filecoin-project/go-fil-markets/retrievalmarket/network" tut "github.com/filecoin-project/go-fil-markets/shared_testutil" - "github.com/filecoin-project/specs-actors/actors/abi" ) func TestHandleQueryStream(t *testing.T) { diff --git a/retrievalmarket/impl/providerstates/provider_fsm.go b/retrievalmarket/impl/providerstates/provider_fsm.go index 7c6504ce..9d9ef7e4 100644 --- a/retrievalmarket/impl/providerstates/provider_fsm.go +++ b/retrievalmarket/impl/providerstates/provider_fsm.go @@ -3,11 +3,12 @@ package providerstates import ( "fmt" - rm "github.com/filecoin-project/go-fil-markets/retrievalmarket" "github.com/filecoin-project/go-statemachine/fsm" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" "golang.org/x/xerrors" + + rm "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) func recordError(deal *rm.ProviderDealState, err error) error { diff --git a/retrievalmarket/impl/providerstates/provider_states.go b/retrievalmarket/impl/providerstates/provider_states.go index 98a4be18..9c702001 100644 --- a/retrievalmarket/impl/providerstates/provider_states.go +++ b/retrievalmarket/impl/providerstates/provider_states.go @@ -6,11 +6,12 @@ import ( "github.com/ipfs/go-cid" "golang.org/x/xerrors" - rm "github.com/filecoin-project/go-fil-markets/retrievalmarket" - rmnet "github.com/filecoin-project/go-fil-markets/retrievalmarket/network" "github.com/filecoin-project/go-statemachine/fsm" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" + + rm "github.com/filecoin-project/go-fil-markets/retrievalmarket" + rmnet "github.com/filecoin-project/go-fil-markets/retrievalmarket/network" ) // ProviderDealEnvironment is a bridge to the environment a provider deal is executing in diff --git a/retrievalmarket/impl/providerstates/provider_states_test.go b/retrievalmarket/impl/providerstates/provider_states_test.go index 4a807560..eed4ef4d 100644 --- a/retrievalmarket/impl/providerstates/provider_states_test.go +++ b/retrievalmarket/impl/providerstates/provider_states_test.go @@ -11,16 +11,17 @@ import ( "github.com/stretchr/testify/require" "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-statemachine/fsm" + fsmtest "github.com/filecoin-project/go-statemachine/fsm/testutil" + "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/specs-actors/actors/abi/big" + "github.com/filecoin-project/go-fil-markets/retrievalmarket" rm "github.com/filecoin-project/go-fil-markets/retrievalmarket" "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/providerstates" "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/testnodes" rmnet "github.com/filecoin-project/go-fil-markets/retrievalmarket/network" testnet "github.com/filecoin-project/go-fil-markets/shared_testutil" - "github.com/filecoin-project/go-statemachine/fsm" - fsmtest "github.com/filecoin-project/go-statemachine/fsm/testutil" - "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/specs-actors/actors/abi/big" ) func TestReceiveDeal(t *testing.T) { diff --git a/retrievalmarket/impl/testnodes/test_retrieval_client_node.go b/retrievalmarket/impl/testnodes/test_retrieval_client_node.go index a2c4aee8..084bc604 100644 --- a/retrievalmarket/impl/testnodes/test_retrieval_client_node.go +++ b/retrievalmarket/impl/testnodes/test_retrieval_client_node.go @@ -4,9 +4,10 @@ import ( "context" "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/builtin/paych" + + "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) // TestRetrievalClientNode is a node adapter for a retrieval client whose responses diff --git a/retrievalmarket/impl/testnodes/test_retrieval_provider_node.go b/retrievalmarket/impl/testnodes/test_retrieval_provider_node.go index 22523605..3e8404b5 100644 --- a/retrievalmarket/impl/testnodes/test_retrieval_provider_node.go +++ b/retrievalmarket/impl/testnodes/test_retrieval_provider_node.go @@ -12,9 +12,10 @@ import ( "github.com/stretchr/testify/require" "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/builtin/paych" + + "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) type expectedVoucherKey struct { diff --git a/retrievalmarket/network/libp2p_impl_test.go b/retrievalmarket/network/libp2p_impl_test.go index a6af94a0..be24eb1d 100644 --- a/retrievalmarket/network/libp2p_impl_test.go +++ b/retrievalmarket/network/libp2p_impl_test.go @@ -12,10 +12,11 @@ import ( "github.com/stretchr/testify/require" "github.com/filecoin-project/go-address" + "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/go-fil-markets/retrievalmarket" "github.com/filecoin-project/go-fil-markets/retrievalmarket/network" "github.com/filecoin-project/go-fil-markets/shared_testutil" - "github.com/filecoin-project/specs-actors/actors/abi" ) type testReceiver struct { diff --git a/retrievalmarket/network/query_stream.go b/retrievalmarket/network/query_stream.go index 3218d999..47d843d9 100644 --- a/retrievalmarket/network/query_stream.go +++ b/retrievalmarket/network/query_stream.go @@ -7,6 +7,7 @@ import ( "github.com/libp2p/go-libp2p-core/peer" cborutil "github.com/filecoin-project/go-cbor-util" + "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) diff --git a/shared_testutil/mocknet.go b/shared_testutil/mocknet.go index 29e6a595..6396bf6a 100644 --- a/shared_testutil/mocknet.go +++ b/shared_testutil/mocknet.go @@ -9,7 +9,6 @@ import ( "path/filepath" "testing" - "github.com/filecoin-project/go-fil-markets/storedcounter" blocks "github.com/ipfs/go-block-format" "github.com/ipfs/go-blockservice" "github.com/ipfs/go-datastore" @@ -36,6 +35,8 @@ import ( mocknet "github.com/libp2p/go-libp2p/p2p/net/mock" "github.com/stretchr/testify/require" "golang.org/x/net/context" + + "github.com/filecoin-project/go-fil-markets/storedcounter" ) type Libp2pTestData struct { diff --git a/shared_testutil/test_piecestore.go b/shared_testutil/test_piecestore.go index ecb0e7c6..6a5b488b 100644 --- a/shared_testutil/test_piecestore.go +++ b/shared_testutil/test_piecestore.go @@ -4,10 +4,11 @@ import ( "errors" "testing" - "github.com/filecoin-project/go-fil-markets/piecestore" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" "github.com/ipfs/go-cid" "github.com/stretchr/testify/require" + + "github.com/filecoin-project/go-fil-markets/piecestore" + "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) // TestPieceStore is piecestore who's query results are mocked diff --git a/shared_testutil/test_types.go b/shared_testutil/test_types.go index e47e533b..906adb29 100644 --- a/shared_testutil/test_types.go +++ b/shared_testutil/test_types.go @@ -12,12 +12,13 @@ import ( "github.com/libp2p/go-libp2p-core/test" "github.com/stretchr/testify/require" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-fil-markets/storagemarket" - smnet "github.com/filecoin-project/go-fil-markets/storagemarket/network" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/builtin/paych" "github.com/filecoin-project/specs-actors/actors/crypto" + + "github.com/filecoin-project/go-fil-markets/retrievalmarket" + "github.com/filecoin-project/go-fil-markets/storagemarket" + smnet "github.com/filecoin-project/go-fil-markets/storagemarket/network" ) // MakeTestSignedVoucher generates a random SignedVoucher that has all non-zero fields diff --git a/storagemarket/impl/client.go b/storagemarket/impl/client.go index 627c31a7..e9a54f31 100644 --- a/storagemarket/impl/client.go +++ b/storagemarket/impl/client.go @@ -6,9 +6,10 @@ import ( "github.com/filecoin-project/go-fil-markets/storagemarket/impl/clientutils" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/connmanager" - "github.com/filecoin-project/go-fil-markets/storagemarket/network" "github.com/filecoin-project/go-statemachine/fsm" + "github.com/filecoin-project/go-fil-markets/storagemarket/network" + cborutil "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/specs-actors/actors/abi/big" "github.com/ipfs/go-cid" @@ -19,6 +20,9 @@ import ( "github.com/filecoin-project/go-address" datatransfer "github.com/filecoin-project/go-data-transfer" + "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/specs-actors/actors/builtin/market" + "github.com/filecoin-project/go-fil-markets/filestore" "github.com/filecoin-project/go-fil-markets/pieceio" "github.com/filecoin-project/go-fil-markets/pieceio/cario" @@ -26,8 +30,6 @@ import ( "github.com/filecoin-project/go-fil-markets/retrievalmarket/discovery" "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/clientstates" - "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/specs-actors/actors/builtin/market" ) var log = logging.Logger("storagemarket_impl") diff --git a/storagemarket/impl/clientstates/client_fsm.go b/storagemarket/impl/clientstates/client_fsm.go index 86821d79..bb1d2912 100644 --- a/storagemarket/impl/clientstates/client_fsm.go +++ b/storagemarket/impl/clientstates/client_fsm.go @@ -1,11 +1,12 @@ package clientstates import ( - "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-statemachine/fsm" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/ipfs/go-cid" "golang.org/x/xerrors" + + "github.com/filecoin-project/go-fil-markets/storagemarket" ) // ClientEvents are the events that can happen in a storage client diff --git a/storagemarket/impl/clientstates/client_states.go b/storagemarket/impl/clientstates/client_states.go index 99770b2c..6effe6de 100644 --- a/storagemarket/impl/clientstates/client_states.go +++ b/storagemarket/impl/clientstates/client_states.go @@ -1,13 +1,14 @@ package clientstates import ( + "github.com/filecoin-project/go-statemachine/fsm" + "github.com/ipfs/go-cid" + logging "github.com/ipfs/go-log/v2" + "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/clientutils" "github.com/filecoin-project/go-fil-markets/storagemarket/network" smnet "github.com/filecoin-project/go-fil-markets/storagemarket/network" - "github.com/filecoin-project/go-statemachine/fsm" - "github.com/ipfs/go-cid" - logging "github.com/ipfs/go-log/v2" ) var log = logging.Logger("storagemarket_impl") diff --git a/storagemarket/impl/clientstates/cliest_states_test.go b/storagemarket/impl/clientstates/cliest_states_test.go index cf765869..b33fafe3 100644 --- a/storagemarket/impl/clientstates/cliest_states_test.go +++ b/storagemarket/impl/clientstates/cliest_states_test.go @@ -10,15 +10,16 @@ import ( "github.com/stretchr/testify/require" cborutil "github.com/filecoin-project/go-cbor-util" + "github.com/filecoin-project/go-statemachine/fsm" + fsmtest "github.com/filecoin-project/go-statemachine/fsm/testutil" + "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/specs-actors/actors/builtin/market" + tut "github.com/filecoin-project/go-fil-markets/shared_testutil" "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/clientstates" smnet "github.com/filecoin-project/go-fil-markets/storagemarket/network" "github.com/filecoin-project/go-fil-markets/storagemarket/testnodes" - "github.com/filecoin-project/go-statemachine/fsm" - fsmtest "github.com/filecoin-project/go-statemachine/fsm/testutil" - "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/specs-actors/actors/builtin/market" ) func TestEnsureFunds(t *testing.T) { diff --git a/storagemarket/impl/clientutils/clientutils.go b/storagemarket/impl/clientutils/clientutils.go index eb922a1d..af2bc48c 100644 --- a/storagemarket/impl/clientutils/clientutils.go +++ b/storagemarket/impl/clientutils/clientutils.go @@ -11,11 +11,12 @@ import ( "github.com/filecoin-project/go-address" cborutil "github.com/filecoin-project/go-cbor-util" + "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/specs-actors/actors/crypto" + "github.com/filecoin-project/go-fil-markets/pieceio" "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-fil-markets/storagemarket/network" - "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/specs-actors/actors/crypto" ) // CommP calculates the commP for a given dataref diff --git a/storagemarket/impl/clientutils/clientutils_test.go b/storagemarket/impl/clientutils/clientutils_test.go index 04d81d9b..7ce0dfc6 100644 --- a/storagemarket/impl/clientutils/clientutils_test.go +++ b/storagemarket/impl/clientutils/clientutils_test.go @@ -1,7 +1,6 @@ package clientutils_test import ( - "github.com/filecoin-project/specs-actors/actors/crypto" "context" "errors" "fmt" @@ -9,6 +8,8 @@ import ( "math/rand" "testing" + "github.com/filecoin-project/specs-actors/actors/crypto" + "github.com/ipfs/go-cid" ipld "github.com/ipld/go-ipld-prime" ipldfree "github.com/ipld/go-ipld-prime/impl/free" @@ -17,24 +18,24 @@ import ( "github.com/stretchr/testify/require" "github.com/filecoin-project/go-address" + "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/go-fil-markets/shared_testutil" "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/clientutils" - "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/go-fil-markets/storagemarket/network" - ) -func TestCommP(t * testing.T) { +func TestCommP(t *testing.T) { ctx := context.Background() proofType := abi.RegisteredProof_StackedDRG2KiBPoSt - t.Run("when PieceCID is present on data ref", func(t* testing.T) { + t.Run("when PieceCID is present on data ref", func(t *testing.T) { pieceCid := &shared_testutil.GenerateCids(1)[0] pieceSize := abi.UnpaddedPieceSize(rand.Uint64()) data := &storagemarket.DataRef{ TransferType: storagemarket.TTManual, - PieceCid: pieceCid, - PieceSize: pieceSize, + PieceCid: pieceCid, + PieceSize: pieceSize, } respcid, ressize, err := clientutils.CommP(ctx, nil, proofType, data) require.NoError(t, err) @@ -42,16 +43,16 @@ func TestCommP(t * testing.T) { require.Equal(t, ressize, pieceSize) }) - t.Run("when PieceCID is not present on data ref", func (t * testing.T) { + t.Run("when PieceCID is not present on data ref", func(t *testing.T) { root := shared_testutil.GenerateCids(1)[0] data := &storagemarket.DataRef{ TransferType: storagemarket.TTGraphsync, - Root: root, + Root: root, } ssb := builder.NewSelectorSpecBuilder(ipldfree.NodeBuilder()) allSelector := ssb.ExploreRecursive(selector.RecursionLimitNone(), ssb.ExploreAll(ssb.ExploreRecursiveEdge())).Node() - t.Run("when pieceIO succeeds", func (t*testing.T) { + t.Run("when pieceIO succeeds", func(t *testing.T) { pieceCid := shared_testutil.GenerateCids(1)[0] pieceSize := abi.UnpaddedPieceSize(rand.Uint64()) pieceIO := &testPieceIO{t, proofType, root, allSelector, pieceCid, pieceSize, nil} @@ -61,7 +62,7 @@ func TestCommP(t * testing.T) { require.Equal(t, ressize, pieceSize) }) - t.Run("when pieceIO fails", func (t*testing.T) { + t.Run("when pieceIO fails", func(t *testing.T) { expectedMsg := "something went wrong" pieceIO := &testPieceIO{t, proofType, root, allSelector, cid.Undef, 0, errors.New(expectedMsg)} respcid, ressize, err := clientutils.CommP(ctx, pieceIO, proofType, data) @@ -72,33 +73,33 @@ func TestCommP(t * testing.T) { }) } -func TestVerifyResponse(t * testing.T) { - tests := map[string]struct{ +func TestVerifyResponse(t *testing.T) { + tests := map[string]struct { sresponse network.SignedResponse - verifier clientutils.VerifyFunc + verifier clientutils.VerifyFunc shouldErr bool }{ "successful verification": { sresponse: shared_testutil.MakeTestStorageNetworkSignedResponse(), - verifier: func(crypto.Signature, address.Address, []byte) bool { return true}, + verifier: func(crypto.Signature, address.Address, []byte) bool { return true }, shouldErr: false, }, "bad response": { - sresponse: network.SignedResponse{ - Response: network.Response{}, + sresponse: network.SignedResponse{ + Response: network.Response{}, Signature: shared_testutil.MakeTestSignature(), }, - verifier: func(crypto.Signature, address.Address, []byte) bool { return true}, + verifier: func(crypto.Signature, address.Address, []byte) bool { return true }, shouldErr: true, }, "verification fails": { sresponse: shared_testutil.MakeTestStorageNetworkSignedResponse(), - verifier: func(crypto.Signature, address.Address, []byte) bool { return false}, + verifier: func(crypto.Signature, address.Address, []byte) bool { return false }, shouldErr: true, }, } for name, data := range tests { - t.Run(name, func(t*testing.T) { + t.Run(name, func(t *testing.T) { err := clientutils.VerifyResponse(data.sresponse, address.TestAddress, data.verifier) require.Equal(t, err != nil, data.shouldErr) }) @@ -106,13 +107,13 @@ func TestVerifyResponse(t * testing.T) { } type testPieceIO struct { - t * testing.T - expectedRt abi.RegisteredProof + t *testing.T + expectedRt abi.RegisteredProof expectedPayloadCid cid.Cid - expectedSelector ipld.Node - pieceCID cid.Cid - pieceSize abi.UnpaddedPieceSize - err error + expectedSelector ipld.Node + pieceCID cid.Cid + pieceSize abi.UnpaddedPieceSize + err error } func (t *testPieceIO) GeneratePieceCommitment(rt abi.RegisteredProof, payloadCid cid.Cid, selector ipld.Node) (cid.Cid, abi.UnpaddedPieceSize, error) { @@ -125,4 +126,3 @@ func (t *testPieceIO) GeneratePieceCommitment(rt abi.RegisteredProof, payloadCid func (t *testPieceIO) ReadPiece(r io.Reader) (cid.Cid, error) { panic("not implemented") } - diff --git a/storagemarket/impl/connmanager/connmanager.go b/storagemarket/impl/connmanager/connmanager.go index 0df80258..5b961fa6 100644 --- a/storagemarket/impl/connmanager/connmanager.go +++ b/storagemarket/impl/connmanager/connmanager.go @@ -3,9 +3,10 @@ package connmanager import ( "sync" - "github.com/filecoin-project/go-fil-markets/storagemarket/network" "github.com/ipfs/go-cid" "golang.org/x/xerrors" + + "github.com/filecoin-project/go-fil-markets/storagemarket/network" ) // ConnManager is a simple threadsafe map of proposal CID -> network deal stream diff --git a/storagemarket/impl/connmanager/connmanager_test.go b/storagemarket/impl/connmanager/connmanager_test.go index 0bccdbe7..36a6a985 100644 --- a/storagemarket/impl/connmanager/connmanager_test.go +++ b/storagemarket/impl/connmanager/connmanager_test.go @@ -4,11 +4,12 @@ import ( "sync" "testing" + "github.com/ipfs/go-cid" + "github.com/stretchr/testify/require" + "github.com/filecoin-project/go-fil-markets/shared_testutil" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/connmanager" "github.com/filecoin-project/go-fil-markets/storagemarket/network" - "github.com/ipfs/go-cid" - "github.com/stretchr/testify/require" ) func TestConnManager(t *testing.T) { diff --git a/storagemarket/impl/provider.go b/storagemarket/impl/provider.go index a5640e18..ac4ebda1 100644 --- a/storagemarket/impl/provider.go +++ b/storagemarket/impl/provider.go @@ -15,6 +15,9 @@ import ( "github.com/filecoin-project/go-address" cborutil "github.com/filecoin-project/go-cbor-util" datatransfer "github.com/filecoin-project/go-data-transfer" + "github.com/filecoin-project/go-statemachine/fsm" + "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/go-fil-markets/filestore" "github.com/filecoin-project/go-fil-markets/pieceio" "github.com/filecoin-project/go-fil-markets/pieceio/cario" @@ -25,8 +28,6 @@ import ( "github.com/filecoin-project/go-fil-markets/storagemarket/impl/providerutils" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/storedask" "github.com/filecoin-project/go-fil-markets/storagemarket/network" - "github.com/filecoin-project/go-statemachine/fsm" - "github.com/filecoin-project/specs-actors/actors/abi" ) var ProviderDsPrefix = "/deals/provider" diff --git a/storagemarket/impl/providerstates/provider_fsm.go b/storagemarket/impl/providerstates/provider_fsm.go index 6fbb0c6b..7c471b25 100644 --- a/storagemarket/impl/providerstates/provider_fsm.go +++ b/storagemarket/impl/providerstates/provider_fsm.go @@ -1,11 +1,12 @@ package providerstates import ( - "github.com/filecoin-project/go-fil-markets/filestore" - "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-statemachine/fsm" "github.com/filecoin-project/specs-actors/actors/abi" "golang.org/x/xerrors" + + "github.com/filecoin-project/go-fil-markets/filestore" + "github.com/filecoin-project/go-fil-markets/storagemarket" ) // ProviderEvents are the events that can happen in a storage provider diff --git a/storagemarket/impl/providerstates/provider_states.go b/storagemarket/impl/providerstates/provider_states.go index 3da1528a..dfc1ddd4 100644 --- a/storagemarket/impl/providerstates/provider_states.go +++ b/storagemarket/impl/providerstates/provider_states.go @@ -16,14 +16,15 @@ import ( "github.com/libp2p/go-libp2p-core/peer" "golang.org/x/xerrors" + "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/specs-actors/actors/abi/big" + "github.com/filecoin-project/go-fil-markets/filestore" "github.com/filecoin-project/go-fil-markets/piecestore" "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/providerutils" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/requestvalidation" "github.com/filecoin-project/go-fil-markets/storagemarket/network" - "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/specs-actors/actors/abi/big" ) var log = logging.Logger("providerstates") diff --git a/storagemarket/impl/providerstates/provider_states_test.go b/storagemarket/impl/providerstates/provider_states_test.go index 795ade99..72933f05 100644 --- a/storagemarket/impl/providerstates/provider_states_test.go +++ b/storagemarket/impl/providerstates/provider_states_test.go @@ -13,6 +13,11 @@ import ( "github.com/filecoin-project/go-address" datatransfer "github.com/filecoin-project/go-data-transfer" + "github.com/filecoin-project/go-statemachine/fsm" + fsmtest "github.com/filecoin-project/go-statemachine/fsm/testutil" + "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/specs-actors/actors/builtin/market" + "github.com/filecoin-project/go-fil-markets/filestore" "github.com/filecoin-project/go-fil-markets/piecestore" tut "github.com/filecoin-project/go-fil-markets/shared_testutil" @@ -20,10 +25,6 @@ import ( "github.com/filecoin-project/go-fil-markets/storagemarket/impl/providerstates" "github.com/filecoin-project/go-fil-markets/storagemarket/network" "github.com/filecoin-project/go-fil-markets/storagemarket/testnodes" - "github.com/filecoin-project/go-statemachine/fsm" - fsmtest "github.com/filecoin-project/go-statemachine/fsm/testutil" - "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/specs-actors/actors/builtin/market" ) func TestValidateDealProposal(t *testing.T) { diff --git a/storagemarket/impl/providerutils/providerutils.go b/storagemarket/impl/providerutils/providerutils.go index 142ed0f2..65a83a9f 100644 --- a/storagemarket/impl/providerutils/providerutils.go +++ b/storagemarket/impl/providerutils/providerutils.go @@ -10,11 +10,12 @@ import ( "github.com/filecoin-project/go-address" cborutil "github.com/filecoin-project/go-cbor-util" datatransfer "github.com/filecoin-project/go-data-transfer" - "github.com/filecoin-project/go-fil-markets/storagemarket" - "github.com/filecoin-project/go-fil-markets/storagemarket/impl/requestvalidation" "github.com/filecoin-project/go-statemachine/fsm" "github.com/filecoin-project/specs-actors/actors/builtin/market" "github.com/filecoin-project/specs-actors/actors/crypto" + + "github.com/filecoin-project/go-fil-markets/storagemarket" + "github.com/filecoin-project/go-fil-markets/storagemarket/impl/requestvalidation" ) var log = logging.Logger("storagemarket_impl") diff --git a/storagemarket/impl/providerutils/providerutils_test.go b/storagemarket/impl/providerutils/providerutils_test.go index 60b10f75..c1b0e792 100644 --- a/storagemarket/impl/providerutils/providerutils_test.go +++ b/storagemarket/impl/providerutils/providerutils_test.go @@ -11,14 +11,15 @@ import ( "github.com/filecoin-project/go-address" datatransfer "github.com/filecoin-project/go-data-transfer" + "github.com/filecoin-project/go-statemachine/fsm" + "github.com/filecoin-project/specs-actors/actors/builtin/market" + "github.com/filecoin-project/specs-actors/actors/crypto" + "github.com/filecoin-project/go-fil-markets/shared_testutil" "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/providerutils" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/requestvalidation" "github.com/filecoin-project/go-fil-markets/storagemarket/network" - "github.com/filecoin-project/go-statemachine/fsm" - "github.com/filecoin-project/specs-actors/actors/builtin/market" - "github.com/filecoin-project/specs-actors/actors/crypto" ) func TestVerifyProposal(t *testing.T) { diff --git a/storagemarket/impl/requestvalidation/client_request_validator.go b/storagemarket/impl/requestvalidation/client_request_validator.go index dec371dc..88ad3f15 100644 --- a/storagemarket/impl/requestvalidation/client_request_validator.go +++ b/storagemarket/impl/requestvalidation/client_request_validator.go @@ -2,12 +2,13 @@ package requestvalidation import ( datatransfer "github.com/filecoin-project/go-data-transfer" - "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-statestore" "github.com/ipfs/go-cid" "github.com/ipld/go-ipld-prime" "github.com/libp2p/go-libp2p-core/peer" "golang.org/x/xerrors" + + "github.com/filecoin-project/go-fil-markets/storagemarket" ) var _ datatransfer.RequestValidator = &ClientRequestValidator{} diff --git a/storagemarket/impl/requestvalidation/provider_request_validator.go b/storagemarket/impl/requestvalidation/provider_request_validator.go index 990de692..29c0c04d 100644 --- a/storagemarket/impl/requestvalidation/provider_request_validator.go +++ b/storagemarket/impl/requestvalidation/provider_request_validator.go @@ -2,12 +2,13 @@ package requestvalidation import ( datatransfer "github.com/filecoin-project/go-data-transfer" - "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-statestore" "github.com/ipfs/go-cid" "github.com/ipld/go-ipld-prime" "github.com/libp2p/go-libp2p-core/peer" "golang.org/x/xerrors" + + "github.com/filecoin-project/go-fil-markets/storagemarket" ) var _ datatransfer.RequestValidator = &ProviderRequestValidator{} diff --git a/storagemarket/impl/requestvalidation/request_validation_test.go b/storagemarket/impl/requestvalidation/request_validation_test.go index 2cb66a61..92e3abba 100644 --- a/storagemarket/impl/requestvalidation/request_validation_test.go +++ b/storagemarket/impl/requestvalidation/request_validation_test.go @@ -16,10 +16,11 @@ import ( "github.com/filecoin-project/go-address" cborutil "github.com/filecoin-project/go-cbor-util" - "github.com/filecoin-project/go-fil-markets/storagemarket" - rv "github.com/filecoin-project/go-fil-markets/storagemarket/impl/requestvalidation" "github.com/filecoin-project/go-statestore" "github.com/filecoin-project/specs-actors/actors/crypto" + + "github.com/filecoin-project/go-fil-markets/storagemarket" + rv "github.com/filecoin-project/go-fil-markets/storagemarket/impl/requestvalidation" ) var blockGenerator = blocksutil.NewBlockGenerator() diff --git a/storagemarket/impl/storedask/storedask.go b/storagemarket/impl/storedask/storedask.go index e942c8bf..26b8c410 100644 --- a/storagemarket/impl/storedask/storedask.go +++ b/storagemarket/impl/storedask/storedask.go @@ -11,9 +11,10 @@ import ( "github.com/filecoin-project/go-address" cborutil "github.com/filecoin-project/go-cbor-util" + "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/providerutils" - "github.com/filecoin-project/specs-actors/actors/abi" ) var log = logging.Logger("storedask") diff --git a/storagemarket/impl/storedask/storedask_test.go b/storagemarket/impl/storedask/storedask_test.go index 029fb9b1..d4d057fe 100644 --- a/storagemarket/impl/storedask/storedask_test.go +++ b/storagemarket/impl/storedask/storedask_test.go @@ -5,12 +5,13 @@ import ( "testing" "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-fil-markets/storagemarket/impl/storedask" - "github.com/filecoin-project/go-fil-markets/storagemarket/testnodes" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/ipfs/go-datastore" dss "github.com/ipfs/go-datastore/sync" "github.com/stretchr/testify/require" + + "github.com/filecoin-project/go-fil-markets/storagemarket/impl/storedask" + "github.com/filecoin-project/go-fil-markets/storagemarket/testnodes" ) func TestStoredAsk(t *testing.T) { diff --git a/storagemarket/integration_test.go b/storagemarket/integration_test.go index 8421a972..4a6de058 100644 --- a/storagemarket/integration_test.go +++ b/storagemarket/integration_test.go @@ -20,6 +20,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/specs-actors/actors/abi/big" + "github.com/filecoin-project/go-fil-markets/filestore" "github.com/filecoin-project/go-fil-markets/pieceio/cario" "github.com/filecoin-project/go-fil-markets/piecestore" @@ -29,8 +32,6 @@ import ( storageimpl "github.com/filecoin-project/go-fil-markets/storagemarket/impl" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/requestvalidation" "github.com/filecoin-project/go-fil-markets/storagemarket/network" - "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/specs-actors/actors/abi/big" ) func TestMakeDeal(t *testing.T) { diff --git a/storagemarket/network/libp2p_impl.go b/storagemarket/network/libp2p_impl.go index a2b86a2f..4699f89e 100644 --- a/storagemarket/network/libp2p_impl.go +++ b/storagemarket/network/libp2p_impl.go @@ -4,11 +4,12 @@ import ( "bufio" "context" - "github.com/filecoin-project/go-fil-markets/storagemarket" logging "github.com/ipfs/go-log/v2" "github.com/libp2p/go-libp2p-core/host" "github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/peer" + + "github.com/filecoin-project/go-fil-markets/storagemarket" ) var log = logging.Logger("storagemarket_network") diff --git a/storagemarket/network/types.go b/storagemarket/network/types.go index 7f4bb33c..342c5da1 100644 --- a/storagemarket/network/types.go +++ b/storagemarket/network/types.go @@ -5,8 +5,9 @@ import ( "github.com/ipfs/go-cid" "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/specs-actors/actors/crypto" + + "github.com/filecoin-project/go-fil-markets/storagemarket" ) //go:generate cbor-gen-for AskRequest AskResponse Proposal Response SignedResponse diff --git a/storagemarket/network/types_cbor_gen.go b/storagemarket/network/types_cbor_gen.go index 6859bbdf..419e4e42 100644 --- a/storagemarket/network/types_cbor_gen.go +++ b/storagemarket/network/types_cbor_gen.go @@ -6,11 +6,12 @@ import ( "fmt" "io" - "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/specs-actors/actors/builtin/market" "github.com/filecoin-project/specs-actors/actors/crypto" cbg "github.com/whyrusleeping/cbor-gen" xerrors "golang.org/x/xerrors" + + "github.com/filecoin-project/go-fil-markets/storagemarket" ) var _ = xerrors.Errorf diff --git a/storagemarket/testnodes/testnodes.go b/storagemarket/testnodes/testnodes.go index 0e495a0e..2fc1275e 100644 --- a/storagemarket/testnodes/testnodes.go +++ b/storagemarket/testnodes/testnodes.go @@ -5,13 +5,14 @@ import ( "io" "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-fil-markets/shared_testutil" - "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" "github.com/filecoin-project/specs-actors/actors/builtin/market" "github.com/filecoin-project/specs-actors/actors/crypto" "github.com/ipfs/go-cid" + + "github.com/filecoin-project/go-fil-markets/shared_testutil" + "github.com/filecoin-project/go-fil-markets/storagemarket" ) // Below fake node implementations diff --git a/storagemarket/types.go b/storagemarket/types.go index b5e1539a..f5b8471a 100644 --- a/storagemarket/types.go +++ b/storagemarket/types.go @@ -9,10 +9,11 @@ import ( "github.com/libp2p/go-libp2p-core/peer" "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-fil-markets/filestore" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/builtin/market" "github.com/filecoin-project/specs-actors/actors/crypto" + + "github.com/filecoin-project/go-fil-markets/filestore" ) //go:generate cbor-gen-for ClientDeal MinerDeal Balance SignedStorageAsk StorageAsk StorageDeal DataRef diff --git a/storagemarket/types_cbor_gen.go b/storagemarket/types_cbor_gen.go index a7ac5f9a..727e61d6 100644 --- a/storagemarket/types_cbor_gen.go +++ b/storagemarket/types_cbor_gen.go @@ -6,12 +6,13 @@ import ( "fmt" "io" - "github.com/filecoin-project/go-fil-markets/filestore" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/crypto" "github.com/libp2p/go-libp2p-core/peer" cbg "github.com/whyrusleeping/cbor-gen" xerrors "golang.org/x/xerrors" + + "github.com/filecoin-project/go-fil-markets/filestore" ) var _ = xerrors.Errorf diff --git a/storedcounter/storedcounter_test.go b/storedcounter/storedcounter_test.go index 1d11e998..aa5ef861 100644 --- a/storedcounter/storedcounter_test.go +++ b/storedcounter/storedcounter_test.go @@ -9,8 +9,7 @@ import ( "github.com/filecoin-project/go-fil-markets/storedcounter" ) - -func TestStoredCounter(t * testing.T) { +func TestStoredCounter(t *testing.T) { ds := datastore.NewMapDatastore() t.Run("test two instances with same data store and key count together", func(t *testing.T) { @@ -34,9 +33,8 @@ func TestStoredCounter(t * testing.T) { require.Equal(t, next, uint64(3)) }) - t.Run("test two instances with same data store but different keys count seperate", func(t *testing.T) { - + key1 := datastore.NewKey("counter 1") key2 := datastore.NewKey("counter 2") @@ -58,4 +56,4 @@ func TestStoredCounter(t * testing.T) { require.NoError(t, err) require.Equal(t, next, uint64(1)) }) -} \ No newline at end of file +} From 2d4f95ab338b297b7ec2f3acbcd7d29f8378340d Mon Sep 17 00:00:00 2001 From: laser Date: Fri, 13 Mar 2020 15:38:46 -0700 Subject: [PATCH 2/4] terminate all newlines in import groups --- filestore/filestore_test.go | 1 - filestore/mocks/File.go | 1 - filestore/mocks/FileStore.go | 1 - pieceio/cario/cario.go | 2 -- pieceio/mocks/CarIO.go | 5 ----- pieceio/mocks/PieceIO.go | 5 ----- pieceio/mocks/PreparedCar.go | 1 - pieceio/mocks/ReadStore.go | 1 - pieceio/mocks/SectorCalculator.go | 1 - pieceio/pieceio.go | 2 -- pieceio/pieceio_test.go | 4 ---- pieceio/types.go | 3 --- piecestore/piecestore_test.go | 3 --- piecestore/types_cbor_gen.go | 1 - retrievalmarket/discovery/discovery.go | 1 - retrievalmarket/discovery/local.go | 1 - retrievalmarket/impl/blockio/reader.go | 2 -- retrievalmarket/impl/blockio/reader_test.go | 2 -- retrievalmarket/impl/blockio/traverser.go | 1 - retrievalmarket/impl/blockio/traverser_test.go | 2 -- retrievalmarket/impl/blockio/verify.go | 2 -- retrievalmarket/impl/blockio/verify_test.go | 2 -- retrievalmarket/impl/blockunsealing/blockunsealing.go | 2 -- retrievalmarket/impl/blockunsealing/blockunsealing_test.go | 3 --- retrievalmarket/impl/client.go | 3 --- retrievalmarket/impl/client_test.go | 3 --- retrievalmarket/impl/clientstates/client_fsm.go | 2 -- retrievalmarket/impl/clientstates/client_states.go | 2 -- retrievalmarket/impl/clientstates/client_states_test.go | 4 ---- retrievalmarket/impl/integration_test.go | 4 ---- retrievalmarket/impl/provider.go | 3 --- retrievalmarket/impl/provider_test.go | 3 --- retrievalmarket/impl/providerstates/provider_fsm.go | 2 -- retrievalmarket/impl/providerstates/provider_states.go | 3 --- retrievalmarket/impl/providerstates/provider_states_test.go | 3 --- .../impl/testnodes/test_retrieval_client_node.go | 2 -- .../impl/testnodes/test_retrieval_provider_node.go | 3 --- retrievalmarket/network/deal_stream.go | 2 -- retrievalmarket/network/libp2p_impl.go | 2 -- retrievalmarket/network/libp2p_impl_test.go | 3 --- retrievalmarket/network/network.go | 1 - retrievalmarket/network/query_stream.go | 3 --- retrievalmarket/types.go | 2 -- retrievalmarket/types_cbor_gen.go | 1 - shared_testutil/mocknet.go | 2 -- shared_testutil/test_ipld_tree.go | 2 -- shared_testutil/test_network_types.go | 2 -- shared_testutil/test_piecestore.go | 2 -- shared_testutil/test_types.go | 4 ---- shared_testutil/testutil.go | 1 - storagemarket/impl/client.go | 6 ------ storagemarket/impl/clientstates/client_fsm.go | 1 - storagemarket/impl/clientstates/client_states.go | 1 - storagemarket/impl/clientstates/cliest_states_test.go | 3 --- storagemarket/impl/clientutils/clientutils.go | 3 --- storagemarket/impl/clientutils/clientutils_test.go | 4 ---- storagemarket/impl/connmanager/connmanager.go | 2 -- storagemarket/impl/connmanager/connmanager_test.go | 2 -- storagemarket/impl/provider.go | 3 --- storagemarket/impl/providerstates/provider_fsm.go | 1 - storagemarket/impl/providerstates/provider_states.go | 3 --- storagemarket/impl/providerstates/provider_states_test.go | 3 --- storagemarket/impl/providerutils/providerutils.go | 3 --- storagemarket/impl/providerutils/providerutils_test.go | 3 --- .../impl/requestvalidation/client_request_validator.go | 1 - .../impl/requestvalidation/provider_request_validator.go | 1 - .../impl/requestvalidation/request_validation_test.go | 4 ---- storagemarket/impl/requestvalidation/types.go | 2 -- storagemarket/impl/requestvalidation/types_cbor_gen.go | 1 - storagemarket/impl/storedask/storedask.go | 3 --- storagemarket/impl/storedask/storedask_test.go | 2 -- storagemarket/integration_test.go | 4 ---- storagemarket/network/ask_stream.go | 2 -- storagemarket/network/deal_stream.go | 1 - storagemarket/network/libp2p_impl.go | 2 -- storagemarket/network/libp2p_impl_test.go | 2 -- storagemarket/network/types.go | 2 -- storagemarket/network/types_cbor_gen.go | 2 -- storagemarket/testnodes/testnodes.go | 2 -- storagemarket/types.go | 3 --- storagemarket/types_cbor_gen.go | 2 -- storedcounter/storedcounter.go | 1 - storedcounter/storedcounter_test.go | 2 -- 83 files changed, 190 deletions(-) diff --git a/filestore/filestore_test.go b/filestore/filestore_test.go index 0daaea58..49a6834c 100644 --- a/filestore/filestore_test.go +++ b/filestore/filestore_test.go @@ -7,7 +7,6 @@ import ( "os" "path" "testing" - "github.com/stretchr/testify/require" ) diff --git a/filestore/mocks/File.go b/filestore/mocks/File.go index dfeac9ee..e5b980fc 100644 --- a/filestore/mocks/File.go +++ b/filestore/mocks/File.go @@ -4,7 +4,6 @@ package mocks import ( mock "github.com/stretchr/testify/mock" - filestore "github.com/filecoin-project/go-fil-markets/filestore" ) diff --git a/filestore/mocks/FileStore.go b/filestore/mocks/FileStore.go index de3d6680..64e3b8eb 100644 --- a/filestore/mocks/FileStore.go +++ b/filestore/mocks/FileStore.go @@ -4,7 +4,6 @@ package mocks import ( mock "github.com/stretchr/testify/mock" - filestore "github.com/filecoin-project/go-fil-markets/filestore" ) diff --git a/pieceio/cario/cario.go b/pieceio/cario/cario.go index 38be8c63..709869a5 100644 --- a/pieceio/cario/cario.go +++ b/pieceio/cario/cario.go @@ -4,11 +4,9 @@ import ( "context" "fmt" "io" - "github.com/ipfs/go-car" "github.com/ipfs/go-cid" "github.com/ipld/go-ipld-prime" - "github.com/filecoin-project/go-fil-markets/pieceio" ) diff --git a/pieceio/mocks/CarIO.go b/pieceio/mocks/CarIO.go index 5997d1c0..e9b0a97b 100644 --- a/pieceio/mocks/CarIO.go +++ b/pieceio/mocks/CarIO.go @@ -4,15 +4,10 @@ package mocks import ( context "context" - cid "github.com/ipfs/go-cid" - io "io" - ipld "github.com/ipld/go-ipld-prime" - mock "github.com/stretchr/testify/mock" - pieceio "github.com/filecoin-project/go-fil-markets/pieceio" ) diff --git a/pieceio/mocks/PieceIO.go b/pieceio/mocks/PieceIO.go index 8b087d20..f199224c 100644 --- a/pieceio/mocks/PieceIO.go +++ b/pieceio/mocks/PieceIO.go @@ -4,15 +4,10 @@ package mocks import ( io "io" - cid "github.com/ipfs/go-cid" - filestore "github.com/filecoin-project/go-fil-markets/filestore" - ipld "github.com/ipld/go-ipld-prime" - mock "github.com/stretchr/testify/mock" - pieceio "github.com/filecoin-project/go-fil-markets/pieceio" ) diff --git a/pieceio/mocks/PreparedCar.go b/pieceio/mocks/PreparedCar.go index 0ad17eab..34410162 100644 --- a/pieceio/mocks/PreparedCar.go +++ b/pieceio/mocks/PreparedCar.go @@ -4,7 +4,6 @@ package mocks import ( io "io" - mock "github.com/stretchr/testify/mock" ) diff --git a/pieceio/mocks/ReadStore.go b/pieceio/mocks/ReadStore.go index 19053142..5e3f1e6b 100644 --- a/pieceio/mocks/ReadStore.go +++ b/pieceio/mocks/ReadStore.go @@ -5,7 +5,6 @@ package mocks import ( blocks "github.com/ipfs/go-block-format" cid "github.com/ipfs/go-cid" - mock "github.com/stretchr/testify/mock" ) diff --git a/pieceio/mocks/SectorCalculator.go b/pieceio/mocks/SectorCalculator.go index 43f0923f..0ecba541 100644 --- a/pieceio/mocks/SectorCalculator.go +++ b/pieceio/mocks/SectorCalculator.go @@ -4,7 +4,6 @@ package mocks import ( io "io" - mock "github.com/stretchr/testify/mock" ) diff --git a/pieceio/pieceio.go b/pieceio/pieceio.go index 20636c6f..5b48f31b 100644 --- a/pieceio/pieceio.go +++ b/pieceio/pieceio.go @@ -5,14 +5,12 @@ import ( "io" "os" "sync" - "github.com/filecoin-project/go-padreader" "github.com/filecoin-project/go-sectorbuilder" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/ipfs/go-cid" blockstore "github.com/ipfs/go-ipfs-blockstore" "github.com/ipld/go-ipld-prime" - "github.com/filecoin-project/go-fil-markets/filestore" ) diff --git a/pieceio/pieceio_test.go b/pieceio/pieceio_test.go index f3a8f487..1c2bd7b0 100644 --- a/pieceio/pieceio_test.go +++ b/pieceio/pieceio_test.go @@ -4,19 +4,15 @@ import ( "bytes" "context" "fmt" - "io" "testing" - "github.com/filecoin-project/go-fil-markets/filestore" fsmocks "github.com/filecoin-project/go-fil-markets/filestore/mocks" "github.com/filecoin-project/go-fil-markets/pieceio" "github.com/filecoin-project/go-fil-markets/pieceio/cario" pmocks "github.com/filecoin-project/go-fil-markets/pieceio/mocks" - "github.com/filecoin-project/go-sectorbuilder" "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/ipfs/go-cid" dag "github.com/ipfs/go-merkledag" dstest "github.com/ipfs/go-merkledag/test" diff --git a/pieceio/types.go b/pieceio/types.go index d4bf696d..398cc659 100644 --- a/pieceio/types.go +++ b/pieceio/types.go @@ -2,11 +2,8 @@ package pieceio import ( "io" - "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/go-fil-markets/filestore" - blocks "github.com/ipfs/go-block-format" "github.com/ipfs/go-cid" "github.com/ipld/go-ipld-prime" diff --git a/piecestore/piecestore_test.go b/piecestore/piecestore_test.go index 0961be29..6d6fc1de 100644 --- a/piecestore/piecestore_test.go +++ b/piecestore/piecestore_test.go @@ -3,13 +3,10 @@ package piecestore_test import ( "math/rand" "testing" - "github.com/ipfs/go-cid" "github.com/ipfs/go-datastore" "github.com/stretchr/testify/assert" - "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/go-fil-markets/piecestore" "github.com/filecoin-project/go-fil-markets/shared_testutil" ) diff --git a/piecestore/types_cbor_gen.go b/piecestore/types_cbor_gen.go index 61ae3329..a4e0ba58 100644 --- a/piecestore/types_cbor_gen.go +++ b/piecestore/types_cbor_gen.go @@ -5,7 +5,6 @@ package piecestore import ( "fmt" "io" - "github.com/filecoin-project/specs-actors/actors/abi" cbg "github.com/whyrusleeping/cbor-gen" xerrors "golang.org/x/xerrors" diff --git a/retrievalmarket/discovery/discovery.go b/retrievalmarket/discovery/discovery.go index 824a0a6c..937c1781 100644 --- a/retrievalmarket/discovery/discovery.go +++ b/retrievalmarket/discovery/discovery.go @@ -2,7 +2,6 @@ package discovery import ( cbor "github.com/ipfs/go-ipld-cbor" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) diff --git a/retrievalmarket/discovery/local.go b/retrievalmarket/discovery/local.go index 521ea929..8dc47e40 100644 --- a/retrievalmarket/discovery/local.go +++ b/retrievalmarket/discovery/local.go @@ -7,7 +7,6 @@ import ( dshelp "github.com/ipfs/go-ipfs-ds-help" cbor "github.com/ipfs/go-ipld-cbor" logging "github.com/ipfs/go-log/v2" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) diff --git a/retrievalmarket/impl/blockio/reader.go b/retrievalmarket/impl/blockio/reader.go index 065959fb..75f1277d 100644 --- a/retrievalmarket/impl/blockio/reader.go +++ b/retrievalmarket/impl/blockio/reader.go @@ -4,10 +4,8 @@ import ( "bytes" "context" "io" - "github.com/ipld/go-ipld-prime" cidlink "github.com/ipld/go-ipld-prime/linking/cid" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) diff --git a/retrievalmarket/impl/blockio/reader_test.go b/retrievalmarket/impl/blockio/reader_test.go index e0c29777..3ea8247e 100644 --- a/retrievalmarket/impl/blockio/reader_test.go +++ b/retrievalmarket/impl/blockio/reader_test.go @@ -3,11 +3,9 @@ package blockio_test import ( "context" "testing" - blocks "github.com/ipfs/go-block-format" "github.com/ipfs/go-cid" "github.com/stretchr/testify/require" - "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/blockio" tut "github.com/filecoin-project/go-fil-markets/shared_testutil" ) diff --git a/retrievalmarket/impl/blockio/traverser.go b/retrievalmarket/impl/blockio/traverser.go index 3fd28bc1..60359a78 100644 --- a/retrievalmarket/impl/blockio/traverser.go +++ b/retrievalmarket/impl/blockio/traverser.go @@ -4,7 +4,6 @@ import ( "context" "errors" "io" - "github.com/ipld/go-ipld-prime" dagpb "github.com/ipld/go-ipld-prime-proto" free "github.com/ipld/go-ipld-prime/impl/free" diff --git a/retrievalmarket/impl/blockio/traverser_test.go b/retrievalmarket/impl/blockio/traverser_test.go index e4d781a0..767e39de 100644 --- a/retrievalmarket/impl/blockio/traverser_test.go +++ b/retrievalmarket/impl/blockio/traverser_test.go @@ -4,11 +4,9 @@ import ( "bytes" "context" "testing" - blocks "github.com/ipfs/go-block-format" cidlink "github.com/ipld/go-ipld-prime/linking/cid" "github.com/stretchr/testify/require" - "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/blockio" tut "github.com/filecoin-project/go-fil-markets/shared_testutil" ) diff --git a/retrievalmarket/impl/blockio/verify.go b/retrievalmarket/impl/blockio/verify.go index f5ce6980..0fc1402a 100644 --- a/retrievalmarket/impl/blockio/verify.go +++ b/retrievalmarket/impl/blockio/verify.go @@ -3,11 +3,9 @@ package blockio import ( "bytes" "context" - blocks "github.com/ipfs/go-block-format" "github.com/ipld/go-ipld-prime" cidlink "github.com/ipld/go-ipld-prime/linking/cid" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) diff --git a/retrievalmarket/impl/blockio/verify_test.go b/retrievalmarket/impl/blockio/verify_test.go index 904b4bea..a181a8a3 100644 --- a/retrievalmarket/impl/blockio/verify_test.go +++ b/retrievalmarket/impl/blockio/verify_test.go @@ -3,10 +3,8 @@ package blockio_test import ( "context" "testing" - blocks "github.com/ipfs/go-block-format" "github.com/stretchr/testify/require" - "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/blockio" tut "github.com/filecoin-project/go-fil-markets/shared_testutil" ) diff --git a/retrievalmarket/impl/blockunsealing/blockunsealing.go b/retrievalmarket/impl/blockunsealing/blockunsealing.go index eb4a629a..ae941e14 100644 --- a/retrievalmarket/impl/blockunsealing/blockunsealing.go +++ b/retrievalmarket/impl/blockunsealing/blockunsealing.go @@ -4,13 +4,11 @@ import ( "bytes" "context" "io" - "github.com/ipfs/go-cid" blockstore "github.com/ipfs/go-ipfs-blockstore" "github.com/ipld/go-ipld-prime" cidlink "github.com/ipld/go-ipld-prime/linking/cid" "golang.org/x/xerrors" - "github.com/filecoin-project/go-fil-markets/pieceio" "github.com/filecoin-project/go-fil-markets/piecestore" ) diff --git a/retrievalmarket/impl/blockunsealing/blockunsealing_test.go b/retrievalmarket/impl/blockunsealing/blockunsealing_test.go index b93ac20b..8557b1d6 100644 --- a/retrievalmarket/impl/blockunsealing/blockunsealing_test.go +++ b/retrievalmarket/impl/blockunsealing/blockunsealing_test.go @@ -6,7 +6,6 @@ import ( "io/ioutil" "math/rand" "testing" - "github.com/ipfs/go-datastore" dss "github.com/ipfs/go-datastore/sync" bstore "github.com/ipfs/go-ipfs-blockstore" @@ -16,9 +15,7 @@ import ( "github.com/ipld/go-ipld-prime/traversal/selector" "github.com/ipld/go-ipld-prime/traversal/selector/builder" "github.com/stretchr/testify/require" - "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/go-fil-markets/pieceio/cario" "github.com/filecoin-project/go-fil-markets/piecestore" "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/blockunsealing" diff --git a/retrievalmarket/impl/client.go b/retrievalmarket/impl/client.go index 0f934735..30c71d29 100644 --- a/retrievalmarket/impl/client.go +++ b/retrievalmarket/impl/client.go @@ -4,7 +4,6 @@ import ( "context" "reflect" "sync" - blocks "github.com/ipfs/go-block-format" "github.com/ipfs/go-cid" "github.com/ipfs/go-datastore" @@ -14,11 +13,9 @@ import ( cidlink "github.com/ipld/go-ipld-prime/linking/cid" "github.com/libp2p/go-libp2p-core/peer" "golang.org/x/xerrors" - "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-statemachine/fsm" "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/blockio" "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/clientstates" diff --git a/retrievalmarket/impl/client_test.go b/retrievalmarket/impl/client_test.go index 9095944d..3a7118b8 100644 --- a/retrievalmarket/impl/client_test.go +++ b/retrievalmarket/impl/client_test.go @@ -4,7 +4,6 @@ import ( "context" "errors" "testing" - "github.com/filecoin-project/go-address" "github.com/ipfs/go-cid" "github.com/ipfs/go-datastore" @@ -13,9 +12,7 @@ import ( "github.com/libp2p/go-libp2p-core/peer" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" retrievalimpl "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl" "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/testnodes" diff --git a/retrievalmarket/impl/clientstates/client_fsm.go b/retrievalmarket/impl/clientstates/client_fsm.go index 11e9e3b9..5bbaf6f9 100644 --- a/retrievalmarket/impl/clientstates/client_fsm.go +++ b/retrievalmarket/impl/clientstates/client_fsm.go @@ -2,13 +2,11 @@ package clientstates import ( "fmt" - "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-statemachine/fsm" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" "golang.org/x/xerrors" - rm "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) diff --git a/retrievalmarket/impl/clientstates/client_states.go b/retrievalmarket/impl/clientstates/client_states.go index 7f4867f5..1a4522dd 100644 --- a/retrievalmarket/impl/clientstates/client_states.go +++ b/retrievalmarket/impl/clientstates/client_states.go @@ -2,11 +2,9 @@ package clientstates import ( "context" - "github.com/filecoin-project/go-statemachine/fsm" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" - rm "github.com/filecoin-project/go-fil-markets/retrievalmarket" rmnet "github.com/filecoin-project/go-fil-markets/retrievalmarket/network" ) diff --git a/retrievalmarket/impl/clientstates/client_states_test.go b/retrievalmarket/impl/clientstates/client_states_test.go index 7539ca46..26cbd0fd 100644 --- a/retrievalmarket/impl/clientstates/client_states_test.go +++ b/retrievalmarket/impl/clientstates/client_states_test.go @@ -5,19 +5,15 @@ import ( "crypto/rand" "errors" "testing" - "github.com/filecoin-project/go-statemachine/fsm" - "github.com/ipfs/go-cid" mh "github.com/multiformats/go-multihash" "github.com/stretchr/testify/require" - "github.com/filecoin-project/go-address" fsmtest "github.com/filecoin-project/go-statemachine/fsm/testutil" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" "github.com/filecoin-project/specs-actors/actors/builtin/paych" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" clientstates "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/clientstates" "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/testnodes" diff --git a/retrievalmarket/impl/integration_test.go b/retrievalmarket/impl/integration_test.go index 055d0878..b3994d68 100644 --- a/retrievalmarket/impl/integration_test.go +++ b/retrievalmarket/impl/integration_test.go @@ -5,18 +5,14 @@ import ( "context" "testing" "time" - "github.com/ipfs/go-cid" cidlink "github.com/ipld/go-ipld-prime/linking/cid" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" "github.com/filecoin-project/specs-actors/actors/builtin/paych" - "github.com/filecoin-project/go-fil-markets/pieceio/cario" "github.com/filecoin-project/go-fil-markets/piecestore" "github.com/filecoin-project/go-fil-markets/retrievalmarket" diff --git a/retrievalmarket/impl/provider.go b/retrievalmarket/impl/provider.go index 2a9cc200..3392a174 100644 --- a/retrievalmarket/impl/provider.go +++ b/retrievalmarket/impl/provider.go @@ -5,18 +5,15 @@ import ( "errors" "reflect" "sync" - "github.com/ipfs/go-cid" "github.com/ipfs/go-datastore" "github.com/ipfs/go-datastore/namespace" blockstore "github.com/ipfs/go-ipfs-blockstore" cidlink "github.com/ipld/go-ipld-prime/linking/cid" "golang.org/x/xerrors" - "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-statemachine/fsm" "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/go-fil-markets/pieceio/cario" "github.com/filecoin-project/go-fil-markets/piecestore" "github.com/filecoin-project/go-fil-markets/retrievalmarket" diff --git a/retrievalmarket/impl/provider_test.go b/retrievalmarket/impl/provider_test.go index 72141045..8663f594 100644 --- a/retrievalmarket/impl/provider_test.go +++ b/retrievalmarket/impl/provider_test.go @@ -2,16 +2,13 @@ package retrievalimpl_test import ( "testing" - "github.com/filecoin-project/go-address" "github.com/ipfs/go-datastore" dss "github.com/ipfs/go-datastore/sync" bstore "github.com/ipfs/go-ipfs-blockstore" "github.com/libp2p/go-libp2p-core/peer" "github.com/stretchr/testify/require" - "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/go-fil-markets/piecestore" "github.com/filecoin-project/go-fil-markets/retrievalmarket" retrievalimpl "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl" diff --git a/retrievalmarket/impl/providerstates/provider_fsm.go b/retrievalmarket/impl/providerstates/provider_fsm.go index 9d9ef7e4..2400a6c7 100644 --- a/retrievalmarket/impl/providerstates/provider_fsm.go +++ b/retrievalmarket/impl/providerstates/provider_fsm.go @@ -2,12 +2,10 @@ package providerstates import ( "fmt" - "github.com/filecoin-project/go-statemachine/fsm" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" "golang.org/x/xerrors" - rm "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) diff --git a/retrievalmarket/impl/providerstates/provider_states.go b/retrievalmarket/impl/providerstates/provider_states.go index 9c702001..97815d4d 100644 --- a/retrievalmarket/impl/providerstates/provider_states.go +++ b/retrievalmarket/impl/providerstates/provider_states.go @@ -2,14 +2,11 @@ package providerstates import ( "context" - "github.com/ipfs/go-cid" "golang.org/x/xerrors" - "github.com/filecoin-project/go-statemachine/fsm" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" - rm "github.com/filecoin-project/go-fil-markets/retrievalmarket" rmnet "github.com/filecoin-project/go-fil-markets/retrievalmarket/network" ) diff --git a/retrievalmarket/impl/providerstates/provider_states_test.go b/retrievalmarket/impl/providerstates/provider_states_test.go index eed4ef4d..4d5b2dc1 100644 --- a/retrievalmarket/impl/providerstates/provider_states_test.go +++ b/retrievalmarket/impl/providerstates/provider_states_test.go @@ -5,17 +5,14 @@ import ( "crypto/rand" "errors" "testing" - "github.com/ipfs/go-cid" mh "github.com/multiformats/go-multihash" "github.com/stretchr/testify/require" - "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-statemachine/fsm" fsmtest "github.com/filecoin-project/go-statemachine/fsm/testutil" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" rm "github.com/filecoin-project/go-fil-markets/retrievalmarket" "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/providerstates" diff --git a/retrievalmarket/impl/testnodes/test_retrieval_client_node.go b/retrievalmarket/impl/testnodes/test_retrieval_client_node.go index 084bc604..14890c93 100644 --- a/retrievalmarket/impl/testnodes/test_retrieval_client_node.go +++ b/retrievalmarket/impl/testnodes/test_retrieval_client_node.go @@ -2,11 +2,9 @@ package testnodes import ( "context" - "github.com/filecoin-project/go-address" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/builtin/paych" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) diff --git a/retrievalmarket/impl/testnodes/test_retrieval_provider_node.go b/retrievalmarket/impl/testnodes/test_retrieval_provider_node.go index 3e8404b5..d67d389b 100644 --- a/retrievalmarket/impl/testnodes/test_retrieval_provider_node.go +++ b/retrievalmarket/impl/testnodes/test_retrieval_provider_node.go @@ -8,13 +8,10 @@ import ( "io" "io/ioutil" "testing" - "github.com/stretchr/testify/require" - "github.com/filecoin-project/go-address" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/builtin/paych" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) diff --git a/retrievalmarket/network/deal_stream.go b/retrievalmarket/network/deal_stream.go index 33a48420..cd67c815 100644 --- a/retrievalmarket/network/deal_stream.go +++ b/retrievalmarket/network/deal_stream.go @@ -2,11 +2,9 @@ package network import ( "bufio" - cborutil "github.com/filecoin-project/go-cbor-util" "github.com/libp2p/go-libp2p-core/mux" "github.com/libp2p/go-libp2p-core/peer" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) diff --git a/retrievalmarket/network/libp2p_impl.go b/retrievalmarket/network/libp2p_impl.go index 43ea7d1e..2830367a 100644 --- a/retrievalmarket/network/libp2p_impl.go +++ b/retrievalmarket/network/libp2p_impl.go @@ -3,12 +3,10 @@ package network import ( "bufio" "context" - logging "github.com/ipfs/go-log/v2" "github.com/libp2p/go-libp2p-core/host" "github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/peer" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) diff --git a/retrievalmarket/network/libp2p_impl_test.go b/retrievalmarket/network/libp2p_impl_test.go index be24eb1d..3adbc436 100644 --- a/retrievalmarket/network/libp2p_impl_test.go +++ b/retrievalmarket/network/libp2p_impl_test.go @@ -6,14 +6,11 @@ import ( "math/rand" "testing" "time" - "github.com/libp2p/go-libp2p-core/peer" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/filecoin-project/go-address" "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" "github.com/filecoin-project/go-fil-markets/retrievalmarket/network" "github.com/filecoin-project/go-fil-markets/shared_testutil" diff --git a/retrievalmarket/network/network.go b/retrievalmarket/network/network.go index 258de067..5256b5ab 100644 --- a/retrievalmarket/network/network.go +++ b/retrievalmarket/network/network.go @@ -2,7 +2,6 @@ package network import ( "github.com/libp2p/go-libp2p-core/peer" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) diff --git a/retrievalmarket/network/query_stream.go b/retrievalmarket/network/query_stream.go index 47d843d9..c7146daf 100644 --- a/retrievalmarket/network/query_stream.go +++ b/retrievalmarket/network/query_stream.go @@ -2,12 +2,9 @@ package network import ( "bufio" - "github.com/libp2p/go-libp2p-core/mux" "github.com/libp2p/go-libp2p-core/peer" - cborutil "github.com/filecoin-project/go-cbor-util" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) diff --git a/retrievalmarket/types.go b/retrievalmarket/types.go index 30c88305..14902673 100644 --- a/retrievalmarket/types.go +++ b/retrievalmarket/types.go @@ -5,11 +5,9 @@ import ( "errors" "fmt" "io" - "github.com/filecoin-project/go-address" "github.com/ipfs/go-cid" "github.com/libp2p/go-libp2p-core/peer" - "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" "github.com/filecoin-project/specs-actors/actors/builtin/paych" diff --git a/retrievalmarket/types_cbor_gen.go b/retrievalmarket/types_cbor_gen.go index 46e5d96e..a1e22951 100644 --- a/retrievalmarket/types_cbor_gen.go +++ b/retrievalmarket/types_cbor_gen.go @@ -5,7 +5,6 @@ package retrievalmarket import ( "fmt" "io" - "github.com/filecoin-project/specs-actors/actors/builtin/paych" "github.com/libp2p/go-libp2p-core/peer" cbg "github.com/whyrusleeping/cbor-gen" diff --git a/shared_testutil/mocknet.go b/shared_testutil/mocknet.go index 6396bf6a..5e888118 100644 --- a/shared_testutil/mocknet.go +++ b/shared_testutil/mocknet.go @@ -8,7 +8,6 @@ import ( "os" "path/filepath" "testing" - blocks "github.com/ipfs/go-block-format" "github.com/ipfs/go-blockservice" "github.com/ipfs/go-datastore" @@ -35,7 +34,6 @@ import ( mocknet "github.com/libp2p/go-libp2p/p2p/net/mock" "github.com/stretchr/testify/require" "golang.org/x/net/context" - "github.com/filecoin-project/go-fil-markets/storedcounter" ) diff --git a/shared_testutil/test_ipld_tree.go b/shared_testutil/test_ipld_tree.go index b368b2e1..086a47c3 100644 --- a/shared_testutil/test_ipld_tree.go +++ b/shared_testutil/test_ipld_tree.go @@ -5,11 +5,9 @@ import ( "context" "errors" "io" - blocks "github.com/ipfs/go-block-format" "github.com/ipfs/go-cid" "github.com/ipld/go-ipld-prime" - // to register multicodec _ "github.com/ipld/go-ipld-prime/encoding/dagjson" "github.com/ipld/go-ipld-prime/fluent" diff --git a/shared_testutil/test_network_types.go b/shared_testutil/test_network_types.go index 5208dc7e..d3268ff0 100644 --- a/shared_testutil/test_network_types.go +++ b/shared_testutil/test_network_types.go @@ -3,10 +3,8 @@ package shared_testutil import ( "errors" "testing" - "github.com/libp2p/go-libp2p-core/peer" "github.com/stretchr/testify/require" - rm "github.com/filecoin-project/go-fil-markets/retrievalmarket" rmnet "github.com/filecoin-project/go-fil-markets/retrievalmarket/network" smnet "github.com/filecoin-project/go-fil-markets/storagemarket/network" diff --git a/shared_testutil/test_piecestore.go b/shared_testutil/test_piecestore.go index 6a5b488b..62e06807 100644 --- a/shared_testutil/test_piecestore.go +++ b/shared_testutil/test_piecestore.go @@ -3,10 +3,8 @@ package shared_testutil import ( "errors" "testing" - "github.com/ipfs/go-cid" "github.com/stretchr/testify/require" - "github.com/filecoin-project/go-fil-markets/piecestore" "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) diff --git a/shared_testutil/test_types.go b/shared_testutil/test_types.go index 906adb29..00651d2c 100644 --- a/shared_testutil/test_types.go +++ b/shared_testutil/test_types.go @@ -4,18 +4,14 @@ import ( "math/big" "math/rand" "testing" - cborutil "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/specs-actors/actors/builtin/market" - "github.com/filecoin-project/go-address" "github.com/libp2p/go-libp2p-core/test" "github.com/stretchr/testify/require" - "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/builtin/paych" "github.com/filecoin-project/specs-actors/actors/crypto" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" "github.com/filecoin-project/go-fil-markets/storagemarket" smnet "github.com/filecoin-project/go-fil-markets/storagemarket/network" diff --git a/shared_testutil/testutil.go b/shared_testutil/testutil.go index bb0fd2a4..31d01315 100644 --- a/shared_testutil/testutil.go +++ b/shared_testutil/testutil.go @@ -3,7 +3,6 @@ package shared_testutil import ( "bytes" "testing" - cborutil "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/specs-actors/actors/builtin/paych" blocks "github.com/ipfs/go-block-format" diff --git a/storagemarket/impl/client.go b/storagemarket/impl/client.go index e9a54f31..e3ead345 100644 --- a/storagemarket/impl/client.go +++ b/storagemarket/impl/client.go @@ -2,14 +2,10 @@ package storageimpl import ( "context" - "github.com/filecoin-project/go-fil-markets/storagemarket/impl/clientutils" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/connmanager" - "github.com/filecoin-project/go-statemachine/fsm" - "github.com/filecoin-project/go-fil-markets/storagemarket/network" - cborutil "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/specs-actors/actors/abi/big" "github.com/ipfs/go-cid" @@ -17,12 +13,10 @@ import ( blockstore "github.com/ipfs/go-ipfs-blockstore" logging "github.com/ipfs/go-log/v2" "golang.org/x/xerrors" - "github.com/filecoin-project/go-address" datatransfer "github.com/filecoin-project/go-data-transfer" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/builtin/market" - "github.com/filecoin-project/go-fil-markets/filestore" "github.com/filecoin-project/go-fil-markets/pieceio" "github.com/filecoin-project/go-fil-markets/pieceio/cario" diff --git a/storagemarket/impl/clientstates/client_fsm.go b/storagemarket/impl/clientstates/client_fsm.go index bb1d2912..b638c638 100644 --- a/storagemarket/impl/clientstates/client_fsm.go +++ b/storagemarket/impl/clientstates/client_fsm.go @@ -5,7 +5,6 @@ import ( "github.com/filecoin-project/specs-actors/actors/abi" "github.com/ipfs/go-cid" "golang.org/x/xerrors" - "github.com/filecoin-project/go-fil-markets/storagemarket" ) diff --git a/storagemarket/impl/clientstates/client_states.go b/storagemarket/impl/clientstates/client_states.go index 6effe6de..df1de916 100644 --- a/storagemarket/impl/clientstates/client_states.go +++ b/storagemarket/impl/clientstates/client_states.go @@ -4,7 +4,6 @@ import ( "github.com/filecoin-project/go-statemachine/fsm" "github.com/ipfs/go-cid" logging "github.com/ipfs/go-log/v2" - "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/clientutils" "github.com/filecoin-project/go-fil-markets/storagemarket/network" diff --git a/storagemarket/impl/clientstates/cliest_states_test.go b/storagemarket/impl/clientstates/cliest_states_test.go index b33fafe3..be2d2507 100644 --- a/storagemarket/impl/clientstates/cliest_states_test.go +++ b/storagemarket/impl/clientstates/cliest_states_test.go @@ -5,16 +5,13 @@ import ( "errors" "fmt" "testing" - "github.com/ipfs/go-cid" "github.com/stretchr/testify/require" - cborutil "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/go-statemachine/fsm" fsmtest "github.com/filecoin-project/go-statemachine/fsm/testutil" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/builtin/market" - tut "github.com/filecoin-project/go-fil-markets/shared_testutil" "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/clientstates" diff --git a/storagemarket/impl/clientutils/clientutils.go b/storagemarket/impl/clientutils/clientutils.go index af2bc48c..d1be735d 100644 --- a/storagemarket/impl/clientutils/clientutils.go +++ b/storagemarket/impl/clientutils/clientutils.go @@ -2,18 +2,15 @@ package clientutils import ( "context" - "github.com/ipfs/go-cid" ipldfree "github.com/ipld/go-ipld-prime/impl/free" "github.com/ipld/go-ipld-prime/traversal/selector" "github.com/ipld/go-ipld-prime/traversal/selector/builder" "golang.org/x/xerrors" - "github.com/filecoin-project/go-address" cborutil "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/crypto" - "github.com/filecoin-project/go-fil-markets/pieceio" "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-fil-markets/storagemarket/network" diff --git a/storagemarket/impl/clientutils/clientutils_test.go b/storagemarket/impl/clientutils/clientutils_test.go index 7ce0dfc6..3f89af95 100644 --- a/storagemarket/impl/clientutils/clientutils_test.go +++ b/storagemarket/impl/clientutils/clientutils_test.go @@ -7,19 +7,15 @@ import ( "io" "math/rand" "testing" - "github.com/filecoin-project/specs-actors/actors/crypto" - "github.com/ipfs/go-cid" ipld "github.com/ipld/go-ipld-prime" ipldfree "github.com/ipld/go-ipld-prime/impl/free" "github.com/ipld/go-ipld-prime/traversal/selector" "github.com/ipld/go-ipld-prime/traversal/selector/builder" "github.com/stretchr/testify/require" - "github.com/filecoin-project/go-address" "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/go-fil-markets/shared_testutil" "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/clientutils" diff --git a/storagemarket/impl/connmanager/connmanager.go b/storagemarket/impl/connmanager/connmanager.go index 5b961fa6..4c75b103 100644 --- a/storagemarket/impl/connmanager/connmanager.go +++ b/storagemarket/impl/connmanager/connmanager.go @@ -2,10 +2,8 @@ package connmanager import ( "sync" - "github.com/ipfs/go-cid" "golang.org/x/xerrors" - "github.com/filecoin-project/go-fil-markets/storagemarket/network" ) diff --git a/storagemarket/impl/connmanager/connmanager_test.go b/storagemarket/impl/connmanager/connmanager_test.go index 36a6a985..b472ad9e 100644 --- a/storagemarket/impl/connmanager/connmanager_test.go +++ b/storagemarket/impl/connmanager/connmanager_test.go @@ -3,10 +3,8 @@ package connmanager_test import ( "sync" "testing" - "github.com/ipfs/go-cid" "github.com/stretchr/testify/require" - "github.com/filecoin-project/go-fil-markets/shared_testutil" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/connmanager" "github.com/filecoin-project/go-fil-markets/storagemarket/network" diff --git a/storagemarket/impl/provider.go b/storagemarket/impl/provider.go index ac4ebda1..c81ec8fe 100644 --- a/storagemarket/impl/provider.go +++ b/storagemarket/impl/provider.go @@ -3,7 +3,6 @@ package storageimpl import ( "context" "io" - "github.com/ipfs/go-cid" "github.com/ipfs/go-datastore" "github.com/ipfs/go-datastore/namespace" @@ -11,13 +10,11 @@ import ( "github.com/ipld/go-ipld-prime" "github.com/libp2p/go-libp2p-core/peer" "golang.org/x/xerrors" - "github.com/filecoin-project/go-address" cborutil "github.com/filecoin-project/go-cbor-util" datatransfer "github.com/filecoin-project/go-data-transfer" "github.com/filecoin-project/go-statemachine/fsm" "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/go-fil-markets/filestore" "github.com/filecoin-project/go-fil-markets/pieceio" "github.com/filecoin-project/go-fil-markets/pieceio/cario" diff --git a/storagemarket/impl/providerstates/provider_fsm.go b/storagemarket/impl/providerstates/provider_fsm.go index 7c471b25..2ebd874b 100644 --- a/storagemarket/impl/providerstates/provider_fsm.go +++ b/storagemarket/impl/providerstates/provider_fsm.go @@ -4,7 +4,6 @@ import ( "github.com/filecoin-project/go-statemachine/fsm" "github.com/filecoin-project/specs-actors/actors/abi" "golang.org/x/xerrors" - "github.com/filecoin-project/go-fil-markets/filestore" "github.com/filecoin-project/go-fil-markets/storagemarket" ) diff --git a/storagemarket/impl/providerstates/provider_states.go b/storagemarket/impl/providerstates/provider_states.go index dfc1ddd4..2176f2a7 100644 --- a/storagemarket/impl/providerstates/provider_states.go +++ b/storagemarket/impl/providerstates/provider_states.go @@ -2,7 +2,6 @@ package providerstates import ( "context" - "github.com/filecoin-project/go-address" datatransfer "github.com/filecoin-project/go-data-transfer" "github.com/filecoin-project/go-padreader" @@ -15,10 +14,8 @@ import ( "github.com/ipld/go-ipld-prime/traversal/selector/builder" "github.com/libp2p/go-libp2p-core/peer" "golang.org/x/xerrors" - "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" - "github.com/filecoin-project/go-fil-markets/filestore" "github.com/filecoin-project/go-fil-markets/piecestore" "github.com/filecoin-project/go-fil-markets/storagemarket" diff --git a/storagemarket/impl/providerstates/provider_states_test.go b/storagemarket/impl/providerstates/provider_states_test.go index 72933f05..da4502e3 100644 --- a/storagemarket/impl/providerstates/provider_states_test.go +++ b/storagemarket/impl/providerstates/provider_states_test.go @@ -5,19 +5,16 @@ import ( "errors" "math/rand" "testing" - "github.com/ipfs/go-cid" "github.com/ipld/go-ipld-prime" "github.com/libp2p/go-libp2p-core/peer" "github.com/stretchr/testify/require" - "github.com/filecoin-project/go-address" datatransfer "github.com/filecoin-project/go-data-transfer" "github.com/filecoin-project/go-statemachine/fsm" fsmtest "github.com/filecoin-project/go-statemachine/fsm/testutil" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/builtin/market" - "github.com/filecoin-project/go-fil-markets/filestore" "github.com/filecoin-project/go-fil-markets/piecestore" tut "github.com/filecoin-project/go-fil-markets/shared_testutil" diff --git a/storagemarket/impl/providerutils/providerutils.go b/storagemarket/impl/providerutils/providerutils.go index 65a83a9f..b9ff9507 100644 --- a/storagemarket/impl/providerutils/providerutils.go +++ b/storagemarket/impl/providerutils/providerutils.go @@ -3,17 +3,14 @@ package providerutils import ( "context" "errors" - logging "github.com/ipfs/go-log/v2" "golang.org/x/xerrors" - "github.com/filecoin-project/go-address" cborutil "github.com/filecoin-project/go-cbor-util" datatransfer "github.com/filecoin-project/go-data-transfer" "github.com/filecoin-project/go-statemachine/fsm" "github.com/filecoin-project/specs-actors/actors/builtin/market" "github.com/filecoin-project/specs-actors/actors/crypto" - "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/requestvalidation" ) diff --git a/storagemarket/impl/providerutils/providerutils_test.go b/storagemarket/impl/providerutils/providerutils_test.go index c1b0e792..d98b659f 100644 --- a/storagemarket/impl/providerutils/providerutils_test.go +++ b/storagemarket/impl/providerutils/providerutils_test.go @@ -4,17 +4,14 @@ import ( "context" "errors" "testing" - "github.com/ipfs/go-cid" "github.com/libp2p/go-libp2p-core/peer" "github.com/stretchr/testify/require" - "github.com/filecoin-project/go-address" datatransfer "github.com/filecoin-project/go-data-transfer" "github.com/filecoin-project/go-statemachine/fsm" "github.com/filecoin-project/specs-actors/actors/builtin/market" "github.com/filecoin-project/specs-actors/actors/crypto" - "github.com/filecoin-project/go-fil-markets/shared_testutil" "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/providerutils" diff --git a/storagemarket/impl/requestvalidation/client_request_validator.go b/storagemarket/impl/requestvalidation/client_request_validator.go index 88ad3f15..6b253045 100644 --- a/storagemarket/impl/requestvalidation/client_request_validator.go +++ b/storagemarket/impl/requestvalidation/client_request_validator.go @@ -7,7 +7,6 @@ import ( "github.com/ipld/go-ipld-prime" "github.com/libp2p/go-libp2p-core/peer" "golang.org/x/xerrors" - "github.com/filecoin-project/go-fil-markets/storagemarket" ) diff --git a/storagemarket/impl/requestvalidation/provider_request_validator.go b/storagemarket/impl/requestvalidation/provider_request_validator.go index 29c0c04d..dd7c72b9 100644 --- a/storagemarket/impl/requestvalidation/provider_request_validator.go +++ b/storagemarket/impl/requestvalidation/provider_request_validator.go @@ -7,7 +7,6 @@ import ( "github.com/ipld/go-ipld-prime" "github.com/libp2p/go-libp2p-core/peer" "golang.org/x/xerrors" - "github.com/filecoin-project/go-fil-markets/storagemarket" ) diff --git a/storagemarket/impl/requestvalidation/request_validation_test.go b/storagemarket/impl/requestvalidation/request_validation_test.go index 92e3abba..ddce6ca1 100644 --- a/storagemarket/impl/requestvalidation/request_validation_test.go +++ b/storagemarket/impl/requestvalidation/request_validation_test.go @@ -4,21 +4,17 @@ import ( "fmt" "math/rand" "testing" - "github.com/filecoin-project/specs-actors/actors/builtin/market" - "github.com/ipfs/go-datastore" "github.com/ipfs/go-datastore/namespace" dss "github.com/ipfs/go-datastore/sync" blocksutil "github.com/ipfs/go-ipfs-blocksutil" "github.com/libp2p/go-libp2p-core/peer" xerrors "golang.org/x/xerrors" - "github.com/filecoin-project/go-address" cborutil "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/go-statestore" "github.com/filecoin-project/specs-actors/actors/crypto" - "github.com/filecoin-project/go-fil-markets/storagemarket" rv "github.com/filecoin-project/go-fil-markets/storagemarket/impl/requestvalidation" ) diff --git a/storagemarket/impl/requestvalidation/types.go b/storagemarket/impl/requestvalidation/types.go index 35c0f84b..76744f88 100644 --- a/storagemarket/impl/requestvalidation/types.go +++ b/storagemarket/impl/requestvalidation/types.go @@ -3,9 +3,7 @@ package requestvalidation import ( "bytes" "errors" - "github.com/ipfs/go-cid" - "github.com/filecoin-project/go-fil-markets/storagemarket" ) diff --git a/storagemarket/impl/requestvalidation/types_cbor_gen.go b/storagemarket/impl/requestvalidation/types_cbor_gen.go index ae25e9ac..321fd4d3 100644 --- a/storagemarket/impl/requestvalidation/types_cbor_gen.go +++ b/storagemarket/impl/requestvalidation/types_cbor_gen.go @@ -5,7 +5,6 @@ package requestvalidation import ( "fmt" "io" - cbg "github.com/whyrusleeping/cbor-gen" xerrors "golang.org/x/xerrors" ) diff --git a/storagemarket/impl/storedask/storedask.go b/storagemarket/impl/storedask/storedask.go index 26b8c410..4c238bfa 100644 --- a/storagemarket/impl/storedask/storedask.go +++ b/storagemarket/impl/storedask/storedask.go @@ -4,15 +4,12 @@ import ( "bytes" "context" "sync" - "github.com/ipfs/go-datastore" logging "github.com/ipfs/go-log/v2" "golang.org/x/xerrors" - "github.com/filecoin-project/go-address" cborutil "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/providerutils" ) diff --git a/storagemarket/impl/storedask/storedask_test.go b/storagemarket/impl/storedask/storedask_test.go index d4d057fe..c851123b 100644 --- a/storagemarket/impl/storedask/storedask_test.go +++ b/storagemarket/impl/storedask/storedask_test.go @@ -3,13 +3,11 @@ package storedask_test import ( "errors" "testing" - "github.com/filecoin-project/go-address" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/ipfs/go-datastore" dss "github.com/ipfs/go-datastore/sync" "github.com/stretchr/testify/require" - "github.com/filecoin-project/go-fil-markets/storagemarket/impl/storedask" "github.com/filecoin-project/go-fil-markets/storagemarket/testnodes" ) diff --git a/storagemarket/integration_test.go b/storagemarket/integration_test.go index 4a6de058..9422cd39 100644 --- a/storagemarket/integration_test.go +++ b/storagemarket/integration_test.go @@ -7,9 +7,7 @@ import ( "reflect" "testing" "time" - "github.com/filecoin-project/go-fil-markets/storagemarket/testnodes" - "github.com/filecoin-project/go-address" datatransfer "github.com/filecoin-project/go-data-transfer" graphsync "github.com/filecoin-project/go-data-transfer/impl/graphsync" @@ -19,10 +17,8 @@ import ( "github.com/libp2p/go-libp2p-core/peer" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" - "github.com/filecoin-project/go-fil-markets/filestore" "github.com/filecoin-project/go-fil-markets/pieceio/cario" "github.com/filecoin-project/go-fil-markets/piecestore" diff --git a/storagemarket/network/ask_stream.go b/storagemarket/network/ask_stream.go index 86996d91..2b853fa3 100644 --- a/storagemarket/network/ask_stream.go +++ b/storagemarket/network/ask_stream.go @@ -2,10 +2,8 @@ package network import ( "bufio" - "github.com/libp2p/go-libp2p-core/mux" "github.com/libp2p/go-libp2p-core/peer" - cborutil "github.com/filecoin-project/go-cbor-util" ) diff --git a/storagemarket/network/deal_stream.go b/storagemarket/network/deal_stream.go index dec3f894..3ad4fd2d 100644 --- a/storagemarket/network/deal_stream.go +++ b/storagemarket/network/deal_stream.go @@ -2,7 +2,6 @@ package network import ( "bufio" - cborutil "github.com/filecoin-project/go-cbor-util" "github.com/libp2p/go-libp2p-core/mux" "github.com/libp2p/go-libp2p-core/peer" diff --git a/storagemarket/network/libp2p_impl.go b/storagemarket/network/libp2p_impl.go index 4699f89e..2ddd05d7 100644 --- a/storagemarket/network/libp2p_impl.go +++ b/storagemarket/network/libp2p_impl.go @@ -3,12 +3,10 @@ package network import ( "bufio" "context" - logging "github.com/ipfs/go-log/v2" "github.com/libp2p/go-libp2p-core/host" "github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/peer" - "github.com/filecoin-project/go-fil-markets/storagemarket" ) diff --git a/storagemarket/network/libp2p_impl_test.go b/storagemarket/network/libp2p_impl_test.go index f47f7d53..60b4818f 100644 --- a/storagemarket/network/libp2p_impl_test.go +++ b/storagemarket/network/libp2p_impl_test.go @@ -4,11 +4,9 @@ import ( "context" "testing" "time" - "github.com/libp2p/go-libp2p-core/peer" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/filecoin-project/go-fil-markets/shared_testutil" "github.com/filecoin-project/go-fil-markets/storagemarket/network" ) diff --git a/storagemarket/network/types.go b/storagemarket/network/types.go index 342c5da1..f79c55b5 100644 --- a/storagemarket/network/types.go +++ b/storagemarket/network/types.go @@ -3,10 +3,8 @@ package network import ( "github.com/filecoin-project/specs-actors/actors/builtin/market" "github.com/ipfs/go-cid" - "github.com/filecoin-project/go-address" "github.com/filecoin-project/specs-actors/actors/crypto" - "github.com/filecoin-project/go-fil-markets/storagemarket" ) diff --git a/storagemarket/network/types_cbor_gen.go b/storagemarket/network/types_cbor_gen.go index 419e4e42..db329a49 100644 --- a/storagemarket/network/types_cbor_gen.go +++ b/storagemarket/network/types_cbor_gen.go @@ -5,12 +5,10 @@ package network import ( "fmt" "io" - "github.com/filecoin-project/specs-actors/actors/builtin/market" "github.com/filecoin-project/specs-actors/actors/crypto" cbg "github.com/whyrusleeping/cbor-gen" xerrors "golang.org/x/xerrors" - "github.com/filecoin-project/go-fil-markets/storagemarket" ) diff --git a/storagemarket/testnodes/testnodes.go b/storagemarket/testnodes/testnodes.go index 2fc1275e..be3fe2ca 100644 --- a/storagemarket/testnodes/testnodes.go +++ b/storagemarket/testnodes/testnodes.go @@ -3,14 +3,12 @@ package testnodes import ( "context" "io" - "github.com/filecoin-project/go-address" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" "github.com/filecoin-project/specs-actors/actors/builtin/market" "github.com/filecoin-project/specs-actors/actors/crypto" "github.com/ipfs/go-cid" - "github.com/filecoin-project/go-fil-markets/shared_testutil" "github.com/filecoin-project/go-fil-markets/storagemarket" ) diff --git a/storagemarket/types.go b/storagemarket/types.go index f5b8471a..ae2254b2 100644 --- a/storagemarket/types.go +++ b/storagemarket/types.go @@ -3,16 +3,13 @@ package storagemarket import ( "context" "io" - "github.com/ipfs/go-cid" cbor "github.com/ipfs/go-ipld-cbor" "github.com/libp2p/go-libp2p-core/peer" - "github.com/filecoin-project/go-address" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/builtin/market" "github.com/filecoin-project/specs-actors/actors/crypto" - "github.com/filecoin-project/go-fil-markets/filestore" ) diff --git a/storagemarket/types_cbor_gen.go b/storagemarket/types_cbor_gen.go index 727e61d6..11ccd3f4 100644 --- a/storagemarket/types_cbor_gen.go +++ b/storagemarket/types_cbor_gen.go @@ -5,13 +5,11 @@ package storagemarket import ( "fmt" "io" - "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/crypto" "github.com/libp2p/go-libp2p-core/peer" cbg "github.com/whyrusleeping/cbor-gen" xerrors "golang.org/x/xerrors" - "github.com/filecoin-project/go-fil-markets/filestore" ) diff --git a/storedcounter/storedcounter.go b/storedcounter/storedcounter.go index e2511ad2..9bb7af27 100644 --- a/storedcounter/storedcounter.go +++ b/storedcounter/storedcounter.go @@ -2,7 +2,6 @@ package storedcounter import ( "encoding/binary" - "github.com/ipfs/go-datastore" ) diff --git a/storedcounter/storedcounter_test.go b/storedcounter/storedcounter_test.go index aa5ef861..3884b501 100644 --- a/storedcounter/storedcounter_test.go +++ b/storedcounter/storedcounter_test.go @@ -2,10 +2,8 @@ package storedcounter_test import ( "testing" - "github.com/ipfs/go-datastore" "github.com/stretchr/testify/require" - "github.com/filecoin-project/go-fil-markets/storedcounter" ) From d527bd1b18647f342d64436e6d2e70d3112ca419 Mon Sep 17 00:00:00 2001 From: laser Date: Fri, 13 Mar 2020 15:39:17 -0700 Subject: [PATCH 3/4] group go-fil-markets, as per style guide --- filestore/filestore_test.go | 1 + filestore/mocks/File.go | 1 + filestore/mocks/FileStore.go | 1 + pieceio/cario/cario.go | 2 ++ pieceio/mocks/CarIO.go | 4 +++- pieceio/mocks/PieceIO.go | 4 +++- pieceio/mocks/PreparedCar.go | 1 + pieceio/mocks/SectorCalculator.go | 1 + pieceio/pieceio.go | 2 ++ pieceio/pieceio_test.go | 12 +++++++----- pieceio/types.go | 4 +++- piecestore/piecestore_test.go | 4 +++- piecestore/types_cbor_gen.go | 1 + retrievalmarket/discovery/discovery.go | 1 + retrievalmarket/discovery/local.go | 1 + retrievalmarket/impl/blockio/reader.go | 2 ++ retrievalmarket/impl/blockio/reader_test.go | 2 ++ retrievalmarket/impl/blockio/traverser.go | 1 + retrievalmarket/impl/blockio/traverser_test.go | 2 ++ retrievalmarket/impl/blockio/verify.go | 2 ++ retrievalmarket/impl/blockio/verify_test.go | 2 ++ .../impl/blockunsealing/blockunsealing.go | 2 ++ .../impl/blockunsealing/blockunsealing_test.go | 4 +++- retrievalmarket/impl/client.go | 8 +++++--- retrievalmarket/impl/client_test.go | 4 +++- .../impl/clientstates/client_fsm.go | 2 ++ .../impl/clientstates/client_states.go | 2 ++ .../impl/clientstates/client_states_test.go | 10 ++++++---- retrievalmarket/impl/integration_test.go | 10 ++++++---- retrievalmarket/impl/provider.go | 8 +++++--- retrievalmarket/impl/provider_test.go | 4 +++- .../impl/providerstates/provider_fsm.go | 2 ++ .../impl/providerstates/provider_states.go | 6 ++++-- .../providerstates/provider_states_test.go | 8 +++++--- .../testnodes/test_retrieval_client_node.go | 2 ++ .../testnodes/test_retrieval_provider_node.go | 4 +++- retrievalmarket/network/deal_stream.go | 2 ++ retrievalmarket/network/libp2p_impl.go | 2 ++ retrievalmarket/network/libp2p_impl_test.go | 6 ++++-- retrievalmarket/network/network.go | 1 + retrievalmarket/network/query_stream.go | 4 +++- retrievalmarket/types.go | 5 +++-- retrievalmarket/types_cbor_gen.go | 1 + shared_testutil/mocknet.go | 2 ++ shared_testutil/test_ipld_tree.go | 2 ++ shared_testutil/test_network_types.go | 2 ++ shared_testutil/test_piecestore.go | 2 ++ shared_testutil/test_types.go | 10 ++++++---- shared_testutil/testutil.go | 1 + storagemarket/impl/client.go | 18 ++++++++++-------- storagemarket/impl/clientstates/client_fsm.go | 1 + .../impl/clientstates/client_states.go | 1 + .../impl/clientstates/cliest_states_test.go | 6 ++++-- storagemarket/impl/clientutils/clientutils.go | 10 ++++++---- .../impl/clientutils/clientutils_test.go | 6 ++++-- storagemarket/impl/connmanager/connmanager.go | 2 ++ .../impl/connmanager/connmanager_test.go | 2 ++ storagemarket/impl/provider.go | 12 +++++++----- .../impl/providerstates/provider_fsm.go | 1 + .../impl/providerstates/provider_states.go | 6 ++++-- .../providerstates/provider_states_test.go | 10 ++++++---- .../impl/providerutils/providerutils.go | 6 ++++-- .../impl/providerutils/providerutils_test.go | 8 +++++--- .../client_request_validator.go | 1 + .../provider_request_validator.go | 1 + .../request_validation_test.go | 10 ++++++---- storagemarket/impl/requestvalidation/types.go | 2 ++ .../impl/requestvalidation/types_cbor_gen.go | 1 + storagemarket/impl/storedask/storedask.go | 8 +++++--- storagemarket/impl/storedask/storedask_test.go | 2 ++ storagemarket/integration_test.go | 8 +++++--- storagemarket/network/ask_stream.go | 3 ++- storagemarket/network/deal_stream.go | 1 + storagemarket/network/libp2p_impl.go | 2 ++ storagemarket/network/libp2p_impl_test.go | 2 ++ storagemarket/network/types.go | 5 +++-- storagemarket/network/types_cbor_gen.go | 2 ++ storagemarket/testnodes/testnodes.go | 2 ++ storagemarket/types.go | 8 +++++--- storagemarket/types_cbor_gen.go | 2 ++ storedcounter/storedcounter.go | 1 + storedcounter/storedcounter_test.go | 2 ++ 82 files changed, 230 insertions(+), 89 deletions(-) diff --git a/filestore/filestore_test.go b/filestore/filestore_test.go index 49a6834c..0daaea58 100644 --- a/filestore/filestore_test.go +++ b/filestore/filestore_test.go @@ -7,6 +7,7 @@ import ( "os" "path" "testing" + "github.com/stretchr/testify/require" ) diff --git a/filestore/mocks/File.go b/filestore/mocks/File.go index e5b980fc..dfeac9ee 100644 --- a/filestore/mocks/File.go +++ b/filestore/mocks/File.go @@ -4,6 +4,7 @@ package mocks import ( mock "github.com/stretchr/testify/mock" + filestore "github.com/filecoin-project/go-fil-markets/filestore" ) diff --git a/filestore/mocks/FileStore.go b/filestore/mocks/FileStore.go index 64e3b8eb..de3d6680 100644 --- a/filestore/mocks/FileStore.go +++ b/filestore/mocks/FileStore.go @@ -4,6 +4,7 @@ package mocks import ( mock "github.com/stretchr/testify/mock" + filestore "github.com/filecoin-project/go-fil-markets/filestore" ) diff --git a/pieceio/cario/cario.go b/pieceio/cario/cario.go index 709869a5..38be8c63 100644 --- a/pieceio/cario/cario.go +++ b/pieceio/cario/cario.go @@ -4,9 +4,11 @@ import ( "context" "fmt" "io" + "github.com/ipfs/go-car" "github.com/ipfs/go-cid" "github.com/ipld/go-ipld-prime" + "github.com/filecoin-project/go-fil-markets/pieceio" ) diff --git a/pieceio/mocks/CarIO.go b/pieceio/mocks/CarIO.go index e9b0a97b..79fc59cd 100644 --- a/pieceio/mocks/CarIO.go +++ b/pieceio/mocks/CarIO.go @@ -4,10 +4,12 @@ package mocks import ( context "context" - cid "github.com/ipfs/go-cid" io "io" + + cid "github.com/ipfs/go-cid" ipld "github.com/ipld/go-ipld-prime" mock "github.com/stretchr/testify/mock" + pieceio "github.com/filecoin-project/go-fil-markets/pieceio" ) diff --git a/pieceio/mocks/PieceIO.go b/pieceio/mocks/PieceIO.go index f199224c..2a7e9341 100644 --- a/pieceio/mocks/PieceIO.go +++ b/pieceio/mocks/PieceIO.go @@ -4,10 +4,12 @@ package mocks import ( io "io" + cid "github.com/ipfs/go-cid" - filestore "github.com/filecoin-project/go-fil-markets/filestore" ipld "github.com/ipld/go-ipld-prime" mock "github.com/stretchr/testify/mock" + + filestore "github.com/filecoin-project/go-fil-markets/filestore" pieceio "github.com/filecoin-project/go-fil-markets/pieceio" ) diff --git a/pieceio/mocks/PreparedCar.go b/pieceio/mocks/PreparedCar.go index 34410162..0ad17eab 100644 --- a/pieceio/mocks/PreparedCar.go +++ b/pieceio/mocks/PreparedCar.go @@ -4,6 +4,7 @@ package mocks import ( io "io" + mock "github.com/stretchr/testify/mock" ) diff --git a/pieceio/mocks/SectorCalculator.go b/pieceio/mocks/SectorCalculator.go index 0ecba541..43f0923f 100644 --- a/pieceio/mocks/SectorCalculator.go +++ b/pieceio/mocks/SectorCalculator.go @@ -4,6 +4,7 @@ package mocks import ( io "io" + mock "github.com/stretchr/testify/mock" ) diff --git a/pieceio/pieceio.go b/pieceio/pieceio.go index 5b48f31b..20636c6f 100644 --- a/pieceio/pieceio.go +++ b/pieceio/pieceio.go @@ -5,12 +5,14 @@ import ( "io" "os" "sync" + "github.com/filecoin-project/go-padreader" "github.com/filecoin-project/go-sectorbuilder" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/ipfs/go-cid" blockstore "github.com/ipfs/go-ipfs-blockstore" "github.com/ipld/go-ipld-prime" + "github.com/filecoin-project/go-fil-markets/filestore" ) diff --git a/pieceio/pieceio_test.go b/pieceio/pieceio_test.go index 1c2bd7b0..fa20bd66 100644 --- a/pieceio/pieceio_test.go +++ b/pieceio/pieceio_test.go @@ -6,11 +6,7 @@ import ( "fmt" "io" "testing" - "github.com/filecoin-project/go-fil-markets/filestore" - fsmocks "github.com/filecoin-project/go-fil-markets/filestore/mocks" - "github.com/filecoin-project/go-fil-markets/pieceio" - "github.com/filecoin-project/go-fil-markets/pieceio/cario" - pmocks "github.com/filecoin-project/go-fil-markets/pieceio/mocks" + "github.com/filecoin-project/go-sectorbuilder" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/ipfs/go-cid" @@ -21,6 +17,12 @@ import ( "github.com/ipld/go-ipld-prime/traversal/selector/builder" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/filecoin-project/go-fil-markets/filestore" + fsmocks "github.com/filecoin-project/go-fil-markets/filestore/mocks" + "github.com/filecoin-project/go-fil-markets/pieceio" + "github.com/filecoin-project/go-fil-markets/pieceio/cario" + pmocks "github.com/filecoin-project/go-fil-markets/pieceio/mocks" ) func Test_ThereAndBackAgain(t *testing.T) { diff --git a/pieceio/types.go b/pieceio/types.go index 398cc659..848784f3 100644 --- a/pieceio/types.go +++ b/pieceio/types.go @@ -2,11 +2,13 @@ package pieceio import ( "io" + "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/go-fil-markets/filestore" blocks "github.com/ipfs/go-block-format" "github.com/ipfs/go-cid" "github.com/ipld/go-ipld-prime" + + "github.com/filecoin-project/go-fil-markets/filestore" ) type WriteStore interface { diff --git a/piecestore/piecestore_test.go b/piecestore/piecestore_test.go index 6d6fc1de..6a8baff7 100644 --- a/piecestore/piecestore_test.go +++ b/piecestore/piecestore_test.go @@ -3,10 +3,12 @@ package piecestore_test import ( "math/rand" "testing" + + "github.com/filecoin-project/specs-actors/actors/abi" "github.com/ipfs/go-cid" "github.com/ipfs/go-datastore" "github.com/stretchr/testify/assert" - "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/go-fil-markets/piecestore" "github.com/filecoin-project/go-fil-markets/shared_testutil" ) diff --git a/piecestore/types_cbor_gen.go b/piecestore/types_cbor_gen.go index a4e0ba58..61ae3329 100644 --- a/piecestore/types_cbor_gen.go +++ b/piecestore/types_cbor_gen.go @@ -5,6 +5,7 @@ package piecestore import ( "fmt" "io" + "github.com/filecoin-project/specs-actors/actors/abi" cbg "github.com/whyrusleeping/cbor-gen" xerrors "golang.org/x/xerrors" diff --git a/retrievalmarket/discovery/discovery.go b/retrievalmarket/discovery/discovery.go index 937c1781..824a0a6c 100644 --- a/retrievalmarket/discovery/discovery.go +++ b/retrievalmarket/discovery/discovery.go @@ -2,6 +2,7 @@ package discovery import ( cbor "github.com/ipfs/go-ipld-cbor" + "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) diff --git a/retrievalmarket/discovery/local.go b/retrievalmarket/discovery/local.go index 8dc47e40..521ea929 100644 --- a/retrievalmarket/discovery/local.go +++ b/retrievalmarket/discovery/local.go @@ -7,6 +7,7 @@ import ( dshelp "github.com/ipfs/go-ipfs-ds-help" cbor "github.com/ipfs/go-ipld-cbor" logging "github.com/ipfs/go-log/v2" + "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) diff --git a/retrievalmarket/impl/blockio/reader.go b/retrievalmarket/impl/blockio/reader.go index 75f1277d..065959fb 100644 --- a/retrievalmarket/impl/blockio/reader.go +++ b/retrievalmarket/impl/blockio/reader.go @@ -4,8 +4,10 @@ import ( "bytes" "context" "io" + "github.com/ipld/go-ipld-prime" cidlink "github.com/ipld/go-ipld-prime/linking/cid" + "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) diff --git a/retrievalmarket/impl/blockio/reader_test.go b/retrievalmarket/impl/blockio/reader_test.go index 3ea8247e..e0c29777 100644 --- a/retrievalmarket/impl/blockio/reader_test.go +++ b/retrievalmarket/impl/blockio/reader_test.go @@ -3,9 +3,11 @@ package blockio_test import ( "context" "testing" + blocks "github.com/ipfs/go-block-format" "github.com/ipfs/go-cid" "github.com/stretchr/testify/require" + "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/blockio" tut "github.com/filecoin-project/go-fil-markets/shared_testutil" ) diff --git a/retrievalmarket/impl/blockio/traverser.go b/retrievalmarket/impl/blockio/traverser.go index 60359a78..3fd28bc1 100644 --- a/retrievalmarket/impl/blockio/traverser.go +++ b/retrievalmarket/impl/blockio/traverser.go @@ -4,6 +4,7 @@ import ( "context" "errors" "io" + "github.com/ipld/go-ipld-prime" dagpb "github.com/ipld/go-ipld-prime-proto" free "github.com/ipld/go-ipld-prime/impl/free" diff --git a/retrievalmarket/impl/blockio/traverser_test.go b/retrievalmarket/impl/blockio/traverser_test.go index 767e39de..e4d781a0 100644 --- a/retrievalmarket/impl/blockio/traverser_test.go +++ b/retrievalmarket/impl/blockio/traverser_test.go @@ -4,9 +4,11 @@ import ( "bytes" "context" "testing" + blocks "github.com/ipfs/go-block-format" cidlink "github.com/ipld/go-ipld-prime/linking/cid" "github.com/stretchr/testify/require" + "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/blockio" tut "github.com/filecoin-project/go-fil-markets/shared_testutil" ) diff --git a/retrievalmarket/impl/blockio/verify.go b/retrievalmarket/impl/blockio/verify.go index 0fc1402a..f5ce6980 100644 --- a/retrievalmarket/impl/blockio/verify.go +++ b/retrievalmarket/impl/blockio/verify.go @@ -3,9 +3,11 @@ package blockio import ( "bytes" "context" + blocks "github.com/ipfs/go-block-format" "github.com/ipld/go-ipld-prime" cidlink "github.com/ipld/go-ipld-prime/linking/cid" + "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) diff --git a/retrievalmarket/impl/blockio/verify_test.go b/retrievalmarket/impl/blockio/verify_test.go index a181a8a3..904b4bea 100644 --- a/retrievalmarket/impl/blockio/verify_test.go +++ b/retrievalmarket/impl/blockio/verify_test.go @@ -3,8 +3,10 @@ package blockio_test import ( "context" "testing" + blocks "github.com/ipfs/go-block-format" "github.com/stretchr/testify/require" + "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/blockio" tut "github.com/filecoin-project/go-fil-markets/shared_testutil" ) diff --git a/retrievalmarket/impl/blockunsealing/blockunsealing.go b/retrievalmarket/impl/blockunsealing/blockunsealing.go index ae941e14..eb4a629a 100644 --- a/retrievalmarket/impl/blockunsealing/blockunsealing.go +++ b/retrievalmarket/impl/blockunsealing/blockunsealing.go @@ -4,11 +4,13 @@ import ( "bytes" "context" "io" + "github.com/ipfs/go-cid" blockstore "github.com/ipfs/go-ipfs-blockstore" "github.com/ipld/go-ipld-prime" cidlink "github.com/ipld/go-ipld-prime/linking/cid" "golang.org/x/xerrors" + "github.com/filecoin-project/go-fil-markets/pieceio" "github.com/filecoin-project/go-fil-markets/piecestore" ) diff --git a/retrievalmarket/impl/blockunsealing/blockunsealing_test.go b/retrievalmarket/impl/blockunsealing/blockunsealing_test.go index 8557b1d6..54a5ccb8 100644 --- a/retrievalmarket/impl/blockunsealing/blockunsealing_test.go +++ b/retrievalmarket/impl/blockunsealing/blockunsealing_test.go @@ -6,6 +6,8 @@ import ( "io/ioutil" "math/rand" "testing" + + "github.com/filecoin-project/specs-actors/actors/abi" "github.com/ipfs/go-datastore" dss "github.com/ipfs/go-datastore/sync" bstore "github.com/ipfs/go-ipfs-blockstore" @@ -15,7 +17,7 @@ import ( "github.com/ipld/go-ipld-prime/traversal/selector" "github.com/ipld/go-ipld-prime/traversal/selector/builder" "github.com/stretchr/testify/require" - "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/go-fil-markets/pieceio/cario" "github.com/filecoin-project/go-fil-markets/piecestore" "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/blockunsealing" diff --git a/retrievalmarket/impl/client.go b/retrievalmarket/impl/client.go index 30c71d29..39e0b2a5 100644 --- a/retrievalmarket/impl/client.go +++ b/retrievalmarket/impl/client.go @@ -4,6 +4,10 @@ import ( "context" "reflect" "sync" + + "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-statemachine/fsm" + "github.com/filecoin-project/specs-actors/actors/abi" blocks "github.com/ipfs/go-block-format" "github.com/ipfs/go-cid" "github.com/ipfs/go-datastore" @@ -13,9 +17,7 @@ import ( cidlink "github.com/ipld/go-ipld-prime/linking/cid" "github.com/libp2p/go-libp2p-core/peer" "golang.org/x/xerrors" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-statemachine/fsm" - "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/go-fil-markets/retrievalmarket" "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/blockio" "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/clientstates" diff --git a/retrievalmarket/impl/client_test.go b/retrievalmarket/impl/client_test.go index 3a7118b8..4d3a6f78 100644 --- a/retrievalmarket/impl/client_test.go +++ b/retrievalmarket/impl/client_test.go @@ -4,7 +4,9 @@ import ( "context" "errors" "testing" + "github.com/filecoin-project/go-address" + "github.com/filecoin-project/specs-actors/actors/abi" "github.com/ipfs/go-cid" "github.com/ipfs/go-datastore" dss "github.com/ipfs/go-datastore/sync" @@ -12,7 +14,7 @@ import ( "github.com/libp2p/go-libp2p-core/peer" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/go-fil-markets/retrievalmarket" retrievalimpl "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl" "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/testnodes" diff --git a/retrievalmarket/impl/clientstates/client_fsm.go b/retrievalmarket/impl/clientstates/client_fsm.go index 5bbaf6f9..11e9e3b9 100644 --- a/retrievalmarket/impl/clientstates/client_fsm.go +++ b/retrievalmarket/impl/clientstates/client_fsm.go @@ -2,11 +2,13 @@ package clientstates import ( "fmt" + "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-statemachine/fsm" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" "golang.org/x/xerrors" + rm "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) diff --git a/retrievalmarket/impl/clientstates/client_states.go b/retrievalmarket/impl/clientstates/client_states.go index 1a4522dd..7f4867f5 100644 --- a/retrievalmarket/impl/clientstates/client_states.go +++ b/retrievalmarket/impl/clientstates/client_states.go @@ -2,9 +2,11 @@ package clientstates import ( "context" + "github.com/filecoin-project/go-statemachine/fsm" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" + rm "github.com/filecoin-project/go-fil-markets/retrievalmarket" rmnet "github.com/filecoin-project/go-fil-markets/retrievalmarket/network" ) diff --git a/retrievalmarket/impl/clientstates/client_states_test.go b/retrievalmarket/impl/clientstates/client_states_test.go index 26cbd0fd..25e00af9 100644 --- a/retrievalmarket/impl/clientstates/client_states_test.go +++ b/retrievalmarket/impl/clientstates/client_states_test.go @@ -5,15 +5,17 @@ import ( "crypto/rand" "errors" "testing" - "github.com/filecoin-project/go-statemachine/fsm" - "github.com/ipfs/go-cid" - mh "github.com/multiformats/go-multihash" - "github.com/stretchr/testify/require" + "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-statemachine/fsm" fsmtest "github.com/filecoin-project/go-statemachine/fsm/testutil" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" "github.com/filecoin-project/specs-actors/actors/builtin/paych" + "github.com/ipfs/go-cid" + mh "github.com/multiformats/go-multihash" + "github.com/stretchr/testify/require" + "github.com/filecoin-project/go-fil-markets/retrievalmarket" clientstates "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/clientstates" "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/testnodes" diff --git a/retrievalmarket/impl/integration_test.go b/retrievalmarket/impl/integration_test.go index b3994d68..6216cd7a 100644 --- a/retrievalmarket/impl/integration_test.go +++ b/retrievalmarket/impl/integration_test.go @@ -5,14 +5,16 @@ import ( "context" "testing" "time" - "github.com/ipfs/go-cid" - cidlink "github.com/ipld/go-ipld-prime/linking/cid" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" + "github.com/filecoin-project/go-address" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" "github.com/filecoin-project/specs-actors/actors/builtin/paych" + "github.com/ipfs/go-cid" + cidlink "github.com/ipld/go-ipld-prime/linking/cid" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/filecoin-project/go-fil-markets/pieceio/cario" "github.com/filecoin-project/go-fil-markets/piecestore" "github.com/filecoin-project/go-fil-markets/retrievalmarket" diff --git a/retrievalmarket/impl/provider.go b/retrievalmarket/impl/provider.go index 3392a174..77dec9b2 100644 --- a/retrievalmarket/impl/provider.go +++ b/retrievalmarket/impl/provider.go @@ -5,15 +5,17 @@ import ( "errors" "reflect" "sync" + + "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-statemachine/fsm" + "github.com/filecoin-project/specs-actors/actors/abi" "github.com/ipfs/go-cid" "github.com/ipfs/go-datastore" "github.com/ipfs/go-datastore/namespace" blockstore "github.com/ipfs/go-ipfs-blockstore" cidlink "github.com/ipld/go-ipld-prime/linking/cid" "golang.org/x/xerrors" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-statemachine/fsm" - "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/go-fil-markets/pieceio/cario" "github.com/filecoin-project/go-fil-markets/piecestore" "github.com/filecoin-project/go-fil-markets/retrievalmarket" diff --git a/retrievalmarket/impl/provider_test.go b/retrievalmarket/impl/provider_test.go index 8663f594..424ae4be 100644 --- a/retrievalmarket/impl/provider_test.go +++ b/retrievalmarket/impl/provider_test.go @@ -2,13 +2,15 @@ package retrievalimpl_test import ( "testing" + "github.com/filecoin-project/go-address" + "github.com/filecoin-project/specs-actors/actors/abi" "github.com/ipfs/go-datastore" dss "github.com/ipfs/go-datastore/sync" bstore "github.com/ipfs/go-ipfs-blockstore" "github.com/libp2p/go-libp2p-core/peer" "github.com/stretchr/testify/require" - "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/go-fil-markets/piecestore" "github.com/filecoin-project/go-fil-markets/retrievalmarket" retrievalimpl "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl" diff --git a/retrievalmarket/impl/providerstates/provider_fsm.go b/retrievalmarket/impl/providerstates/provider_fsm.go index 2400a6c7..9d9ef7e4 100644 --- a/retrievalmarket/impl/providerstates/provider_fsm.go +++ b/retrievalmarket/impl/providerstates/provider_fsm.go @@ -2,10 +2,12 @@ package providerstates import ( "fmt" + "github.com/filecoin-project/go-statemachine/fsm" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" "golang.org/x/xerrors" + rm "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) diff --git a/retrievalmarket/impl/providerstates/provider_states.go b/retrievalmarket/impl/providerstates/provider_states.go index 97815d4d..542438a4 100644 --- a/retrievalmarket/impl/providerstates/provider_states.go +++ b/retrievalmarket/impl/providerstates/provider_states.go @@ -2,11 +2,13 @@ package providerstates import ( "context" - "github.com/ipfs/go-cid" - "golang.org/x/xerrors" + "github.com/filecoin-project/go-statemachine/fsm" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" + "github.com/ipfs/go-cid" + "golang.org/x/xerrors" + rm "github.com/filecoin-project/go-fil-markets/retrievalmarket" rmnet "github.com/filecoin-project/go-fil-markets/retrievalmarket/network" ) diff --git a/retrievalmarket/impl/providerstates/provider_states_test.go b/retrievalmarket/impl/providerstates/provider_states_test.go index 4d5b2dc1..ea49996e 100644 --- a/retrievalmarket/impl/providerstates/provider_states_test.go +++ b/retrievalmarket/impl/providerstates/provider_states_test.go @@ -5,14 +5,16 @@ import ( "crypto/rand" "errors" "testing" - "github.com/ipfs/go-cid" - mh "github.com/multiformats/go-multihash" - "github.com/stretchr/testify/require" + "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-statemachine/fsm" fsmtest "github.com/filecoin-project/go-statemachine/fsm/testutil" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" + "github.com/ipfs/go-cid" + mh "github.com/multiformats/go-multihash" + "github.com/stretchr/testify/require" + "github.com/filecoin-project/go-fil-markets/retrievalmarket" rm "github.com/filecoin-project/go-fil-markets/retrievalmarket" "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/providerstates" diff --git a/retrievalmarket/impl/testnodes/test_retrieval_client_node.go b/retrievalmarket/impl/testnodes/test_retrieval_client_node.go index 14890c93..084bc604 100644 --- a/retrievalmarket/impl/testnodes/test_retrieval_client_node.go +++ b/retrievalmarket/impl/testnodes/test_retrieval_client_node.go @@ -2,9 +2,11 @@ package testnodes import ( "context" + "github.com/filecoin-project/go-address" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/builtin/paych" + "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) diff --git a/retrievalmarket/impl/testnodes/test_retrieval_provider_node.go b/retrievalmarket/impl/testnodes/test_retrieval_provider_node.go index d67d389b..31fa21ae 100644 --- a/retrievalmarket/impl/testnodes/test_retrieval_provider_node.go +++ b/retrievalmarket/impl/testnodes/test_retrieval_provider_node.go @@ -8,10 +8,12 @@ import ( "io" "io/ioutil" "testing" - "github.com/stretchr/testify/require" + "github.com/filecoin-project/go-address" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/builtin/paych" + "github.com/stretchr/testify/require" + "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) diff --git a/retrievalmarket/network/deal_stream.go b/retrievalmarket/network/deal_stream.go index cd67c815..33a48420 100644 --- a/retrievalmarket/network/deal_stream.go +++ b/retrievalmarket/network/deal_stream.go @@ -2,9 +2,11 @@ package network import ( "bufio" + cborutil "github.com/filecoin-project/go-cbor-util" "github.com/libp2p/go-libp2p-core/mux" "github.com/libp2p/go-libp2p-core/peer" + "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) diff --git a/retrievalmarket/network/libp2p_impl.go b/retrievalmarket/network/libp2p_impl.go index 2830367a..43ea7d1e 100644 --- a/retrievalmarket/network/libp2p_impl.go +++ b/retrievalmarket/network/libp2p_impl.go @@ -3,10 +3,12 @@ package network import ( "bufio" "context" + logging "github.com/ipfs/go-log/v2" "github.com/libp2p/go-libp2p-core/host" "github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/peer" + "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) diff --git a/retrievalmarket/network/libp2p_impl_test.go b/retrievalmarket/network/libp2p_impl_test.go index 3adbc436..573f5a6a 100644 --- a/retrievalmarket/network/libp2p_impl_test.go +++ b/retrievalmarket/network/libp2p_impl_test.go @@ -6,11 +6,13 @@ import ( "math/rand" "testing" "time" + + "github.com/filecoin-project/go-address" + "github.com/filecoin-project/specs-actors/actors/abi" "github.com/libp2p/go-libp2p-core/peer" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/go-fil-markets/retrievalmarket" "github.com/filecoin-project/go-fil-markets/retrievalmarket/network" "github.com/filecoin-project/go-fil-markets/shared_testutil" diff --git a/retrievalmarket/network/network.go b/retrievalmarket/network/network.go index 5256b5ab..258de067 100644 --- a/retrievalmarket/network/network.go +++ b/retrievalmarket/network/network.go @@ -2,6 +2,7 @@ package network import ( "github.com/libp2p/go-libp2p-core/peer" + "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) diff --git a/retrievalmarket/network/query_stream.go b/retrievalmarket/network/query_stream.go index c7146daf..aa03ca18 100644 --- a/retrievalmarket/network/query_stream.go +++ b/retrievalmarket/network/query_stream.go @@ -2,9 +2,11 @@ package network import ( "bufio" + + cborutil "github.com/filecoin-project/go-cbor-util" "github.com/libp2p/go-libp2p-core/mux" "github.com/libp2p/go-libp2p-core/peer" - cborutil "github.com/filecoin-project/go-cbor-util" + "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) diff --git a/retrievalmarket/types.go b/retrievalmarket/types.go index 14902673..28726ed8 100644 --- a/retrievalmarket/types.go +++ b/retrievalmarket/types.go @@ -5,12 +5,13 @@ import ( "errors" "fmt" "io" + "github.com/filecoin-project/go-address" - "github.com/ipfs/go-cid" - "github.com/libp2p/go-libp2p-core/peer" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" "github.com/filecoin-project/specs-actors/actors/builtin/paych" + "github.com/ipfs/go-cid" + "github.com/libp2p/go-libp2p-core/peer" ) //go:generate cbor-gen-for Query QueryResponse DealProposal DealResponse Params QueryParams DealPayment Block ClientDealState ProviderDealState PaymentInfo diff --git a/retrievalmarket/types_cbor_gen.go b/retrievalmarket/types_cbor_gen.go index a1e22951..46e5d96e 100644 --- a/retrievalmarket/types_cbor_gen.go +++ b/retrievalmarket/types_cbor_gen.go @@ -5,6 +5,7 @@ package retrievalmarket import ( "fmt" "io" + "github.com/filecoin-project/specs-actors/actors/builtin/paych" "github.com/libp2p/go-libp2p-core/peer" cbg "github.com/whyrusleeping/cbor-gen" diff --git a/shared_testutil/mocknet.go b/shared_testutil/mocknet.go index 5e888118..6396bf6a 100644 --- a/shared_testutil/mocknet.go +++ b/shared_testutil/mocknet.go @@ -8,6 +8,7 @@ import ( "os" "path/filepath" "testing" + blocks "github.com/ipfs/go-block-format" "github.com/ipfs/go-blockservice" "github.com/ipfs/go-datastore" @@ -34,6 +35,7 @@ import ( mocknet "github.com/libp2p/go-libp2p/p2p/net/mock" "github.com/stretchr/testify/require" "golang.org/x/net/context" + "github.com/filecoin-project/go-fil-markets/storedcounter" ) diff --git a/shared_testutil/test_ipld_tree.go b/shared_testutil/test_ipld_tree.go index 086a47c3..b368b2e1 100644 --- a/shared_testutil/test_ipld_tree.go +++ b/shared_testutil/test_ipld_tree.go @@ -5,9 +5,11 @@ import ( "context" "errors" "io" + blocks "github.com/ipfs/go-block-format" "github.com/ipfs/go-cid" "github.com/ipld/go-ipld-prime" + // to register multicodec _ "github.com/ipld/go-ipld-prime/encoding/dagjson" "github.com/ipld/go-ipld-prime/fluent" diff --git a/shared_testutil/test_network_types.go b/shared_testutil/test_network_types.go index d3268ff0..5208dc7e 100644 --- a/shared_testutil/test_network_types.go +++ b/shared_testutil/test_network_types.go @@ -3,8 +3,10 @@ package shared_testutil import ( "errors" "testing" + "github.com/libp2p/go-libp2p-core/peer" "github.com/stretchr/testify/require" + rm "github.com/filecoin-project/go-fil-markets/retrievalmarket" rmnet "github.com/filecoin-project/go-fil-markets/retrievalmarket/network" smnet "github.com/filecoin-project/go-fil-markets/storagemarket/network" diff --git a/shared_testutil/test_piecestore.go b/shared_testutil/test_piecestore.go index 62e06807..6a5b488b 100644 --- a/shared_testutil/test_piecestore.go +++ b/shared_testutil/test_piecestore.go @@ -3,8 +3,10 @@ package shared_testutil import ( "errors" "testing" + "github.com/ipfs/go-cid" "github.com/stretchr/testify/require" + "github.com/filecoin-project/go-fil-markets/piecestore" "github.com/filecoin-project/go-fil-markets/retrievalmarket" ) diff --git a/shared_testutil/test_types.go b/shared_testutil/test_types.go index 00651d2c..a49a6481 100644 --- a/shared_testutil/test_types.go +++ b/shared_testutil/test_types.go @@ -4,14 +4,16 @@ import ( "math/big" "math/rand" "testing" - cborutil "github.com/filecoin-project/go-cbor-util" - "github.com/filecoin-project/specs-actors/actors/builtin/market" + "github.com/filecoin-project/go-address" - "github.com/libp2p/go-libp2p-core/test" - "github.com/stretchr/testify/require" + cborutil "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/specs-actors/actors/builtin/market" "github.com/filecoin-project/specs-actors/actors/builtin/paych" "github.com/filecoin-project/specs-actors/actors/crypto" + "github.com/libp2p/go-libp2p-core/test" + "github.com/stretchr/testify/require" + "github.com/filecoin-project/go-fil-markets/retrievalmarket" "github.com/filecoin-project/go-fil-markets/storagemarket" smnet "github.com/filecoin-project/go-fil-markets/storagemarket/network" diff --git a/shared_testutil/testutil.go b/shared_testutil/testutil.go index 31d01315..bb0fd2a4 100644 --- a/shared_testutil/testutil.go +++ b/shared_testutil/testutil.go @@ -3,6 +3,7 @@ package shared_testutil import ( "bytes" "testing" + cborutil "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/specs-actors/actors/builtin/paych" blocks "github.com/ipfs/go-block-format" diff --git a/storagemarket/impl/client.go b/storagemarket/impl/client.go index e3ead345..2ad3b85c 100644 --- a/storagemarket/impl/client.go +++ b/storagemarket/impl/client.go @@ -2,21 +2,20 @@ package storageimpl import ( "context" - "github.com/filecoin-project/go-fil-markets/storagemarket/impl/clientutils" - "github.com/filecoin-project/go-fil-markets/storagemarket/impl/connmanager" - "github.com/filecoin-project/go-statemachine/fsm" - "github.com/filecoin-project/go-fil-markets/storagemarket/network" + + "github.com/filecoin-project/go-address" cborutil "github.com/filecoin-project/go-cbor-util" + datatransfer "github.com/filecoin-project/go-data-transfer" + "github.com/filecoin-project/go-statemachine/fsm" + "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" + "github.com/filecoin-project/specs-actors/actors/builtin/market" "github.com/ipfs/go-cid" "github.com/ipfs/go-datastore" blockstore "github.com/ipfs/go-ipfs-blockstore" logging "github.com/ipfs/go-log/v2" "golang.org/x/xerrors" - "github.com/filecoin-project/go-address" - datatransfer "github.com/filecoin-project/go-data-transfer" - "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/specs-actors/actors/builtin/market" + "github.com/filecoin-project/go-fil-markets/filestore" "github.com/filecoin-project/go-fil-markets/pieceio" "github.com/filecoin-project/go-fil-markets/pieceio/cario" @@ -24,6 +23,9 @@ import ( "github.com/filecoin-project/go-fil-markets/retrievalmarket/discovery" "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/clientstates" + "github.com/filecoin-project/go-fil-markets/storagemarket/impl/clientutils" + "github.com/filecoin-project/go-fil-markets/storagemarket/impl/connmanager" + "github.com/filecoin-project/go-fil-markets/storagemarket/network" ) var log = logging.Logger("storagemarket_impl") diff --git a/storagemarket/impl/clientstates/client_fsm.go b/storagemarket/impl/clientstates/client_fsm.go index b638c638..bb1d2912 100644 --- a/storagemarket/impl/clientstates/client_fsm.go +++ b/storagemarket/impl/clientstates/client_fsm.go @@ -5,6 +5,7 @@ import ( "github.com/filecoin-project/specs-actors/actors/abi" "github.com/ipfs/go-cid" "golang.org/x/xerrors" + "github.com/filecoin-project/go-fil-markets/storagemarket" ) diff --git a/storagemarket/impl/clientstates/client_states.go b/storagemarket/impl/clientstates/client_states.go index df1de916..6effe6de 100644 --- a/storagemarket/impl/clientstates/client_states.go +++ b/storagemarket/impl/clientstates/client_states.go @@ -4,6 +4,7 @@ import ( "github.com/filecoin-project/go-statemachine/fsm" "github.com/ipfs/go-cid" logging "github.com/ipfs/go-log/v2" + "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/clientutils" "github.com/filecoin-project/go-fil-markets/storagemarket/network" diff --git a/storagemarket/impl/clientstates/cliest_states_test.go b/storagemarket/impl/clientstates/cliest_states_test.go index be2d2507..fdc3c8b8 100644 --- a/storagemarket/impl/clientstates/cliest_states_test.go +++ b/storagemarket/impl/clientstates/cliest_states_test.go @@ -5,13 +5,15 @@ import ( "errors" "fmt" "testing" - "github.com/ipfs/go-cid" - "github.com/stretchr/testify/require" + cborutil "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/go-statemachine/fsm" fsmtest "github.com/filecoin-project/go-statemachine/fsm/testutil" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/builtin/market" + "github.com/ipfs/go-cid" + "github.com/stretchr/testify/require" + tut "github.com/filecoin-project/go-fil-markets/shared_testutil" "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/clientstates" diff --git a/storagemarket/impl/clientutils/clientutils.go b/storagemarket/impl/clientutils/clientutils.go index d1be735d..7f9cc1c1 100644 --- a/storagemarket/impl/clientutils/clientutils.go +++ b/storagemarket/impl/clientutils/clientutils.go @@ -2,15 +2,17 @@ package clientutils import ( "context" + + "github.com/filecoin-project/go-address" + cborutil "github.com/filecoin-project/go-cbor-util" + "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/specs-actors/actors/crypto" "github.com/ipfs/go-cid" ipldfree "github.com/ipld/go-ipld-prime/impl/free" "github.com/ipld/go-ipld-prime/traversal/selector" "github.com/ipld/go-ipld-prime/traversal/selector/builder" "golang.org/x/xerrors" - "github.com/filecoin-project/go-address" - cborutil "github.com/filecoin-project/go-cbor-util" - "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/specs-actors/actors/crypto" + "github.com/filecoin-project/go-fil-markets/pieceio" "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-fil-markets/storagemarket/network" diff --git a/storagemarket/impl/clientutils/clientutils_test.go b/storagemarket/impl/clientutils/clientutils_test.go index 3f89af95..fb66689b 100644 --- a/storagemarket/impl/clientutils/clientutils_test.go +++ b/storagemarket/impl/clientutils/clientutils_test.go @@ -7,6 +7,9 @@ import ( "io" "math/rand" "testing" + + "github.com/filecoin-project/go-address" + "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/crypto" "github.com/ipfs/go-cid" ipld "github.com/ipld/go-ipld-prime" @@ -14,8 +17,7 @@ import ( "github.com/ipld/go-ipld-prime/traversal/selector" "github.com/ipld/go-ipld-prime/traversal/selector/builder" "github.com/stretchr/testify/require" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/go-fil-markets/shared_testutil" "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/clientutils" diff --git a/storagemarket/impl/connmanager/connmanager.go b/storagemarket/impl/connmanager/connmanager.go index 4c75b103..5b961fa6 100644 --- a/storagemarket/impl/connmanager/connmanager.go +++ b/storagemarket/impl/connmanager/connmanager.go @@ -2,8 +2,10 @@ package connmanager import ( "sync" + "github.com/ipfs/go-cid" "golang.org/x/xerrors" + "github.com/filecoin-project/go-fil-markets/storagemarket/network" ) diff --git a/storagemarket/impl/connmanager/connmanager_test.go b/storagemarket/impl/connmanager/connmanager_test.go index b472ad9e..36a6a985 100644 --- a/storagemarket/impl/connmanager/connmanager_test.go +++ b/storagemarket/impl/connmanager/connmanager_test.go @@ -3,8 +3,10 @@ package connmanager_test import ( "sync" "testing" + "github.com/ipfs/go-cid" "github.com/stretchr/testify/require" + "github.com/filecoin-project/go-fil-markets/shared_testutil" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/connmanager" "github.com/filecoin-project/go-fil-markets/storagemarket/network" diff --git a/storagemarket/impl/provider.go b/storagemarket/impl/provider.go index c81ec8fe..88f789da 100644 --- a/storagemarket/impl/provider.go +++ b/storagemarket/impl/provider.go @@ -3,6 +3,12 @@ package storageimpl import ( "context" "io" + + "github.com/filecoin-project/go-address" + cborutil "github.com/filecoin-project/go-cbor-util" + datatransfer "github.com/filecoin-project/go-data-transfer" + "github.com/filecoin-project/go-statemachine/fsm" + "github.com/filecoin-project/specs-actors/actors/abi" "github.com/ipfs/go-cid" "github.com/ipfs/go-datastore" "github.com/ipfs/go-datastore/namespace" @@ -10,11 +16,7 @@ import ( "github.com/ipld/go-ipld-prime" "github.com/libp2p/go-libp2p-core/peer" "golang.org/x/xerrors" - "github.com/filecoin-project/go-address" - cborutil "github.com/filecoin-project/go-cbor-util" - datatransfer "github.com/filecoin-project/go-data-transfer" - "github.com/filecoin-project/go-statemachine/fsm" - "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/go-fil-markets/filestore" "github.com/filecoin-project/go-fil-markets/pieceio" "github.com/filecoin-project/go-fil-markets/pieceio/cario" diff --git a/storagemarket/impl/providerstates/provider_fsm.go b/storagemarket/impl/providerstates/provider_fsm.go index 2ebd874b..7c471b25 100644 --- a/storagemarket/impl/providerstates/provider_fsm.go +++ b/storagemarket/impl/providerstates/provider_fsm.go @@ -4,6 +4,7 @@ import ( "github.com/filecoin-project/go-statemachine/fsm" "github.com/filecoin-project/specs-actors/actors/abi" "golang.org/x/xerrors" + "github.com/filecoin-project/go-fil-markets/filestore" "github.com/filecoin-project/go-fil-markets/storagemarket" ) diff --git a/storagemarket/impl/providerstates/provider_states.go b/storagemarket/impl/providerstates/provider_states.go index 2176f2a7..60ace84d 100644 --- a/storagemarket/impl/providerstates/provider_states.go +++ b/storagemarket/impl/providerstates/provider_states.go @@ -2,10 +2,13 @@ package providerstates import ( "context" + "github.com/filecoin-project/go-address" datatransfer "github.com/filecoin-project/go-data-transfer" "github.com/filecoin-project/go-padreader" "github.com/filecoin-project/go-statemachine/fsm" + "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/specs-actors/actors/abi/big" "github.com/ipfs/go-cid" logging "github.com/ipfs/go-log/v2" "github.com/ipld/go-ipld-prime" @@ -14,8 +17,7 @@ import ( "github.com/ipld/go-ipld-prime/traversal/selector/builder" "github.com/libp2p/go-libp2p-core/peer" "golang.org/x/xerrors" - "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/specs-actors/actors/abi/big" + "github.com/filecoin-project/go-fil-markets/filestore" "github.com/filecoin-project/go-fil-markets/piecestore" "github.com/filecoin-project/go-fil-markets/storagemarket" diff --git a/storagemarket/impl/providerstates/provider_states_test.go b/storagemarket/impl/providerstates/provider_states_test.go index da4502e3..3ef88ebb 100644 --- a/storagemarket/impl/providerstates/provider_states_test.go +++ b/storagemarket/impl/providerstates/provider_states_test.go @@ -5,16 +5,18 @@ import ( "errors" "math/rand" "testing" - "github.com/ipfs/go-cid" - "github.com/ipld/go-ipld-prime" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/stretchr/testify/require" + "github.com/filecoin-project/go-address" datatransfer "github.com/filecoin-project/go-data-transfer" "github.com/filecoin-project/go-statemachine/fsm" fsmtest "github.com/filecoin-project/go-statemachine/fsm/testutil" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/builtin/market" + "github.com/ipfs/go-cid" + "github.com/ipld/go-ipld-prime" + "github.com/libp2p/go-libp2p-core/peer" + "github.com/stretchr/testify/require" + "github.com/filecoin-project/go-fil-markets/filestore" "github.com/filecoin-project/go-fil-markets/piecestore" tut "github.com/filecoin-project/go-fil-markets/shared_testutil" diff --git a/storagemarket/impl/providerutils/providerutils.go b/storagemarket/impl/providerutils/providerutils.go index b9ff9507..41ac9cf2 100644 --- a/storagemarket/impl/providerutils/providerutils.go +++ b/storagemarket/impl/providerutils/providerutils.go @@ -3,14 +3,16 @@ package providerutils import ( "context" "errors" - logging "github.com/ipfs/go-log/v2" - "golang.org/x/xerrors" + "github.com/filecoin-project/go-address" cborutil "github.com/filecoin-project/go-cbor-util" datatransfer "github.com/filecoin-project/go-data-transfer" "github.com/filecoin-project/go-statemachine/fsm" "github.com/filecoin-project/specs-actors/actors/builtin/market" "github.com/filecoin-project/specs-actors/actors/crypto" + logging "github.com/ipfs/go-log/v2" + "golang.org/x/xerrors" + "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/requestvalidation" ) diff --git a/storagemarket/impl/providerutils/providerutils_test.go b/storagemarket/impl/providerutils/providerutils_test.go index d98b659f..0ec40de1 100644 --- a/storagemarket/impl/providerutils/providerutils_test.go +++ b/storagemarket/impl/providerutils/providerutils_test.go @@ -4,14 +4,16 @@ import ( "context" "errors" "testing" - "github.com/ipfs/go-cid" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/stretchr/testify/require" + "github.com/filecoin-project/go-address" datatransfer "github.com/filecoin-project/go-data-transfer" "github.com/filecoin-project/go-statemachine/fsm" "github.com/filecoin-project/specs-actors/actors/builtin/market" "github.com/filecoin-project/specs-actors/actors/crypto" + "github.com/ipfs/go-cid" + "github.com/libp2p/go-libp2p-core/peer" + "github.com/stretchr/testify/require" + "github.com/filecoin-project/go-fil-markets/shared_testutil" "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/providerutils" diff --git a/storagemarket/impl/requestvalidation/client_request_validator.go b/storagemarket/impl/requestvalidation/client_request_validator.go index 6b253045..88ad3f15 100644 --- a/storagemarket/impl/requestvalidation/client_request_validator.go +++ b/storagemarket/impl/requestvalidation/client_request_validator.go @@ -7,6 +7,7 @@ import ( "github.com/ipld/go-ipld-prime" "github.com/libp2p/go-libp2p-core/peer" "golang.org/x/xerrors" + "github.com/filecoin-project/go-fil-markets/storagemarket" ) diff --git a/storagemarket/impl/requestvalidation/provider_request_validator.go b/storagemarket/impl/requestvalidation/provider_request_validator.go index dd7c72b9..29c0c04d 100644 --- a/storagemarket/impl/requestvalidation/provider_request_validator.go +++ b/storagemarket/impl/requestvalidation/provider_request_validator.go @@ -7,6 +7,7 @@ import ( "github.com/ipld/go-ipld-prime" "github.com/libp2p/go-libp2p-core/peer" "golang.org/x/xerrors" + "github.com/filecoin-project/go-fil-markets/storagemarket" ) diff --git a/storagemarket/impl/requestvalidation/request_validation_test.go b/storagemarket/impl/requestvalidation/request_validation_test.go index ddce6ca1..f3e36c6a 100644 --- a/storagemarket/impl/requestvalidation/request_validation_test.go +++ b/storagemarket/impl/requestvalidation/request_validation_test.go @@ -4,17 +4,19 @@ import ( "fmt" "math/rand" "testing" + + "github.com/filecoin-project/go-address" + cborutil "github.com/filecoin-project/go-cbor-util" + "github.com/filecoin-project/go-statestore" "github.com/filecoin-project/specs-actors/actors/builtin/market" + "github.com/filecoin-project/specs-actors/actors/crypto" "github.com/ipfs/go-datastore" "github.com/ipfs/go-datastore/namespace" dss "github.com/ipfs/go-datastore/sync" blocksutil "github.com/ipfs/go-ipfs-blocksutil" "github.com/libp2p/go-libp2p-core/peer" xerrors "golang.org/x/xerrors" - "github.com/filecoin-project/go-address" - cborutil "github.com/filecoin-project/go-cbor-util" - "github.com/filecoin-project/go-statestore" - "github.com/filecoin-project/specs-actors/actors/crypto" + "github.com/filecoin-project/go-fil-markets/storagemarket" rv "github.com/filecoin-project/go-fil-markets/storagemarket/impl/requestvalidation" ) diff --git a/storagemarket/impl/requestvalidation/types.go b/storagemarket/impl/requestvalidation/types.go index 76744f88..35c0f84b 100644 --- a/storagemarket/impl/requestvalidation/types.go +++ b/storagemarket/impl/requestvalidation/types.go @@ -3,7 +3,9 @@ package requestvalidation import ( "bytes" "errors" + "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-fil-markets/storagemarket" ) diff --git a/storagemarket/impl/requestvalidation/types_cbor_gen.go b/storagemarket/impl/requestvalidation/types_cbor_gen.go index 321fd4d3..ae25e9ac 100644 --- a/storagemarket/impl/requestvalidation/types_cbor_gen.go +++ b/storagemarket/impl/requestvalidation/types_cbor_gen.go @@ -5,6 +5,7 @@ package requestvalidation import ( "fmt" "io" + cbg "github.com/whyrusleeping/cbor-gen" xerrors "golang.org/x/xerrors" ) diff --git a/storagemarket/impl/storedask/storedask.go b/storagemarket/impl/storedask/storedask.go index 4c238bfa..4d6d1eae 100644 --- a/storagemarket/impl/storedask/storedask.go +++ b/storagemarket/impl/storedask/storedask.go @@ -4,12 +4,14 @@ import ( "bytes" "context" "sync" - "github.com/ipfs/go-datastore" - logging "github.com/ipfs/go-log/v2" - "golang.org/x/xerrors" + "github.com/filecoin-project/go-address" cborutil "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/ipfs/go-datastore" + logging "github.com/ipfs/go-log/v2" + "golang.org/x/xerrors" + "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/providerutils" ) diff --git a/storagemarket/impl/storedask/storedask_test.go b/storagemarket/impl/storedask/storedask_test.go index c851123b..d4d057fe 100644 --- a/storagemarket/impl/storedask/storedask_test.go +++ b/storagemarket/impl/storedask/storedask_test.go @@ -3,11 +3,13 @@ package storedask_test import ( "errors" "testing" + "github.com/filecoin-project/go-address" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/ipfs/go-datastore" dss "github.com/ipfs/go-datastore/sync" "github.com/stretchr/testify/require" + "github.com/filecoin-project/go-fil-markets/storagemarket/impl/storedask" "github.com/filecoin-project/go-fil-markets/storagemarket/testnodes" ) diff --git a/storagemarket/integration_test.go b/storagemarket/integration_test.go index 9422cd39..70aa20ac 100644 --- a/storagemarket/integration_test.go +++ b/storagemarket/integration_test.go @@ -7,18 +7,19 @@ import ( "reflect" "testing" "time" - "github.com/filecoin-project/go-fil-markets/storagemarket/testnodes" + "github.com/filecoin-project/go-address" datatransfer "github.com/filecoin-project/go-data-transfer" graphsync "github.com/filecoin-project/go-data-transfer/impl/graphsync" + "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/specs-actors/actors/abi/big" "github.com/ipfs/go-cid" "github.com/ipld/go-ipld-prime" cidlink "github.com/ipld/go-ipld-prime/linking/cid" "github.com/libp2p/go-libp2p-core/peer" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/specs-actors/actors/abi/big" + "github.com/filecoin-project/go-fil-markets/filestore" "github.com/filecoin-project/go-fil-markets/pieceio/cario" "github.com/filecoin-project/go-fil-markets/piecestore" @@ -28,6 +29,7 @@ import ( storageimpl "github.com/filecoin-project/go-fil-markets/storagemarket/impl" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/requestvalidation" "github.com/filecoin-project/go-fil-markets/storagemarket/network" + "github.com/filecoin-project/go-fil-markets/storagemarket/testnodes" ) func TestMakeDeal(t *testing.T) { diff --git a/storagemarket/network/ask_stream.go b/storagemarket/network/ask_stream.go index 2b853fa3..6622e0ad 100644 --- a/storagemarket/network/ask_stream.go +++ b/storagemarket/network/ask_stream.go @@ -2,9 +2,10 @@ package network import ( "bufio" + + cborutil "github.com/filecoin-project/go-cbor-util" "github.com/libp2p/go-libp2p-core/mux" "github.com/libp2p/go-libp2p-core/peer" - cborutil "github.com/filecoin-project/go-cbor-util" ) type askStream struct { diff --git a/storagemarket/network/deal_stream.go b/storagemarket/network/deal_stream.go index 3ad4fd2d..dec3f894 100644 --- a/storagemarket/network/deal_stream.go +++ b/storagemarket/network/deal_stream.go @@ -2,6 +2,7 @@ package network import ( "bufio" + cborutil "github.com/filecoin-project/go-cbor-util" "github.com/libp2p/go-libp2p-core/mux" "github.com/libp2p/go-libp2p-core/peer" diff --git a/storagemarket/network/libp2p_impl.go b/storagemarket/network/libp2p_impl.go index 2ddd05d7..4699f89e 100644 --- a/storagemarket/network/libp2p_impl.go +++ b/storagemarket/network/libp2p_impl.go @@ -3,10 +3,12 @@ package network import ( "bufio" "context" + logging "github.com/ipfs/go-log/v2" "github.com/libp2p/go-libp2p-core/host" "github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/peer" + "github.com/filecoin-project/go-fil-markets/storagemarket" ) diff --git a/storagemarket/network/libp2p_impl_test.go b/storagemarket/network/libp2p_impl_test.go index 60b4818f..f47f7d53 100644 --- a/storagemarket/network/libp2p_impl_test.go +++ b/storagemarket/network/libp2p_impl_test.go @@ -4,9 +4,11 @@ import ( "context" "testing" "time" + "github.com/libp2p/go-libp2p-core/peer" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/filecoin-project/go-fil-markets/shared_testutil" "github.com/filecoin-project/go-fil-markets/storagemarket/network" ) diff --git a/storagemarket/network/types.go b/storagemarket/network/types.go index f79c55b5..7d0294e5 100644 --- a/storagemarket/network/types.go +++ b/storagemarket/network/types.go @@ -1,10 +1,11 @@ package network import ( - "github.com/filecoin-project/specs-actors/actors/builtin/market" - "github.com/ipfs/go-cid" "github.com/filecoin-project/go-address" + "github.com/filecoin-project/specs-actors/actors/builtin/market" "github.com/filecoin-project/specs-actors/actors/crypto" + "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-fil-markets/storagemarket" ) diff --git a/storagemarket/network/types_cbor_gen.go b/storagemarket/network/types_cbor_gen.go index db329a49..419e4e42 100644 --- a/storagemarket/network/types_cbor_gen.go +++ b/storagemarket/network/types_cbor_gen.go @@ -5,10 +5,12 @@ package network import ( "fmt" "io" + "github.com/filecoin-project/specs-actors/actors/builtin/market" "github.com/filecoin-project/specs-actors/actors/crypto" cbg "github.com/whyrusleeping/cbor-gen" xerrors "golang.org/x/xerrors" + "github.com/filecoin-project/go-fil-markets/storagemarket" ) diff --git a/storagemarket/testnodes/testnodes.go b/storagemarket/testnodes/testnodes.go index be3fe2ca..2fc1275e 100644 --- a/storagemarket/testnodes/testnodes.go +++ b/storagemarket/testnodes/testnodes.go @@ -3,12 +3,14 @@ package testnodes import ( "context" "io" + "github.com/filecoin-project/go-address" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" "github.com/filecoin-project/specs-actors/actors/builtin/market" "github.com/filecoin-project/specs-actors/actors/crypto" "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-fil-markets/shared_testutil" "github.com/filecoin-project/go-fil-markets/storagemarket" ) diff --git a/storagemarket/types.go b/storagemarket/types.go index ae2254b2..bb8994a7 100644 --- a/storagemarket/types.go +++ b/storagemarket/types.go @@ -3,13 +3,15 @@ package storagemarket import ( "context" "io" - "github.com/ipfs/go-cid" - cbor "github.com/ipfs/go-ipld-cbor" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/filecoin-project/go-address" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/builtin/market" "github.com/filecoin-project/specs-actors/actors/crypto" + "github.com/ipfs/go-cid" + cbor "github.com/ipfs/go-ipld-cbor" + "github.com/libp2p/go-libp2p-core/peer" + "github.com/filecoin-project/go-fil-markets/filestore" ) diff --git a/storagemarket/types_cbor_gen.go b/storagemarket/types_cbor_gen.go index 11ccd3f4..727e61d6 100644 --- a/storagemarket/types_cbor_gen.go +++ b/storagemarket/types_cbor_gen.go @@ -5,11 +5,13 @@ package storagemarket import ( "fmt" "io" + "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/crypto" "github.com/libp2p/go-libp2p-core/peer" cbg "github.com/whyrusleeping/cbor-gen" xerrors "golang.org/x/xerrors" + "github.com/filecoin-project/go-fil-markets/filestore" ) diff --git a/storedcounter/storedcounter.go b/storedcounter/storedcounter.go index 9bb7af27..e2511ad2 100644 --- a/storedcounter/storedcounter.go +++ b/storedcounter/storedcounter.go @@ -2,6 +2,7 @@ package storedcounter import ( "encoding/binary" + "github.com/ipfs/go-datastore" ) diff --git a/storedcounter/storedcounter_test.go b/storedcounter/storedcounter_test.go index 3884b501..aa5ef861 100644 --- a/storedcounter/storedcounter_test.go +++ b/storedcounter/storedcounter_test.go @@ -2,8 +2,10 @@ package storedcounter_test import ( "testing" + "github.com/ipfs/go-datastore" "github.com/stretchr/testify/require" + "github.com/filecoin-project/go-fil-markets/storedcounter" ) From cf762d014c01c200e440ef3766a50197c8f2f876 Mon Sep 17 00:00:00 2001 From: laser Date: Fri, 13 Mar 2020 15:39:53 -0700 Subject: [PATCH 4/4] replace go-filecoin with go-fil-markets in CONTRIBUTING.md --- CONTRIBUTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6f5fd4ea..ebeb4316 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,7 @@ First, thank you for your interest in contributing to this project! Before you pick up your first issue and start changing code, please: - + 1. Review all documentation for the module you're interested in. 1. Look through the [issues for this repo](https://github.com/filecoin-project/go-fil-markets/issues) for relevant discussions. 1. If you have questions about an issue, post a comment in the issue. @@ -30,7 +30,7 @@ Before a PR can be merged to `master`, it must: ### Conventions and Style -#### Imports +#### Imports We use the following import ordering. ``` import ( @@ -38,7 +38,7 @@ import ( [external packages] - [go-filecoin packages] + [go-fil-markets packages] ) ``` @@ -65,4 +65,4 @@ Comments are a communication to other developers (including your future self) to - A `TODO:` comment describes a change that is desired but could not be immediately implemented. It must include a reference to a GitHub issue outlining whatever prevents the thing being done now (which could just be a matter of priority). - A `NOTE:` comment indicates an aside, some background info, or ideas for future improvement, rather than the intent of the current code. It's often fine to document such ideas alongside the code rather than an issue (at the loss of a space for discussion). -- `FIXME`, `HACK`, `XXX` and similar tags indicating that some code is to be avoided in favour of `TODO`, `NOTE` or some straight prose. \ No newline at end of file +- `FIXME`, `HACK`, `XXX` and similar tags indicating that some code is to be avoided in favour of `TODO`, `NOTE` or some straight prose.