Page MenuHomePhabricator

[Cashtab] Patch decimal parsing of params in wallet, extension, and components
ClosedPublic

Authored by bytesofman on Sep 16 2021, 15:09.

Details

Summary

T1865

Replace lingering hardcoded "8"s with the appropriate cashDecimals param. This supports correctly parsing a passed address amount param in satoshis as XEC (and not BCHA).

Because the extension parses such values from cashtab-components, the extension version and components version must both be bumped with this update.

Test Plan

npm start

  1. Copy paste this string into the XEC Address field: ecash:qpmrf4857pu2pvn8hwdh0y64wwdmxqh7jc85c2zf3w?amount=2004016
  1. Verify that the app autocompletes 20040.16 in the XEC send field
  1. Run the latest version of the browser extension locally

npm run extension
Navigate to brave://extensions
Click "Load Unpacked" and select the /web/cashtab/extension/dist folder, or click "Update" if this is already in your extensions; should be version 1.0.2
Disable the production version of the extension so only the local version is running

  1. Load cashtab-components locally
cd /web/cashtab-components
npm i
npm run storybook
  1. Click on the dark blue button on various "CashtabBadge" components; verify that the extension loads with the correct XEC send amount

Diff Detail

Repository
rABC Bitcoin ABC
Branch
param-parse-patch
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 16679
Build 33213: Build Diffcashtab-tests · cashtab-components-tests
Build 33212: arc lint + arc unit

Event Timeline

Note that Electrum ABC switched back to using the base unit (now XEC) in the payment URIs. And the node software does the same.

ecash:qplzr5e5e05n8ph27sj4c95lpf65mmnenq29xaarqk?amount=100.00
This revision is now accepted and ready to land.Sep 16 2021, 16:14