fix: the send and send-confirm screens render a sub-1e-6 balance and fee as 0.0 #343
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found by the re-review of #339 (#339 (comment)). Pre-existing; not introduced there.
src/shared/balances.js:31,39andsrc/popup/views/confirmTx.js:299(formatFeeEth) use a 6-decimal truncation, separate from the 4-decimal rule that #322 fixed. A quantity below 1e-6 renders as0.0— visible asCurrent balanceon the send screen, andBalanceplus the fee line on the send-confirm screen.Same failure mode as #322: a nonzero quantity displayed as nothing. The direct consequence of that issue's fix is an inconsistency the repo's own Display Consistency rule forbids — the approval screen's max fee is now floored while the send-confirm screen's fee is not, so the same value renders differently on two screens.
Deliberately NOT in milestone 1.0.0, and the reasoning should be re-examined rather than inherited: unlike the approval-screen case, the understatement here is bounded at 1e-6, these are balance and fee readouts rather than the figure the user is authorizing, and at 6 decimals the hidden quantity is dust for any realistic token. Promote it if that judgement is wrong.
Definition of done
0.0on the send or send-confirm screens.src/shared/amountDisplay.jsover adding a fourth truncation rule.make checkgreen.