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

Add a command to get the fees of a deal #5307

Merged
merged 1 commit into from
Apr 29, 2021
Merged

Add a command to get the fees of a deal #5307

merged 1 commit into from
Apr 29, 2021

Conversation

arajasek
Copy link
Contributor

@arajasek arajasek commented Jan 8, 2021

Fixes #5294

cli/state.go Outdated
}

var stateGetDealSetCmd = &cli.Command{
Name: "get-deal",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

state deal get-deal? I'd make it just state deal get.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, that's better

cli/state.go Outdated
}

var stateDealFeesCmd = &cli.Command{
Name: "get-fees",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fees?

cli/state.go Outdated
ht = ts.Height()
}

if pdrStr := cctx.String("provider"); pdrStr != "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if pdrStr := cctx.String("provider"); pdrStr != "" {
if cctx.IsSet("provider") {

chain/actors/builtin/market/market.go Show resolved Hide resolved
cli/state.go Outdated
Flags: []cli.Flag{
&cli.StringFlag{
Name: "provider",
Usage: "provider whose outstanding fees you'd like to recover",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recover?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to calculate

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kubuxu this looks good to you now?

cli/state.go Outdated
return fmt.Errorf("failed to parse provider: %w", err)
}

deals, err := api.StateMarketDeals(ctx, ts.Key())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd avoid this API call, it will return all the milions of deals in the market actor, calling it with curl the response is 366M and takes 1.5min

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arajasek thoughts on this?

@arajasek
Copy link
Contributor Author

Discussion summary: Make this a shed command (since it's gonna be slooowww). The CLI command itself should be better, perhaps using markets info as source of truth.

@arajasek
Copy link
Contributor Author

Now just a shed command

@magik6k magik6k merged commit a55168a into master Apr 29, 2021
@magik6k magik6k deleted the asr/deal-dues branch April 29, 2021 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Miners would like to see outstanding FIL receivables for deals.
4 participants