Skip to content

Commit

Permalink
include Stages and DealStages only on ClientDealInfo, not on ClientLi…
Browse files Browse the repository at this point in the history
…stDeals
  • Loading branch information
nonsense committed Apr 1, 2021
1 parent 686c719 commit fc5ff8a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 0 additions & 1 deletion api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions cli/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2302,6 +2302,9 @@ 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)

renderDeal(di)

return nil
Expand Down
7 changes: 5 additions & 2 deletions node/impl/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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,
}
}

Expand Down

0 comments on commit fc5ff8a

Please sign in to comment.