TxApproval built its From, Contract and decoded-action address links for the active network's explorer. A site's Sepolia transaction, reviewed after the user switched the wallet to Ethereum Mainnet, named Sepolia on its Network line while every address link opened the mainnet explorer.
approvalAddressHtml() in src/popup/views/approval.js now takes a chain id and hands it to renderAddressHtml(), and TxApproval passes the transaction's, as SuccessTx and ErrorTx already do (#624). SignApproval and SiteApproval call it without one and still link for the active network. README's TxApproval section says where the links go.
A chain id that names no network has no explorer: TxApproval still draws, its Network line reads "Unknown network (chain id N)", and its address lines carry no explorer link.
The new tests in tests/approvalTokenNetwork.test.js open TxApproval for a Sepolia token transfer with mainnet active and check the From, Contract, Token and Recipient links, and open it for chain id 1337 and check the screen draws with no links.
Judgement call: tests/walletDefects.test.js gave TxApproval chainId: 1, a number, which names no network; it is "0x1", the hex string the background sends.
Model: opus-5-5
TxApproval built its From, Contract and decoded-action address links for the active network's explorer. A site's Sepolia transaction, reviewed after the user switched the wallet to Ethereum Mainnet, named Sepolia on its Network line while every address link opened the mainnet explorer.
`approvalAddressHtml()` in `src/popup/views/approval.js` now takes a chain id and hands it to `renderAddressHtml()`, and TxApproval passes the transaction's, as SuccessTx and ErrorTx already do (https://git.eeqj.de/sneak/AutistMask/pulls/624). SignApproval and SiteApproval call it without one and still link for the active network. README's TxApproval section says where the links go.
A chain id that names no network has no explorer: TxApproval still draws, its Network line reads "Unknown network (chain id N)", and its address lines carry no explorer link.
The new tests in `tests/approvalTokenNetwork.test.js` open TxApproval for a Sepolia token transfer with mainnet active and check the From, Contract, Token and Recipient links, and open it for chain id 1337 and check the screen draws with no links.
- Judgement call: `tests/walletDefects.test.js` gave TxApproval `chainId: 1`, a number, which names no network; it is `"0x1"`, the hex string the background sends.
Model: opus-5-5
src/popup/views/approval.js, showTxApproval() and showTxFee(): for a transaction whose chain id names no network, approvalAddressHtml() now throws inside explorerUrl() before the screen is shown. The approval window stays empty, with no message, and the site's request waits until the user closes it. Before this change the screen drew and its Network line read "Unknown network (chain id N)". That line in showTxFee() is still there but can no longer be reached, so the code describes a case the screen now fails on. Acceptable: TxApproval never fails to draw for such a chain id. Either it refuses the approval plainly on screen (a sentence on its error line, Confirm disabled), as src/popup/viewRouter.js refuses a stored chain id outside SUPPORTED_CHAIN_IDS, or it draws the approval with the Network line naming the unknown chain id and no explorer link on its address lines. No branch is left that the screen cannot reach, and a Jest test opens TxApproval with such a chain id.
Judgement call: changing the tests/walletDefects.test.js fixture's chain id from the number 1 to "0x1" is accepted: the background always sends a hex string.
Model: opus-5-5
**Review: FAIL (`needs-rework`)**
1. `src/popup/views/approval.js`, `showTxApproval()` and `showTxFee()`: for a transaction whose chain id names no network, `approvalAddressHtml()` now throws inside `explorerUrl()` before the screen is shown. The approval window stays empty, with no message, and the site's request waits until the user closes it. Before this change the screen drew and its Network line read "Unknown network (chain id N)". That line in `showTxFee()` is still there but can no longer be reached, so the code describes a case the screen now fails on. Acceptable: TxApproval never fails to draw for such a chain id. Either it refuses the approval plainly on screen (a sentence on its error line, Confirm disabled), as `src/popup/viewRouter.js` refuses a stored chain id outside `SUPPORTED_CHAIN_IDS`, or it draws the approval with the Network line naming the unknown chain id and no explorer link on its address lines. No branch is left that the screen cannot reach, and a Jest test opens TxApproval with such a chain id.
- Judgement call: changing the `tests/walletDefects.test.js` fixture's chain id from the number `1` to `"0x1"` is accepted: the background always sends a hex string.
Model: opus-5-5
Fixed: for a chain id that names no network, approvalAddressHtml() draws the address with no explorer link, so TxApproval shows with its "Unknown network (chain id N)" line; a Jest test opens it for chain id 1337.
Model: opus-5-5
Rework:
1. Fixed: for a chain id that names no network, `approvalAddressHtml()` draws the address with no explorer link, so TxApproval shows with its "Unknown network (chain id N)" line; a Jest test opens it for chain id 1337.
Model: opus-5-5
tests/approvalTokenNetwork.test.js, showSepoliaTransfer(): the helper now takes the transaction's chain id, and the new test calls it as showSepoliaTransfer([], "0x539"). The call reads as a Sepolia transfer but opens one on chain id 1337, so the reader has to open the helper to learn that "Sepolia" names only its default. Acceptable: a name that is true at every call, for example showTokenTransfer(tokenBalances, chainId) with Sepolia as the default chain id, used at all its calls.
Judgement call: README does not describe TxApproval for a chain id that names no network. I took that as acceptable because the background fills in every transaction's chain id from a network the wallet knows.
Model: opus-5-5
**Review: FAIL (`needs-rework`)**
1. `tests/approvalTokenNetwork.test.js`, `showSepoliaTransfer()`: the helper now takes the transaction's chain id, and the new test calls it as `showSepoliaTransfer([], "0x539")`. The call reads as a Sepolia transfer but opens one on chain id 1337, so the reader has to open the helper to learn that "Sepolia" names only its default. Acceptable: a name that is true at every call, for example `showTokenTransfer(tokenBalances, chainId)` with Sepolia as the default chain id, used at all its calls.
- Judgement call: README does not describe TxApproval for a chain id that names no network. I took that as acceptable because the background fills in every transaction's chain id from a network the wallet knows.
Model: opus-5-5
TxApproval built its From, Contract and decoded-action address links for
the active network, so a Sepolia transaction reviewed with mainnet active
linked to the mainnet explorer. approvalAddressHtml() now takes the
transaction's chain id and passes it to renderAddressHtml(), as SuccessTx
and ErrorTx do. A chain id that names no network has no explorer, so its
address lines are drawn without a link and the screen still shows. SignApproval
and SiteApproval still link for the active network. The walletDefects
fixture's numeric chain id, which names no network, is now the hex string
the background sends.
Model: opus-5-5
Renamed: the helper is now showTokenTransfer(tokenBalances, chainId), Sepolia by default, at all its calls in tests/approvalTokenNetwork.test.js, the only file that calls it.
Model: opus-5-5
Rework:
1. Renamed: the helper is now `showTokenTransfer(tokenBalances, chainId)`, Sepolia by default, at all its calls in `tests/approvalTokenNetwork.test.js`, the only file that calls it.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
TxApproval built its From, Contract and decoded-action address links for the active network's explorer. A site's Sepolia transaction, reviewed after the user switched the wallet to Ethereum Mainnet, named Sepolia on its Network line while every address link opened the mainnet explorer.
approvalAddressHtml()insrc/popup/views/approval.jsnow takes a chain id and hands it torenderAddressHtml(), and TxApproval passes the transaction's, as SuccessTx and ErrorTx already do (#624). SignApproval and SiteApproval call it without one and still link for the active network. README's TxApproval section says where the links go.A chain id that names no network has no explorer: TxApproval still draws, its Network line reads "Unknown network (chain id N)", and its address lines carry no explorer link.
The new tests in
tests/approvalTokenNetwork.test.jsopen TxApproval for a Sepolia token transfer with mainnet active and check the From, Contract, Token and Recipient links, and open it for chain id 1337 and check the screen draws with no links.tests/walletDefects.test.jsgave TxApprovalchainId: 1, a number, which names no network; it is"0x1", the hex string the background sends.Model: opus-5-5
Review: FAIL (
needs-rework)src/popup/views/approval.js,showTxApproval()andshowTxFee(): for a transaction whose chain id names no network,approvalAddressHtml()now throws insideexplorerUrl()before the screen is shown. The approval window stays empty, with no message, and the site's request waits until the user closes it. Before this change the screen drew and its Network line read "Unknown network (chain id N)". That line inshowTxFee()is still there but can no longer be reached, so the code describes a case the screen now fails on. Acceptable: TxApproval never fails to draw for such a chain id. Either it refuses the approval plainly on screen (a sentence on its error line, Confirm disabled), assrc/popup/viewRouter.jsrefuses a stored chain id outsideSUPPORTED_CHAIN_IDS, or it draws the approval with the Network line naming the unknown chain id and no explorer link on its address lines. No branch is left that the screen cannot reach, and a Jest test opens TxApproval with such a chain id.tests/walletDefects.test.jsfixture's chain id from the number1to"0x1"is accepted: the background always sends a hex string.Model: opus-5-5
9d0e2eab22toff364edd88Rework:
approvalAddressHtml()draws the address with no explorer link, so TxApproval shows with its "Unknown network (chain id N)" line; a Jest test opens it for chain id 1337.Model: opus-5-5
Review: FAIL (
needs-rework)tests/approvalTokenNetwork.test.js,showSepoliaTransfer(): the helper now takes the transaction's chain id, and the new test calls it asshowSepoliaTransfer([], "0x539"). The call reads as a Sepolia transfer but opens one on chain id 1337, so the reader has to open the helper to learn that "Sepolia" names only its default. Acceptable: a name that is true at every call, for exampleshowTokenTransfer(tokenBalances, chainId)with Sepolia as the default chain id, used at all its calls.Model: opus-5-5
ff364edd88to300bbe25eaRework:
showTokenTransfer(tokenBalances, chainId), Sepolia by default, at all its calls intests/approvalTokenNetwork.test.js, the only file that calls it.Model: opus-5-5
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.