From df003d44d257c2088536a9ad5ecffcc2d1ea1a43 Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Thu, 1 Apr 2021 16:57:39 +0300 Subject: [PATCH] include Stages and DealStages only on ClientDealInfo, not on ClientListDeals --- api/types.go | 1 - cli/client.go | 6 ++++++ node/impl/client/client.go | 7 +++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/api/types.go b/api/types.go index 34560bcf2..6417ce756 100644 --- a/api/types.go +++ b/api/types.go @@ -72,7 +72,6 @@ func NewDataTransferChannel(hostID peer.ID, channelState datatransfer.ChannelSta BaseCID: channelState.BaseCID(), IsSender: channelState.Sender() == hostID, Message: channelState.Message(), - Stages: channelState.Stages(), } stringer, ok := channelState.Voucher().(fmt.Stringer) if ok { diff --git a/cli/client.go b/cli/client.go index 6f87eadce..14f4fb552 100644 --- a/cli/client.go +++ b/cli/client.go @@ -2302,6 +2302,12 @@ func inspectDealCmd(ctx context.Context, api lapi.FullNode, proposalCid string, return errors.New("you must specify proposal cid or deal id in order to inspect a deal") } + // populate DealInfo.DealStages and DataTransfer.Stages + di, err = api.ClientGetDealInfo(ctx, di.ProposalCid) + if err != nil { + return fmt.Errorf("cannot get deal info for proposal cid: %v", di.ProposalCid) + } + renderDeal(di) return nil diff --git a/node/impl/client/client.go b/node/impl/client/client.go index 6a8308ff4..387057e46 100644 --- a/node/impl/client/client.go +++ b/node/impl/client/client.go @@ -267,10 +267,14 @@ func (a *API) newDealInfo(ctx context.Context, v storagemarket.ClientDeal) api.D // be not found if it's no longer active if err == nil { ch := api.NewDataTransferChannel(a.Host.ID(), state) + ch.Stages = state.Stages() transferCh = &ch } } - return a.newDealInfoWithTransfer(transferCh, v) + + di := a.newDealInfoWithTransfer(transferCh, v) + di.DealStages = v.DealStages + return di } func (a *API) newDealInfoWithTransfer(transferCh *api.DataTransferChannel, v storagemarket.ClientDeal) api.DealInfo { @@ -289,7 +293,6 @@ func (a *API) newDealInfoWithTransfer(transferCh *api.DataTransferChannel, v sto Verified: v.Proposal.VerifiedDeal, TransferChannelID: v.TransferChannelID, DataTransfer: transferCh, - DealStages: v.DealStages, } }