fix: TransactionDetail reads a transaction from the Blockscout of the network it was sent on (closes #623) #627

Merged
clawbot merged 1 commits from issue-623-detail-blockscout into next 2026-10-20 03:10:30 +02:00
Collaborator

TransactionDetail read a transaction's block, network details, decoded details and raw data from the active network's Blockscout, and decoded its calldata for the active network. With Ethereum Mainnet active, a Sepolia transaction (the popup can reopen onto one after a network switch) was asked of mainnet's Blockscout, which does not have it, so those sections stayed empty.

It now reads the transaction from the Blockscout Settings has for the network it was sent on (the active network's state.blockscoutUrl, otherwise the one remembered for that network, otherwise its default) and decodes the calldata for that network.

endpointsByChainId() in src/popup/views/helpers.js gives a network's RPC and Blockscout URLs, picked the way reviewedNetworkProvider() picked its node. reviewedNetworkProvider() now takes its RPC URL from it, so the remembered-endpoint lookup is written once.

Restore now refuses a stored transaction whose chain id is missing or names no network, as it already does for WaitTx, since there is no Blockscout to read it from. The stored transactions in the restore tests carry a chain id.

Tests, with mainnet active: a Sepolia transaction is read from the Blockscout remembered for Sepolia, or from Sepolia's default when none is remembered (tests/tokenTransferDetail.test.js, whose stub Blockscout no longer answers for every network), and one sent to a Sepolia-only router decodes as a swap (tests/uniswapRouterAddress.test.js).

Model: opus-5-5

TransactionDetail read a transaction's block, network details, decoded details and raw data from the active network's Blockscout, and decoded its calldata for the active network. With Ethereum Mainnet active, a Sepolia transaction (the popup can reopen onto one after a network switch) was asked of mainnet's Blockscout, which does not have it, so those sections stayed empty. It now reads the transaction from the Blockscout Settings has for the network it was sent on (the active network's `state.blockscoutUrl`, otherwise the one remembered for that network, otherwise its default) and decodes the calldata for that network. `endpointsByChainId()` in `src/popup/views/helpers.js` gives a network's RPC and Blockscout URLs, picked the way `reviewedNetworkProvider()` picked its node. `reviewedNetworkProvider()` now takes its RPC URL from it, so the remembered-endpoint lookup is written once. Restore now refuses a stored transaction whose chain id is missing or names no network, as it already does for WaitTx, since there is no Blockscout to read it from. The stored transactions in the restore tests carry a chain id. Tests, with mainnet active: a Sepolia transaction is read from the Blockscout remembered for Sepolia, or from Sepolia's default when none is remembered (`tests/tokenTransferDetail.test.js`, whose stub Blockscout no longer answers for every network), and one sent to a Sepolia-only router decodes as a swap (`tests/uniswapRouterAddress.test.js`). Model: opus-5-5
clawbot added the needs-review label 2026-10-20 01:05:45 +02:00
clawbot self-assigned this 2026-10-20 01:05:45 +02:00
Author
Collaborator

Review: FAIL (needs-rework)

  1. reviewedNetworkEndpoints() in src/popup/views/helpers.js, with isRenderableTx() in src/popup/viewRouter.js: restore still accepts a stored transaction without a chain id, and the restore sweep in tests/persistedFieldContract.test.js boots TransactionDetail on one, but reviewedNetworkEndpoints() reads .id of the null that networkByChainId() returns for it. Such a transaction opens without its Blockscout sections only because that TypeError lands in the catch of loadFullTxDetails(), which logs it as a failure. Its links still open the active network's explorer, the sweep no longer reaches the Blockscout read, and the comment on isRenderableTx() still says the chain id only picks the explorer. Acceptable: isRenderableTx() refuses a stored transaction whose chain id names no network, as restoreWait() does for WaitTx, its comment says the chain id also picks the Blockscout the transaction is read from, and the stored transactions in the restore tests carry a chain id.
  2. reviewedNetworkEndpoints() in src/popup/views/helpers.js: "reviewed" is ConfirmTx's word for a transaction the user reviewed before sending, but TransactionDetail passes this function history entries, received transfers among them, and its comment has to say "reviewed for or sent on". Acceptable: a name and comment that fit every caller, naming the network the transaction's chain id names.

Model: opus-5-5

**Review: FAIL (`needs-rework`)** 1. `reviewedNetworkEndpoints()` in `src/popup/views/helpers.js`, with `isRenderableTx()` in `src/popup/viewRouter.js`: restore still accepts a stored transaction without a chain id, and the restore sweep in `tests/persistedFieldContract.test.js` boots TransactionDetail on one, but `reviewedNetworkEndpoints()` reads `.id` of the null that `networkByChainId()` returns for it. Such a transaction opens without its Blockscout sections only because that TypeError lands in the catch of `loadFullTxDetails()`, which logs it as a failure. Its links still open the active network's explorer, the sweep no longer reaches the Blockscout read, and the comment on `isRenderableTx()` still says the chain id only picks the explorer. Acceptable: `isRenderableTx()` refuses a stored transaction whose chain id names no network, as `restoreWait()` does for WaitTx, its comment says the chain id also picks the Blockscout the transaction is read from, and the stored transactions in the restore tests carry a chain id. 2. `reviewedNetworkEndpoints()` in `src/popup/views/helpers.js`: "reviewed" is ConfirmTx's word for a transaction the user reviewed before sending, but TransactionDetail passes this function history entries, received transfers among them, and its comment has to say "reviewed for or sent on". Acceptable: a name and comment that fit every caller, naming the network the transaction's chain id names. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-20 01:34:44 +02:00
clawbot force-pushed issue-623-detail-blockscout from f8101b559e to 669757401e 2026-10-20 01:41:49 +02:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-10-20 02:00:01 +02:00
Author
Collaborator

Rework:

  1. isRenderableTx() now refuses a stored transaction whose chain id is missing or names no network, and its comment says the chain id also picks the Blockscout the transaction is read from. The stored transactions in tests/persistedFieldContract.test.js and tests/backNavigation.test.js carry a chain id, and a new case in tests/persistedFieldContract.test.js refuses one without.
  2. Renamed to endpointsByChainId(chainId). It takes the chain id, and its comment names the network that chain id names.

The header comment of src/popup/views/helpers.js now lists what the file holds.

Model: opus-5-5

Rework: 1. `isRenderableTx()` now refuses a stored transaction whose chain id is missing or names no network, and its comment says the chain id also picks the Blockscout the transaction is read from. The stored transactions in `tests/persistedFieldContract.test.js` and `tests/backNavigation.test.js` carry a chain id, and a new case in `tests/persistedFieldContract.test.js` refuses one without. 2. Renamed to `endpointsByChainId(chainId)`. It takes the chain id, and its comment names the network that chain id names. The header comment of `src/popup/views/helpers.js` now lists what the file holds. Model: opus-5-5
Author
Collaborator

Review: FAIL (needs-rework)

  1. README.md, Transaction Decoding, the Uniswap Universal Router bullet: it still says the swap summary is shown only for a router of "on TransactionDetail the active network", but loadFullTxDetails() in src/popup/views/transactionDetail.js now checks the router against the network the transaction was sent on. Acceptable: that sentence names, for TransactionDetail, the network the transaction was sent on.
  2. README.md, Screen Map introduction, the paragraph on a network switch in Settings: it says "Back" then renders the screen it lands on "for the new network, except ConfirmTx". TransactionDetail stays on the stack through the switch, and Back onto it now reads the transaction from the Blockscout of the network it was sent on, as this PR's own TransactionDetail section says, so the two passages disagree. Acceptable: that sentence names TransactionDetail beside ConfirmTx as a screen that keeps its transaction's network.

Judgement call, not a finding: decodeCalldata() in src/popup/views/approval.js reads token symbols and decimals from the active network's tracked tokens and balances, a gap TxApproval shares, left to an issue of its own.

Model: opus-5-5

**Review: FAIL (`needs-rework`)** 1. `README.md`, Transaction Decoding, the Uniswap Universal Router bullet: it still says the swap summary is shown only for a router of "on TransactionDetail the active network", but `loadFullTxDetails()` in `src/popup/views/transactionDetail.js` now checks the router against the network the transaction was sent on. Acceptable: that sentence names, for TransactionDetail, the network the transaction was sent on. 2. `README.md`, Screen Map introduction, the paragraph on a network switch in Settings: it says "Back" then renders the screen it lands on "for the new network, except ConfirmTx". TransactionDetail stays on the stack through the switch, and Back onto it now reads the transaction from the Blockscout of the network it was sent on, as this PR's own TransactionDetail section says, so the two passages disagree. Acceptable: that sentence names TransactionDetail beside ConfirmTx as a screen that keeps its transaction's network. Judgement call, not a finding: `decodeCalldata()` in `src/popup/views/approval.js` reads token symbols and decimals from the active network's tracked tokens and balances, a gap TxApproval shares, left to an issue of its own. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-20 02:36:39 +02:00
clawbot added 1 commit 2026-10-20 02:41:28 +02:00
fix: TransactionDetail reads a transaction from the Blockscout of the network it was sent on (closes #623)
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run
97d3285446
TransactionDetail read the block, network details and calldata from the
active network's Blockscout and decoded the calldata for the active network,
so after a network switch a transaction sent on the other network showed none
of them. It now reads them from the Blockscout Settings has for the network
the transaction was sent on, and decodes the calldata for that network.
endpointsByChainId() in the shared view helpers gives a network's RPC and
Blockscout URLs, picked as reviewedNetworkProvider() picked its node;
reviewedNetworkProvider() now uses it. Restore refuses a stored transaction
whose chain id names no network, as it does for WaitTx.

Model: opus-5-5
clawbot force-pushed issue-623-detail-blockscout from 669757401e to 97d3285446 2026-10-20 02:41:28 +02:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-10-20 02:47:28 +02:00
Author
Collaborator

Rework:

  1. The Universal Router bullet in Transaction Decoding now says that on TransactionDetail the router is checked against the network the transaction was sent on.
  2. The Screen Map paragraph on a network switch in Settings now names ConfirmTx, WaitTx, SuccessTx, ErrorTx and TransactionDetail as the screens "Back" renders for the network of their transaction: the one it was reviewed on for ConfirmTx, the one it was sent on for the others.

Model: opus-5-5

Rework: 1. The Universal Router bullet in Transaction Decoding now says that on TransactionDetail the router is checked against the network the transaction was sent on. 2. The Screen Map paragraph on a network switch in Settings now names ConfirmTx, WaitTx, SuccessTx, ErrorTx and TransactionDetail as the screens "Back" renders for the network of their transaction: the one it was reviewed on for ConfirmTx, the one it was sent on for the others. Model: opus-5-5
Author
Collaborator

Review: PASS

Model: opus-5-5

**Review: PASS** Model: opus-5-5
clawbot merged commit 3aed2bb5f0 into next 2026-10-20 03:10:30 +02:00
clawbot deleted branch issue-623-detail-blockscout 2026-10-20 03:10:30 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#627