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

accounting: Add desired units to node report query #39

Open
carlaKC opened this issue May 27, 2020 · 0 comments
Open

accounting: Add desired units to node report query #39

carlaKC opened this issue May 27, 2020 · 0 comments

Comments

@carlaKC
Copy link
Contributor

carlaKC commented May 27, 2020

At present, the node report output query provides BTC values quoted in millisatoshis.
Multiple amount fields can be confusing, so rather than add more fields with our new units, we can deprecate the existing field in ReportEntry and replace it with a oneof. Since fiat values are subject to rounding (if we round down to BTC, we likely also want to round down our USD amount), we should paid the amount + fiat fields. Calculation in the actual accounting package should remain in msat, since it provides us with the best level of precision.

Steps to completion

  1. Add a unit enum to NodeReportRequest which defaults to msat but allows satoshis and bitcoin, round accordingly in rpcReportResponse and make sure the headings in the csv file are updated
  2. Deprecate the amount and fiat fields and replace with a oneof:
entryAmount{
  amount = 1;
  fiat = 2;
}

oneOf{
  entryAmount msatAmount =1;
  entryAmount satoshiAmount = 2; 
  entryAmount bitcoinAmount =3; 
}

This change should be mindful of the intention to add other fiat currencies, as detailed in #38

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

No branches or pull requests

1 participant