Merge pull request #7749 from filecoin-project/gstuart/sort-lotus-miner-retrieval-deals

Sort lotus-miner retrieval-deals by dealId
This commit is contained in:
Łukasz Magiera 2021-12-10 12:16:00 +01:00 committed by GitHub
commit a0d76bda99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,7 @@ package main
import (
"fmt"
"os"
"sort"
"text/tabwriter"
"github.com/docker/go-units"
@ -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")