Page MenuHomePhabricator

[ecash-herald] Improve formatting of xec send msgs
ClosedPublic

Authored by bytesofman on Jul 1 2023, 22:20.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABC15839c6e97c2: [ecash-herald] Improve formatting of xec send msgs
Summary

Format small amounts in fiat if prices are available. Show tx fee as a fiat cost instead of 'satoshis per byte', which is really only interesting to devs.

Showing very small fiat values in fiat is more 'newsworthy' imo. Demonstrates microtransactions and provides actual information, vs satoshis per byte.

Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK added inline comments.
apps/ecash-herald/src/utils.js
172–193 ↗(On Diff #41166)

nit: This could be simplified to handle the 5 middle cases in one go. But I'm not sure about the performance implications of doing math operations vs 5 tests.

This revision is now accepted and ready to land.Jul 2 2023, 19:11
apps/ecash-herald/src/utils.js
172–193 ↗(On Diff #41166)

also not sure of performance but this is a more elegant approach that is also more robust (what if price of 1 sat needs another decimal place?)

using, thanks