Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: not set retrieval deal status #391

Merged
merged 2 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion cli/retrieval-deals.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ part statuses:
Name: "discard-failed",
Usage: "filter errored deal",
},
&cli.BoolFlag{
Name: "verbose",
Aliases: []string{"v"},
},
},
Action: func(cctx *cli.Context) error {
api, closer, err := NewMarketNode(cctx)
Expand Down Expand Up @@ -101,12 +105,15 @@ part statuses:

for _, deal := range deals {
payloadCid := deal.PayloadCID.String()
if !cctx.Bool("verbose") {
payloadCid = "..." + payloadCid[len(payloadCid)-8:]
}

_, _ = fmt.Fprintf(w,
"%s\t%d\t%s\t%s\t%s\t%d\t%d\t%d\t%s\n",
deal.Receiver.String(),
deal.ID,
"..."+payloadCid[len(payloadCid)-8:],
payloadCid,
retrievalmarket.DealStatuses[deal.Status],
deal.PricePerByte.String(),
deal.TotalSent,
Expand Down
5 changes: 4 additions & 1 deletion retrievalprovider/datatransfer_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,11 @@ func (d *DataTransferHandler) HandleCancelForDeal(ctx context.Context, identifie
if deal.Status != rm.DealStatusFailing {
deal.Message = "Client cancelled retrieval"
}
if err := d.retrievalDealHandler.CancelDeal(ctx, deal); err != nil {
return err
}
}
return d.retrievalDealStore.SaveDeal(ctx, deal)
return nil
}

func (d *DataTransferHandler) HandleErrorForDeal(ctx context.Context, identifier rm.ProviderDealIdentifier, errIn error) error {
Expand Down