fix: a confirmation screen drawn again keeps the network it was reviewed for (closes #586)
check / check (push) Canceled after 0s
e2e / e2e-chrome (push) Canceled after 0s
e2e / e2e-firefox (push) Canceled after 0s

ConfirmTx set the transaction's chain id to the active network's every
time it drew the screen, so a popup reopened onto a saved confirmation
after a network switch in Settings described the reviewed transfer as
the new network's and sent it there.

show() now sets the chain id only on a transaction Send hands over. One
drawn again from the saved screen keeps its own, so Sign & Send refuses
it while another network is active. The screen labels its amounts in
that network's native currency and asks that network's RPC endpoint for
the fee and the recipient checks.

Model: opus-5-5
This commit is contained in:
2026-10-19 02:55:38 +00:00
parent 8b6c2b4df9
commit fe1e84b071
3 changed files with 144 additions and 29 deletions
+14 -8
View File
@@ -1013,10 +1013,12 @@ rendered differently on two screens.
The native token's label is a network's `nativeCurrency` in
`src/shared/networks.js`: `ETH` on mainnet, `SepoliaETH` on Sepolia. The
wallet's balances and the Send and confirmation screens, which send on the
active network, use the active network's. A transaction's figures use the one of
the network its chain id names, whichever network is active: the value and fee
on the approval screen, the amount on the wait, success and error screens, the
wallet's balances and the Send screen, which sends on the active network, use
the active network's. The confirmation screen uses the one of the network its
transaction was reviewed on, the network active when Send showed it, even after
the network is switched in Settings. A transaction's figures use the one of the
network its chain id names, whichever network is active: the value and fee on
the approval screen, the amount on the wait, success and error screens, the
transaction history and the transaction detail screen, and the refusal of a fee
above 1 ETH. A chain id that names no network reads `ETH`. Wherever this
document shows ETH as the label of a native balance, value or fee, in a "Native
@@ -1781,12 +1783,16 @@ view would leave a wallet one click from deletion.
the contract's own answer is read at signing time only to be compared with
it, and a disagreement is a refusal rather than a preference for either
value (`src/shared/transferAmount.js`)
- "Sign & Send" after the active network was switched in Settings while this
screen was open → nothing is signed; "The active network changed after
- "Sign & Send" after the active network was switched in Settings since this
transaction was reviewed, with this screen open or before the popup
reopened onto it → nothing is signed; "The active network changed after
this transaction was reviewed, so it was not sent. Please go back and
review it again." in the errors box, no screen change. The transaction
carries the chain id of the network the screen was shown for, so it cannot
be signed for another
carries the chain id of the network active when Send showed this screen,
and keeps it when the screen is drawn again from the saved transaction, so
it cannot be signed for another. The screen describes it on that network:
its amounts are in that network's native currency, and the fee estimate
and the recipient checks ask that network's RPC endpoint
- "Sign & Send" (wrong password) → "Wrong password." on the password error
line, no screen change
- "Sign & Send" signs as the From address above, not as whichever address is