Repository navigation
Commit 9348a66
committed
fix(tokens): recompute the net transfer on re-entry
The private `netTransferAmount` producer deferred to
`State.confirmedNetTransferAmount` — its own output from a previous trip
through the entry screen — while `enteredAmount` and `feeAmount` beside it
recomputed from the live amount delegate. All three feed the same
`OnAmountAccepted` event, so a second pass produced a receipt that mixed
the new entry with the old total: enter $1, go back, enter $0.50, and the
receipt paired a $0.50 debit and a $0.005 fee with a $0.99 "You Receive".
The cache-first read is a leftover from before #829, when a single getter
on `State` served both roles and the keypad lived on `State` too; there it
was what pinned the number once accepted. The delegate split gave that
freeze its own home in `State.netTransferAmount`, but the producer copy
kept the prefix. `enteredAmount` and `feeAmount` were rewritten during that
split and came out cache-free, which is the asymmetry behind the bug.
Affects v1's Sell path the same way, so it is left ungated — a wrong number
is not a v1 pixel worth preserving.1 parent 6c5dcb3 commit 9348a66
1 file changed
Lines changed: 12 additions & 2 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
493 | 493 | | |
494 | 494 | | |
495 | 495 | | |
496 | | - | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
497 | 507 | | |
498 | | - | |
| 508 | + | |
499 | 509 | | |
500 | 510 | | |
501 | 511 | | |
| |||
0 commit comments