diff --git a/storagemarket/impl/providerstates/provider_states.go b/storagemarket/impl/providerstates/provider_states.go index d864d348..9bf07b33 100644 --- a/storagemarket/impl/providerstates/provider_states.go +++ b/storagemarket/impl/providerstates/provider_states.go @@ -210,8 +210,7 @@ func PublishDeal(ctx fsm.Context, environment ProviderDealEnvironment, deal stor Ref: deal.Ref, } - // TODO: PublishDeals does not return the deal id, change API - _, mcid, err := environment.Node().PublishDeals(ctx.Context(), smDeal) + mcid, err := environment.Node().PublishDeals(ctx.Context(), smDeal) if err != nil { return ctx.Trigger(storagemarket.ProviderEventNodeErrored, xerrors.Errorf("publishing deal: %w", err)) } diff --git a/storagemarket/testnodes/testnodes.go b/storagemarket/testnodes/testnodes.go index 5970b79e..bcab0ca9 100644 --- a/storagemarket/testnodes/testnodes.go +++ b/storagemarket/testnodes/testnodes.go @@ -225,7 +225,7 @@ type FakeProviderNode struct { } // PublishDeals simulates publishing a deal by adding it to the storage market state -func (n *FakeProviderNode) PublishDeals(ctx context.Context, deal storagemarket.MinerDeal) (abi.DealID, cid.Cid, error) { +func (n *FakeProviderNode) PublishDeals(ctx context.Context, deal storagemarket.MinerDeal) (cid.Cid, error) { if n.PublishDealsError == nil { sd := storagemarket.StorageDeal{ DealProposal: deal.Proposal, @@ -234,9 +234,9 @@ func (n *FakeProviderNode) PublishDeals(ctx context.Context, deal storagemarket. n.SMState.AddDeal(sd) - return 0, shared_testutil.GenerateCids(1)[0], nil + return shared_testutil.GenerateCids(1)[0], nil } - return 0, cid.Undef, n.PublishDealsError + return cid.Undef, n.PublishDealsError } // ListProviderDeals returns the deals in the storage market state diff --git a/storagemarket/types.go b/storagemarket/types.go index 39597a1b..43297334 100644 --- a/storagemarket/types.go +++ b/storagemarket/types.go @@ -369,8 +369,8 @@ type StorageProviderNode interface { GetChainHead(ctx context.Context) (shared.TipSetToken, abi.ChainEpoch, error) - // Publishes deal on chain - PublishDeals(ctx context.Context, deal MinerDeal) (abi.DealID, cid.Cid, error) + // Publishes deal on chain, returns the message cid, but does not wait for message to appear + PublishDeals(ctx context.Context, deal MinerDeal) (cid.Cid, error) // ListProviderDeals lists all deals associated with a storage provider ListProviderDeals(ctx context.Context, addr address.Address, tok shared.TipSetToken) ([]StorageDeal, error)