Skip to content

Commit

Permalink
Merge pull request #7749 from filecoin-project/gstuart/sort-lotus-min…
Browse files Browse the repository at this point in the history
…er-retrieval-deals

Sort lotus-miner retrieval-deals by dealId
  • Loading branch information
magik6k authored Dec 10, 2021
2 parents 36f1a8f + 21e6c96 commit a0d76bd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/lotus-miner/retrieval-deals.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"fmt"
"os"
"sort"
"text/tabwriter"

"github.com/docker/go-units"
Expand Down Expand Up @@ -137,6 +138,10 @@ var retrievalDealsListCmd = &cli.Command{
return err
}

sort.Slice(deals, func(i, j int) bool {
return deals[i].ID < deals[j].ID
})

w := tabwriter.NewWriter(os.Stdout, 2, 4, 2, ' ', 0)

_, _ = fmt.Fprintf(w, "Receiver\tDealID\tPayload\tState\tPricePerByte\tBytesSent\tMessage\n")
Expand Down

0 comments on commit a0d76bd

Please sign in to comment.