Skip to content

Commit

Permalink
short circuit deals with no stages
Browse files Browse the repository at this point in the history
  • Loading branch information
nonsense committed Mar 29, 2021
1 parent f7eff6c commit 91f3bb9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cli/deal/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ func renderDeal(di lapi.DealInfo) {
color.Blue("Deal ID: %d\n", int(di.DealID))
color.Blue("Proposal CID: %s\n\n", di.ProposalCid.String())

if di.DealStages == nil {
color.YellowString("Deal was made with an older version of Lotus and Lotus did not collect detailed information about its stages")
return
}

for _, stg := range di.DealStages.Stages {
msg := fmt.Sprintf("%s %s: %s (%s)", color.BlueString("Stage:"), color.BlueString(strings.TrimPrefix(stg.Name, "StorageDeal")), stg.Description, color.GreenString(stg.ExpectedDuration))
if stg.UpdatedTime.Time().IsZero() {
Expand Down

0 comments on commit 91f3bb9

Please sign in to comment.