Skip to content

Commit

Permalink
Pass PublishCID (#441)
Browse files Browse the repository at this point in the history
* feat(nodes): pass PublishCID

add PublishCID parameter to OnDealSectorCommitted

* feat(storagemarket): pass proposal CID

Pass the deal proposal CID to OnDealSectorCommitted

* feat(storagemarket): switch to deal proposal

switch from proposal CID to deal proposal for OnDealSectorCommitted
  • Loading branch information
hannahhoward authored Nov 10, 2020
1 parent 600a767 commit d8b8581
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion storagemarket/impl/clientstates/client_states.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ func VerifyDealActivated(ctx fsm.Context, environment ClientDealEnvironment, dea
}
}

if err := environment.Node().OnDealSectorCommitted(ctx.Context(), deal.Proposal.Provider, deal.DealID, cb); err != nil {
if err := environment.Node().OnDealSectorCommitted(ctx.Context(), deal.Proposal.Provider, deal.DealID, deal.Proposal, deal.PublishMessage, cb); err != nil {
return ctx.Trigger(storagemarket.ClientEventDealActivationFailed, err)
}

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 @@ -437,7 +437,7 @@ func VerifyDealActivated(ctx fsm.Context, environment ProviderDealEnvironment, d
}
}

err := environment.Node().OnDealSectorCommitted(ctx.Context(), deal.Proposal.Provider, deal.DealID, cb)
err := environment.Node().OnDealSectorCommitted(ctx.Context(), deal.Proposal.Provider, deal.DealID, deal.Proposal, deal.PublishCid, cb)

if err != nil {
return ctx.Trigger(storagemarket.ProviderEventDealActivationFailed, err)
Expand Down
2 changes: 1 addition & 1 deletion storagemarket/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ type StorageCommon interface {
DealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, isVerified bool) (abi.TokenAmount, abi.TokenAmount, error)

// OnDealSectorCommitted waits for a deal's sector to be sealed and proved, indicating the deal is active
OnDealSectorCommitted(ctx context.Context, provider address.Address, dealID abi.DealID, cb DealSectorCommittedCallback) error
OnDealSectorCommitted(ctx context.Context, provider address.Address, dealID abi.DealID, 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
Expand Down
2 changes: 1 addition & 1 deletion storagemarket/testnodes/testnodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (n *FakeCommonNode) DealProviderCollateralBounds(ctx context.Context, size
}

// OnDealSectorCommitted returns immediately, and returns stubbed errors
func (n *FakeCommonNode) OnDealSectorCommitted(ctx context.Context, provider address.Address, dealID abi.DealID, cb storagemarket.DealSectorCommittedCallback) error {
func (n *FakeCommonNode) OnDealSectorCommitted(ctx context.Context, provider address.Address, dealID abi.DealID, proposal market.DealProposal, publishCid *cid.Cid, cb storagemarket.DealSectorCommittedCallback) error {
if n.DelayFakeCommonNode.OnDealSectorCommitted {
select {
case <-ctx.Done():
Expand Down

0 comments on commit d8b8581

Please sign in to comment.