BCHA has 8 decimal places, and the value "8" is occasionally used in calculation that convert between BCHA and satoshis. This diff replaces "8" with a constant in Ticker.js to support potential adjustments to this value. Note: this diff does not completely prepare the app to support different decimal places. An additional diff is required that would remove use of the .toSatoshis function from bch-js and replace it with a generalized conversion function.
Details
Details
- Reviewers
Fabien - Group Reviewers
Restricted Project - Commits
- rABCe06b0ec4e874: [Cashtab] replace BCHA decimal unit with a constant
npm test
Diff Detail
Diff Detail
- Repository
- rABC Bitcoin ABC
- Branch
- bcha-decimals-to-constant
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 14976 Build 29904: Build Diff cashtab-tests Build 29903: arc lint + arc unit
Event Timeline
Comment Actions
Why did you choose to call it currency.cashDecimals and not just currency.decimals ? Could it be confused with something else ?
web/cashtab/src/utils/validation.js | ||
---|---|---|
41 ↗ | (On Diff #27298) | Nit: you should remove this comment, it brings no value and has the hardcoded number of decimals |
Comment Actions
There is a .decimals parameter for token utxos, which can be between 0 and 9 inclusive depending on the SLPA token. I wanted to avoid duplicating this key, which is used directly on the SendToken.js page.