fix(cli): patch for output given fil-markets IsTerminalError ahving a bug

This commit is contained in:
hannahhoward 2021-05-27 11:18:24 -07:00
parent 19b6dc8d1e
commit 9c2467b17c

View File

@ -1296,10 +1296,14 @@ var clientListRetrievalsCmd = &cli.Command{
}, },
} }
func isTerminalError(status retrievalmarket.DealStatus) bool {
// should patch this in go-fil-markets but to solve the problem immediate and not have buggy output
return retrievalmarket.IsTerminalError(status) || status == retrievalmarket.DealStatusErrored
}
func outputRetrievalDeals(ctx context.Context, out io.Writer, localDeals []lapi.RetrievalInfo, verbose bool, color bool, showFailed bool, completed bool) error { func outputRetrievalDeals(ctx context.Context, out io.Writer, localDeals []lapi.RetrievalInfo, verbose bool, color bool, showFailed bool, completed bool) error {
var deals []api.RetrievalInfo var deals []api.RetrievalInfo
for _, deal := range localDeals { for _, deal := range localDeals {
if !showFailed && retrievalmarket.IsTerminalError(deal.Status) { if !showFailed && isTerminalError(deal.Status) {
continue continue
} }
if !completed && retrievalmarket.IsTerminalSuccess(deal.Status) { if !completed && retrievalmarket.IsTerminalSuccess(deal.Status) {
@ -1387,7 +1391,7 @@ func retrievalStatusString(c bool, status retrievalmarket.DealStatus) string {
return s return s
} }
if retrievalmarket.IsTerminalError(status) { if isTerminalError(status) {
return color.RedString(s) return color.RedString(s)
} }
if retrievalmarket.IsTerminalSuccess(status) { if retrievalmarket.IsTerminalSuccess(status) {