fix: a confirmation screen drawn again keeps the network it was reviewed for (closes #586)
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, and the screen describes the transaction entirely on that network: native currency, USD values, explorer links, and the node and explorer its checks ask. explorerUrl(), renderAddressHtml(), getPrice(), formatFee() and checkEtherscanLabel() take an optional chain id for this. A saved transaction whose chain id names no network is not restored. Model: opus-5-5
This commit was merged in pull request #587.
This commit is contained in:
@@ -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
|
||||
@@ -1782,12 +1784,20 @@ 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,
|
||||
whichever network is active: its amounts are in that network's native
|
||||
currency, its USD values are that network's, so a testnet transaction
|
||||
shows none, its From, To and token contract links open that network's
|
||||
explorer, the fee estimate and the contract and never-sent recipient
|
||||
checks ask that network's RPC endpoint, and the Etherscan label check asks
|
||||
that network's explorer
|
||||
- "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
|
||||
|
||||
Reference in New Issue
Block a user