-
Notifications
You must be signed in to change notification settings - Fork 43
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: use integer satoshi quantities #869
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - SATOSHIS_PER_COIN
has a weird ring to it, but I don't have a better name to suggest.
Agree, especially if we use it as generic smallest unit for all coins & tokens. Seems we are not the only ones having troubles to find a sexy name for "smallest unit of a currency" :/ |
Yeah, I'm trying to use "satoshi" in that instance to indicate 10^-8. I don't actually want the smallest unit in that context, since we're trying to cap precision at 8 decimal places anyhow. I'm rebasing this PR onto #852 now that it's merged. |
8fc1b5c
to
17c0dab
Compare
@moshababo I needed to regenerate the go protobuf file for this PR, and I made a few changes to the |
This commit changes all `quantity` values to be represented by integer satoshi amounts (10 ^ -8 of a full unit) rather than fractional/floating full units. This applies both to the internal representations as well as the gRPC API definition. This is done to prevent any rounding errors when adding or subtracting fractional units. Output and arguments for the cli remain unchanged and still deal with full units. Fixes #740. BREAKING CHANGE: Database and p2p field type changes
This modifies the gen_protos.sh script for the simulation tests to use the `protoc` executable that exists within the `node_modules` folder and which we already use to generate static protobuf files for xud. It also uses the existing xudrpc.proto file so that we don't need to maintain duplicate copies of the file within the repository.
17c0dab
to
d6e8aee
Compare
This is the result of running the `proto` npm script, which brings the p2p protobuf files up to date with the changes introduced in #869.
This commit changes all
quantity
values to be represented by integer satoshi amounts (10 ^ -8 of a full unit) rather than fractional/floating full units. This applies both to the internal representations as well asthe gRPC API definition. This is done to prevent any rounding errors when adding or subtracting fractional units.
Output and arguments for the cli remain unchanged and still deal with full units.
Fixes#740.
BREAKING CHANGE: Database and p2p field type changes