Skip to content

Commit

Permalink
Merge branch 'master' into feat/wip-markets-dagstore
Browse files Browse the repository at this point in the history
  • Loading branch information
raulk committed Aug 5, 2021
2 parents fae9419 + b7a9091 commit b5fdee3
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# go-fil-markets changelog

# go-fil-markets v1.7.0

- Pass deal proposal instead of deal ID to OnDealExpiredOrSlashed (#476) ([filecoin-project/go-fil-markets#476](https://github.com/filecoin-project/go-fil-markets/pull/476))

# go-fil-markets v1.6.0

- Add a `StorageDealTransferQueued` event on the storage client that means that the data transfer request has been queued and will be executed soon.
Expand Down
2 changes: 1 addition & 1 deletion storagemarket/impl/clientstates/client_states.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ func WaitForDealCompletion(ctx fsm.Context, environment ClientDealEnvironment, d
}
}

if err := node.OnDealExpiredOrSlashed(ctx.Context(), deal.DealID, expiredCb, slashedCb); err != nil {
if err := node.OnDealExpiredOrSlashed(ctx.Context(), *deal.PublishMessage, deal.Proposal, expiredCb, slashedCb); err != nil {
return ctx.Trigger(storagemarket.ClientEventDealCompletionFailed, err)
}

Expand Down
1 change: 1 addition & 0 deletions storagemarket/impl/clientstates/client_states_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,7 @@ func makeExecutor(ctx context.Context,
dealState, err := tut.MakeTestClientDeal(initialState, clientDealProposal, envParams.manualTransfer)
assert.NoError(t, err)
dealState.AddFundsCid = &tut.GenerateCids(1)[0]
dealState.PublishMessage = &tut.GenerateCids(1)[0]
dealState.FastRetrieval = dealParams.fastRetrieval
dealState.TransferChannelID = &datatransfer.ChannelID{}

Expand Down
2 changes: 1 addition & 1 deletion storagemarket/impl/providerstates/provider_states.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ func WaitForDealCompletion(ctx fsm.Context, environment ProviderDealEnvironment,
}
}

if err := node.OnDealExpiredOrSlashed(ctx.Context(), deal.DealID, expiredCb, slashedCb); err != nil {
if err := node.OnDealExpiredOrSlashed(ctx.Context(), *deal.PublishCid, deal.Proposal, expiredCb, slashedCb); err != nil {
return ctx.Trigger(storagemarket.ProviderEventDealCompletionFailed, err)
}

Expand Down
2 changes: 1 addition & 1 deletion storagemarket/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ type StorageCommon interface {
OnDealSectorCommitted(ctx context.Context, provider address.Address, dealID abi.DealID, sectorNumber abi.SectorNumber, proposal market.DealProposal, publishCid *cid.Cid, cb DealSectorCommittedCallback) error

// OnDealExpiredOrSlashed registers callbacks to be called when the deal expires or is slashed
OnDealExpiredOrSlashed(ctx context.Context, dealID abi.DealID, onDealExpired DealExpiredCallback, onDealSlashed DealSlashedCallback) error
OnDealExpiredOrSlashed(ctx context.Context, publishCid cid.Cid, proposal market.DealProposal, onDealExpired DealExpiredCallback, onDealSlashed DealSlashedCallback) error
}

// PackingResult returns information about how a deal was put into a sector
Expand Down
2 changes: 1 addition & 1 deletion storagemarket/testnodes/testnodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ func (n *FakeCommonNode) OnDealSectorCommitted(ctx context.Context, provider add
}

// OnDealExpiredOrSlashed simulates waiting for a deal to be expired or slashed, but provides stubbed behavior
func (n *FakeCommonNode) OnDealExpiredOrSlashed(ctx context.Context, dealID abi.DealID, onDealExpired storagemarket.DealExpiredCallback, onDealSlashed storagemarket.DealSlashedCallback) error {
func (n *FakeCommonNode) OnDealExpiredOrSlashed(ctx context.Context, publishCid cid.Cid, proposal market.DealProposal, onDealExpired storagemarket.DealExpiredCallback, onDealSlashed storagemarket.DealSlashedCallback) error {
if n.DelayFakeCommonNode.OnDealExpiredOrSlashed {
select {
case <-ctx.Done():
Expand Down

0 comments on commit b5fdee3

Please sign in to comment.