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

Update for go-data-transfer v1.13.0 #663

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# go-fil-markets changelog

# go-fil-markets v1.16.0

- github.com/filecoin-project/go-fil-markets:
- fix: add string value for ClientEventCIDMissing
- feat(deps): update for go-data-transfer v1.13.0

Contributors

| Contributor | Commits | Lines ± | Files Changed |
|-------------|---------|---------|---------------|
| hannahhoward | 1 | +226/-104 | 21 |
| Dirk McCormick | 1 | +5/-4 | 4 |

# go-fil-markets v1.15.0

- github.com/filecoin-project/go-fil-markets:
Expand Down
1 change: 1 addition & 0 deletions docs/retrievalclient.mmd
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ stateDiagram-v2
ClientEventWriteDealPaymentErrored - transitions state to DealStatusErroring
ClientEventProviderCancelled - transitions state to DealStatusCancelling
ClientEventCancel - transitions state to DealStatusCancelling
ClientEventCIDMissing - just records
end note
DealStatusNew --> DealStatusNew : ClientEventOpen
DealStatusNew --> DealStatusWaitForAcceptance : ClientEventDealProposed
Expand Down
Binary file modified docs/retrievalclient.mmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/retrievalclient.mmd.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/filecoin-project/go-address v0.0.5
github.com/filecoin-project/go-cbor-util v0.0.0-20191219014500-08c40a1e63a2
github.com/filecoin-project/go-commp-utils v0.1.3
github.com/filecoin-project/go-data-transfer v1.12.1
github.com/filecoin-project/go-data-transfer v1.13.0
github.com/filecoin-project/go-ds-versioning v0.1.1
github.com/filecoin-project/go-fil-commcid v0.1.0
github.com/filecoin-project/go-fil-commp-hashhash v0.1.0
Expand All @@ -28,7 +28,7 @@ require (
github.com/ipfs/go-cidutil v0.0.2
github.com/ipfs/go-datastore v0.5.1
github.com/ipfs/go-filestore v1.1.0
github.com/ipfs/go-graphsync v0.11.5
github.com/ipfs/go-graphsync v0.12.0
github.com/ipfs/go-ipfs-blockstore v1.1.2
github.com/ipfs/go-ipfs-blocksutil v0.0.1
github.com/ipfs/go-ipfs-chunker v0.0.5
Expand All @@ -42,7 +42,7 @@ require (
github.com/ipfs/go-unixfs v0.3.1
github.com/ipld/go-car v0.3.3-0.20211210032800-e6f244225a16
github.com/ipld/go-car/v2 v2.1.1
github.com/ipld/go-ipld-prime v0.14.3
github.com/ipld/go-ipld-prime v0.14.4
github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c
github.com/jpillora/backoff v1.0.0
github.com/libp2p/go-libp2p v0.17.0
Expand Down
13 changes: 10 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ github.com/Kubuxu/go-os-helper v0.0.1/go.mod h1:N8B+I7vPCT80IcP58r50u4+gEEcsZETF
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
github.com/Stebalien/go-bitfield v0.0.1 h1:X3kbSSPUaJK60wV2hjOPZwmpljr6VGCqdq4cBLhbQBo=
github.com/Stebalien/go-bitfield v0.0.1/go.mod h1:GNjFpasyUVkHMsfEOk8EFLJ9syQ6SI+XWrX9Wf2XH0s=
github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g=
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
Expand Down Expand Up @@ -205,8 +206,9 @@ github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03 h1:2pMX
github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03/go.mod h1:+viYnvGtUTgJRdy6oaeF4MTFKAfatX071MPDPBL11EQ=
github.com/filecoin-project/go-dagaggregator-unixfs v0.2.0/go.mod h1:WTuJWgBQY0omnQqa8kRPT9O0Uj5wQOgslVMUuTeHdJ8=
github.com/filecoin-project/go-data-transfer v1.11.4/go.mod h1:2MitLI0ebCkLlPKM7NRggP/t9d+gCcREUKkCKqWRCwU=
github.com/filecoin-project/go-data-transfer v1.12.1 h1:gAznAZKySVs2FS6T/vDq7R3f0DewLnxeROe0oOE6bZU=
github.com/filecoin-project/go-data-transfer v1.12.1/go.mod h1:j3HL645YiQFxcM+q7uPlGApILSqeweDABNgZQP7pDYU=
github.com/filecoin-project/go-data-transfer v1.13.0 h1:UqjBfacClqAmnzukek1oPxJXDM3l5UI/WX8CRN2/VkM=
github.com/filecoin-project/go-data-transfer v1.13.0/go.mod h1:TcUtAdQl1ofnLV9oH3gPC93Hjce9yuKnq4O4j2M/BU4=
github.com/filecoin-project/go-ds-versioning v0.0.0-20211206185234-508abd7c2aff/go.mod h1:C9/l9PnB1+mwPa26BBVpCjG/XQCB0yj/q5CK2J8X1I4=
github.com/filecoin-project/go-ds-versioning v0.1.0/go.mod h1:mp16rb4i2QPmxBnmanUx8i/XANp+PFCCJWiAb+VW4/s=
github.com/filecoin-project/go-ds-versioning v0.1.1 h1:JiyBqaQlwC+UM0WhcBtVEeT3XrX59mQhT8U3p7nu86o=
Expand Down Expand Up @@ -519,8 +521,9 @@ github.com/ipfs/go-filestore v1.1.0/go.mod h1:6e1/5Y6NvLuCRdmda/KA4GUhXJQ3Uat6vc
github.com/ipfs/go-fs-lock v0.0.7/go.mod h1:Js8ka+FNYmgQRLrRXzU3CB/+Csr1BwrRilEcvYrHhhc=
github.com/ipfs/go-graphsync v0.10.0/go.mod h1:cKIshzTaa5rCZjryH5xmSKZVGX9uk1wvwGvz2WEha5Y=
github.com/ipfs/go-graphsync v0.11.0/go.mod h1:wC+c8vGVjAHthsVIl8LKr37cUra2GOaMYcQNNmMxDqE=
github.com/ipfs/go-graphsync v0.11.5 h1:WA5hVxGBtcal6L6nqubKiqRolaZxbexOK3GumGFJRR4=
github.com/ipfs/go-graphsync v0.11.5/go.mod h1:+/sZqRwRCQRrV7NCzgBtufmr5QGpUE98XSa7NlsztmM=
github.com/ipfs/go-graphsync v0.12.0 h1:QCsVHVzb9FTkcm3NEa8GjXnUeGit1L9s08HcSVQ4m/g=
github.com/ipfs/go-graphsync v0.12.0/go.mod h1:nASYWYETgsnMbQ3+DirNImOHQ8TY0a5AhAqyOY55tUg=
github.com/ipfs/go-hamt-ipld v0.1.1/go.mod h1:1EZCr2v0jlCnhpa+aZ0JZYp8Tt2w16+JJOAVz17YcDk=
github.com/ipfs/go-ipfs v0.11.0/go.mod h1:g68Thu2Ho11AWoHsN34P5fSK7iA6OWWRy3T/g8HLixc=
github.com/ipfs/go-ipfs-blockstore v0.0.1/go.mod h1:d3WClOmRQKFnJ0Jz/jj/zmksX0ma1gROTlovZKBmN08=
Expand Down Expand Up @@ -638,6 +641,8 @@ github.com/ipfs/go-unixfs v0.3.1 h1:LrfED0OGfG98ZEegO4/xiprx2O+yS+krCMQSp7zLVv8=
github.com/ipfs/go-unixfs v0.3.1/go.mod h1:h4qfQYzghiIc8ZNFKiLMFWOTzrWIAtzYQ59W/pCFf1o=
github.com/ipfs/go-unixfsnode v1.1.2/go.mod h1:5dcE2x03pyjHk4JjamXmunTMzz+VUtqvPwZjIEkfV6s=
github.com/ipfs/go-unixfsnode v1.1.3/go.mod h1:ZZxUM5wXBC+G0Co9FjrYTOm+UlhZTjxLfRYdWY9veZ4=
github.com/ipfs/go-unixfsnode v1.2.0 h1:tHHBJftsJyHGa8bS62PpkYNqHy/Sug3c/vxxC8NaGQY=
github.com/ipfs/go-unixfsnode v1.2.0/go.mod h1:mQEgLjxkV/1mohkC4p7taRRBYPBeXu97SA3YaerT2q0=
github.com/ipfs/go-verifcid v0.0.1 h1:m2HI7zIuR5TFyQ1b79Da5N9dnnCP1vcu2QqawmWlK2E=
github.com/ipfs/go-verifcid v0.0.1/go.mod h1:5Hrva5KBeIog4A+UpqlaIU+DEstipcJYQQZc0g37pY0=
github.com/ipfs/interface-go-ipfs-core v0.4.0/go.mod h1:UJBcU6iNennuI05amq3FQ7g0JHUkibHFAfhfUIy927o=
Expand All @@ -661,8 +666,9 @@ github.com/ipld/go-ipld-prime v0.14.0/go.mod h1:9ASQLwUFLptCov6lIYc70GRB4V7UTyLD
github.com/ipld/go-ipld-prime v0.14.1/go.mod h1:QcE4Y9n/ZZr8Ijg5bGPT0GqYWgZ1704nH0RDcQtgTP0=
github.com/ipld/go-ipld-prime v0.14.2/go.mod h1:QcE4Y9n/ZZr8Ijg5bGPT0GqYWgZ1704nH0RDcQtgTP0=
github.com/ipld/go-ipld-prime v0.14.3-0.20211207234443-319145880958/go.mod h1:QcE4Y9n/ZZr8Ijg5bGPT0GqYWgZ1704nH0RDcQtgTP0=
github.com/ipld/go-ipld-prime v0.14.3 h1:cGUmxSws2IHurn00/iLMDapeXsnf9+FyAtYVy8G/JsQ=
github.com/ipld/go-ipld-prime v0.14.3/go.mod h1:QcE4Y9n/ZZr8Ijg5bGPT0GqYWgZ1704nH0RDcQtgTP0=
github.com/ipld/go-ipld-prime v0.14.4 h1:bqhmume8+nbNsX4/+J6eohktfZHAI8GKrF3rQ0xgOyc=
github.com/ipld/go-ipld-prime v0.14.4/go.mod h1:QcE4Y9n/ZZr8Ijg5bGPT0GqYWgZ1704nH0RDcQtgTP0=
github.com/ipld/go-ipld-prime-proto v0.0.0-20191113031812-e32bd156a1e5/go.mod h1:gcvzoEDBjwycpXt3LBE061wT9f46szXGHAmj9uoP6fU=
github.com/ipld/go-ipld-prime/storage/bsadapter v0.0.0-20211210234204-ce2a1c70cd73 h1:TsyATB2ZRRQGTwafJdgEUQkmjOExRV0DNokcihZxbnQ=
github.com/ipld/go-ipld-prime/storage/bsadapter v0.0.0-20211210234204-ce2a1c70cd73/go.mod h1:2PJ0JgxyB08t0b2WKrcuqI3di0V+5n6RS/LTUJhkoxY=
Expand Down Expand Up @@ -1211,6 +1217,7 @@ github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPw
github.com/multiformats/go-multicodec v0.2.0/go.mod h1:/y4YVwkfMyry5kFbMTbLJKErhycTIftytRV+llXdyS4=
github.com/multiformats/go-multicodec v0.3.0/go.mod h1:qGGaQmioCDh+TeFOnxrbU0DaIPw8yFgAZgFG0V7p1qQ=
github.com/multiformats/go-multicodec v0.3.1-0.20210902112759-1539a079fd61/go.mod h1:1Hj/eHRaVWSXiSNNfcEPcwZleTmdNP81xlxDLnWU9GQ=
github.com/multiformats/go-multicodec v0.3.1-0.20211210143421-a526f306ed2c/go.mod h1:1Hj/eHRaVWSXiSNNfcEPcwZleTmdNP81xlxDLnWU9GQ=
github.com/multiformats/go-multicodec v0.4.0 h1:fbqb6ky7erjdD+/zaEBJgZWu1i8D6i/wmPywGK7sdow=
github.com/multiformats/go-multicodec v0.4.0/go.mod h1:1Hj/eHRaVWSXiSNNfcEPcwZleTmdNP81xlxDLnWU9GQ=
github.com/multiformats/go-multihash v0.0.1/go.mod h1:w/5tugSrLEbWqlcgJabL3oHFKTwfvkofsjW2Qa1ct4U=
Expand Down
5 changes: 5 additions & 0 deletions retrievalmarket/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ const (
// ClientEventFinalizeBlockstoreErrored is fired when there is an error
// finalizing the blockstore
ClientEventFinalizeBlockstoreErrored

// ClientEventCIDMissing is fired when data transfer reports a cid was
// missing from the remote on the server
ClientEventCIDMissing
)

// ClientEvents is a human readable map of client event name -> event description
Expand Down Expand Up @@ -181,6 +185,7 @@ var ClientEvents = map[ClientEvent]string{
ClientEventPaymentNotSent: "ClientEventPaymentNotSent",
ClientEventBlockstoreFinalized: "ClientEventBlockstoreFinalized",
ClientEventFinalizeBlockstoreErrored: "ClientEventFinalizeBlockstoreErrored",
ClientEventCIDMissing: "ClientEventCIDMissing",
}

func (e ClientEvent) String() string {
Expand Down
6 changes: 6 additions & 0 deletions retrievalmarket/impl/clientstates/client_fsm.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,12 @@ var ClientEvents = fsm.Events{

// payment channel receives more money, we believe there may be reason to recheck the funds for this channel
fsm.Event(rm.ClientEventRecheckFunds).From(rm.DealStatusInsufficientFunds).To(rm.DealStatusCheckFunds),

// data transfer reports a CID was missing
fsm.Event(rm.ClientEventCIDMissing).FromAny().ToJustRecord().Action(func(deal *rm.ClientDealState) error {
deal.HasMissingCids = true
return nil
}),
}

// ClientFinalityStates are terminal states after which no further events are received
Expand Down
10 changes: 10 additions & 0 deletions retrievalmarket/impl/clientstates/client_states_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,16 @@ func TestProposeDeal(t *testing.T) {
})
}

func TestMissingCIDEvent(t *testing.T) {
ctx := context.Background()
eventMachine, err := fsm.NewEventProcessor(retrievalmarket.ClientDealState{}, "Status", clientstates.ClientEvents)
require.NoError(t, err)
fsmCtx := fsmtest.NewTestContext(ctx, eventMachine)
fsmCtx.Trigger(retrievalmarket.ClientEventCIDMissing)
dealState := makeDealState(retrievalmarket.DealStatusOngoing)
fsmCtx.ReplayEvents(t, dealState)
require.True(t, dealState.HasMissingCids)
}
func TestSetupPaymentChannel(t *testing.T) {
ctx := context.Background()
expectedPayCh := address.TestAddress2
Expand Down
4 changes: 3 additions & 1 deletion retrievalmarket/impl/dtutils/dtutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func ProviderDataTransferSubscriber(deals EventReceiver) datatransfer.Subscriber
return
}

if channelState.Status() == datatransfer.Completed {
if channelState.Status() == datatransfer.Completed || channelState.Status() == datatransfer.PartiallyCompleted {
err := deals.Send(rm.ProviderDealIdentifier{DealID: dealProposal.ID, Receiver: channelState.Recipient()}, rm.ProviderEventComplete)
if err != nil {
log.Errorf("processing dt event: %s", err)
Expand Down Expand Up @@ -123,6 +123,8 @@ func clientEvent(event datatransfer.Event, channelState datatransfer.ChannelStat
return rm.ClientEventDealRejected, []interface{}{"rejected for unknown reasons"}
}
return rm.ClientEventDataTransferError, []interface{}{fmt.Errorf("deal data transfer failed: %s", event.Message)}
case datatransfer.CIDMissing:
return rm.ClientEventCIDMissing, nil
default:
}

Expand Down
23 changes: 22 additions & 1 deletion retrievalmarket/impl/dtutils/dtutils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,18 @@ func TestProviderDataTransferSubscriber(t *testing.T) {
expectedID: rm.ProviderDealIdentifier{DealID: dealProposal.ID, Receiver: testPeers[1]},
expectedEvent: rm.ProviderEventComplete,
},
"partially completed": {
code: datatransfer.ResumeResponder,
state: shared_testutil.TestChannelParams{
IsPull: true,
TransferID: transferID,
Sender: testPeers[0],
Recipient: testPeers[1],
Vouchers: []datatransfer.Voucher{&dealProposal},
Status: datatransfer.PartiallyCompleted},
expectedID: rm.ProviderDealIdentifier{DealID: dealProposal.ID, Receiver: testPeers[1]},
expectedEvent: rm.ProviderEventComplete,
},
"cancel": {
code: datatransfer.Cancel,
state: shared_testutil.TestChannelParams{
Expand All @@ -124,7 +136,7 @@ func TestProviderDataTransferSubscriber(t *testing.T) {
Sender: testPeers[0],
Recipient: testPeers[1],
Vouchers: []datatransfer.Voucher{&dealProposal},
Status: datatransfer.Completed},
Status: datatransfer.Ongoing},
expectedID: rm.ProviderDealIdentifier{DealID: dealProposal.ID, Receiver: testPeers[1]},
expectedEvent: rm.ProviderEventClientCancelled,
},
Expand Down Expand Up @@ -183,6 +195,15 @@ func TestClientDataTransferSubscriber(t *testing.T) {
expectedEvent: rm.ClientEventBlocksReceived,
expectedArgs: []interface{}{uint64(1000)},
},
"missing cid": {
code: datatransfer.CIDMissing,
state: shared_testutil.TestChannelParams{
Vouchers: []datatransfer.Voucher{&dealProposal},
Status: datatransfer.Ongoing,
Received: 1000},
expectedID: dealProposal.ID,
expectedEvent: rm.ClientEventCIDMissing,
},
"finish transfer": {
code: datatransfer.FinishTransfer,
state: shared_testutil.TestChannelParams{
Expand Down
16 changes: 8 additions & 8 deletions retrievalmarket/impl/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ func requireSetupTestClientAndProvider(ctx context.Context, t *testing.T, payChA
})

gs1 := graphsyncimpl.New(ctx, network.NewFromLibp2pHost(testData.Host1), testData.LinkSystem1)
dtTransport1 := dtgstransport.NewTransport(testData.Host1.ID(), gs1, testData.DTNet1)
dt1, err := dtimpl.NewDataTransfer(testData.DTStore1, testData.DTTmpDir1, testData.DTNet1, dtTransport1)
dtTransport1 := dtgstransport.NewTransport(testData.Host1.ID(), gs1)
dt1, err := dtimpl.NewDataTransfer(testData.DTStore1, testData.DTNet1, dtTransport1)
require.NoError(t, err)
testutil.StartAndWaitForReady(ctx, t, dt1)
require.NoError(t, err)
Expand Down Expand Up @@ -162,8 +162,8 @@ func requireSetupTestClientAndProvider(ctx context.Context, t *testing.T, payChA
paymentAddress := address.TestAddress2

gs2 := graphsyncimpl.New(ctx, network.NewFromLibp2pHost(testData.Host2), testData.LinkSystem2)
dtTransport2 := dtgstransport.NewTransport(testData.Host2.ID(), gs2, testData.DTNet2)
dt2, err := dtimpl.NewDataTransfer(testData.DTStore2, testData.DTTmpDir2, testData.DTNet2, dtTransport2)
dtTransport2 := dtgstransport.NewTransport(testData.Host2.ID(), gs2)
dt2, err := dtimpl.NewDataTransfer(testData.DTStore2, testData.DTNet2, dtTransport2)
require.NoError(t, err)
testutil.StartAndWaitForReady(ctx, t, dt2)
require.NoError(t, err)
Expand Down Expand Up @@ -654,8 +654,8 @@ func setupClient(
})

gs1 := graphsyncimpl.New(ctx, network.NewFromLibp2pHost(testData.Host1), testData.LinkSystem1)
dtTransport1 := dtgstransport.NewTransport(testData.Host1.ID(), gs1, testData.DTNet1)
dt1, err := dtimpl.NewDataTransfer(testData.DTStore1, testData.DTTmpDir1, testData.DTNet1, dtTransport1)
dtTransport1 := dtgstransport.NewTransport(testData.Host1.ID(), gs1)
dt1, err := dtimpl.NewDataTransfer(testData.DTStore1, testData.DTNet1, dtTransport1)
require.NoError(t, err)
testutil.StartAndWaitForReady(ctx, t, dt1)
require.NoError(t, err)
Expand Down Expand Up @@ -694,8 +694,8 @@ func setupProvider(
pieceStore.ExpectPiece(expectedPiece, pieceInfo)

gs2 := graphsyncimpl.New(ctx, network.NewFromLibp2pHost(testData.Host2), testData.LinkSystem2)
dtTransport2 := dtgstransport.NewTransport(testData.Host2.ID(), gs2, testData.DTNet2)
dt2, err := dtimpl.NewDataTransfer(testData.DTStore2, testData.DTTmpDir2, testData.DTNet2, dtTransport2)
dtTransport2 := dtgstransport.NewTransport(testData.Host2.ID(), gs2)
dt2, err := dtimpl.NewDataTransfer(testData.DTStore2, testData.DTNet2, dtTransport2)
require.NoError(t, err)
testutil.StartAndWaitForReady(ctx, t, dt2)
require.NoError(t, err)
Expand Down
8 changes: 4 additions & 4 deletions retrievalmarket/retrieval_restart_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ func TestBounceConnectionDealTransferOngoing(t *testing.T) {
td := shared_testutil.NewLibp2pTestData(bgCtx, t)
td.DTNet1 = dtnet.NewFromLibp2pHost(td.Host1, dtClientNetRetry)
depGen := dependencies.NewDepGenerator()
depGen.ClientNewDataTransfer = func(ds datastore.Batching, dir string, transferNetwork dtnet.DataTransferNetwork, transport datatransfer.Transport) (datatransfer.Manager, error) {
return dtimpl.NewDataTransfer(ds, dir, transferNetwork, transport, restartConf)
depGen.ClientNewDataTransfer = func(ds datastore.Batching, transferNetwork dtnet.DataTransferNetwork, transport datatransfer.Transport) (datatransfer.Manager, error) {
return dtimpl.NewDataTransfer(ds, transferNetwork, transport, restartConf)
}
deps := depGen.New(t, bgCtx, td, testnodes.NewStorageMarketState(), "", noOpDelay, noOpDelay)
providerNode := testnodes2.NewTestRetrievalProviderNode()
Expand Down Expand Up @@ -227,8 +227,8 @@ func TestBounceConnectionDealTransferUnsealing(t *testing.T) {
td := shared_testutil.NewLibp2pTestData(bgCtx, t)
td.DTNet1 = dtnet.NewFromLibp2pHost(td.Host1, dtClientNetRetry)
depGen := dependencies.NewDepGenerator()
depGen.ClientNewDataTransfer = func(ds datastore.Batching, dir string, transferNetwork dtnet.DataTransferNetwork, transport datatransfer.Transport) (datatransfer.Manager, error) {
return dtimpl.NewDataTransfer(ds, dir, transferNetwork, transport, restartConf)
depGen.ClientNewDataTransfer = func(ds datastore.Batching, transferNetwork dtnet.DataTransferNetwork, transport datatransfer.Transport) (datatransfer.Manager, error) {
return dtimpl.NewDataTransfer(ds, transferNetwork, transport, restartConf)
}
deps := depGen.New(t, bgCtx, td, testnodes.NewStorageMarketState(), "", noOpDelay, noOpDelay)
providerNode := testnodes2.NewTestRetrievalProviderNode()
Expand Down
1 change: 1 addition & 0 deletions retrievalmarket/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ type ClientDealState struct {
WaitMsgCID *cid.Cid // the CID of any message the client deal is waiting for
VoucherShortfall abi.TokenAmount
LegacyProtocol bool
HasMissingCids bool
}

func (deal *ClientDealState) NextInterval() uint64 {
Expand Down
36 changes: 35 additions & 1 deletion retrievalmarket/types_cbor_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 0 additions & 11 deletions shared_testutil/mocknet.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ type Libp2pTestData struct {
DTNet2 dtnet.DataTransferNetwork
DTStore1 datastore.Batching
DTStore2 datastore.Batching
DTTmpDir1 string
DTTmpDir2 string
LinkSystem1 ipld.LinkSystem
LinkSystem2 ipld.LinkSystem
Host1 host.Host
Expand Down Expand Up @@ -91,15 +89,6 @@ func NewLibp2pTestData(ctx context.Context, t *testing.T) *Libp2pTestData {
testData.DTStore1 = namespace.Wrap(testData.Ds1, datastore.NewKey("DataTransfer1"))
testData.DTStore2 = namespace.Wrap(testData.Ds1, datastore.NewKey("DataTransfer2"))

testData.DTTmpDir1, err = ioutil.TempDir("", "dt-tmp-1")
require.NoError(t, err)
testData.DTTmpDir2, err = ioutil.TempDir("", "dt-tmp-2")
require.NoError(t, err)
t.Cleanup(func() {
_ = os.RemoveAll(testData.DTTmpDir1)
_ = os.RemoveAll(testData.DTTmpDir2)
})

testData.MockNet = mn

return testData
Expand Down
Loading