Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resume Storage Market Data Transfer #430

Merged
merged 8 commits into from
Oct 13, 2020
7 changes: 4 additions & 3 deletions storagemarket/testharness/dependencies/dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/filecoin-project/go-address"
datatransfer "github.com/filecoin-project/go-data-transfer"
dtimpl "github.com/filecoin-project/go-data-transfer/impl"
"github.com/filecoin-project/go-data-transfer/testutil"
dtgstransport "github.com/filecoin-project/go-data-transfer/transport/graphsync"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/specs-actors/actors/builtin/market"
Expand Down Expand Up @@ -108,7 +109,8 @@ func NewDependenciesWithTestData(t *testing.T, ctx context.Context, td *shared_t
dtTransport1 := dtgstransport.NewTransport(td.Host1.ID(), gs1)
dt1, err := dtimpl.NewDataTransfer(td.DTStore1, td.DTNet1, dtTransport1, td.DTStoredCounter1)
require.NoError(t, err)
err = dt1.Start(ctx)
testutil.StartAndWaitForReady(ctx, t, dt1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey you don't actually need to use this version -- the function is already present in the shared_testutil for go-fil-markets and will work with go-data-transfer. I should probably extract that whole functionality to common utilities repo at some point :)


require.NoError(t, err)
clientDealFunds, err := funds.NewDealFunds(td.Ds1, datastore.NewKey("storage/client/dealfunds"))
require.NoError(t, err)
Expand All @@ -121,8 +123,7 @@ func NewDependenciesWithTestData(t *testing.T, ctx context.Context, td *shared_t
dtTransport2 := dtgstransport.NewTransport(td.Host2.ID(), gs2)
dt2, err := dtimpl.NewDataTransfer(td.DTStore2, td.DTNet2, dtTransport2, td.DTStoredCounter2)
require.NoError(t, err)
err = dt2.Start(ctx)
require.NoError(t, err)
testutil.StartAndWaitForReady(ctx, t, dt2)

storedAskDs := namespace.Wrap(td.Ds2, datastore.NewKey("/storage/ask"))
storedAsk, err := storedask.NewStoredAsk(storedAskDs, datastore.NewKey("latest-ask"), providerNode, providerAddr)
Expand Down
16 changes: 8 additions & 8 deletions storagemarket/testharness/testharness.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ import (
"sync"
"testing"

dtimpl "github.com/filecoin-project/go-data-transfer/impl"
dtgstransport "github.com/filecoin-project/go-data-transfer/transport/graphsync"
"github.com/filecoin-project/go-fil-markets/filestore"
piecestoreimpl "github.com/filecoin-project/go-fil-markets/piecestore/impl"
"github.com/filecoin-project/go-fil-markets/storagemarket/impl/funds"
"github.com/filecoin-project/go-fil-markets/storagemarket/impl/storedask"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-datastore"
"github.com/ipfs/go-datastore/namespace"
Expand All @@ -23,14 +17,21 @@ import (
"github.com/stretchr/testify/require"
"golang.org/x/net/context"

dtimpl "github.com/filecoin-project/go-data-transfer/impl"
"github.com/filecoin-project/go-data-transfer/testutil"
dtgstransport "github.com/filecoin-project/go-data-transfer/transport/graphsync"
"github.com/filecoin-project/go-multistore"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/specs-actors/actors/builtin"

"github.com/filecoin-project/go-fil-markets/filestore"
piecestoreimpl "github.com/filecoin-project/go-fil-markets/piecestore/impl"
"github.com/filecoin-project/go-fil-markets/shared_testutil"
"github.com/filecoin-project/go-fil-markets/storagemarket"
storageimpl "github.com/filecoin-project/go-fil-markets/storagemarket/impl"
"github.com/filecoin-project/go-fil-markets/storagemarket/impl/funds"
"github.com/filecoin-project/go-fil-markets/storagemarket/impl/storedask"
"github.com/filecoin-project/go-fil-markets/storagemarket/network"
"github.com/filecoin-project/go-fil-markets/storagemarket/testharness/dependencies"
"github.com/filecoin-project/go-fil-markets/storagemarket/testnodes"
Expand Down Expand Up @@ -124,8 +125,7 @@ func (h *StorageHarness) CreateNewProvider(t *testing.T, ctx context.Context, td
dtTransport2 := dtgstransport.NewTransport(td.Host2.ID(), gs2)
dt2, err := dtimpl.NewDataTransfer(td.DTStore2, td.DTNet2, dtTransport2, td.DTStoredCounter2)
require.NoError(t, err)
err = dt2.Start(ctx)
require.NoError(t, err)
testutil.StartAndWaitForReady(ctx, t, dt2)

storedAskDs := namespace.Wrap(td.Ds2, datastore.NewKey("/storage/ask"))
storedAsk, err := storedask.NewStoredAsk(storedAskDs, datastore.NewKey("latest-ask"), h.StorageDependencies.ProviderNode,
Expand Down