1 Commits
Author SHA1 Message Date
sneak e66aac60e2 fix: Blockscout and Etherscan lookups are off until the user turns them on (closes #668)
check / check (push) Canceled after 0s
e2e / e2e-chrome (push) Canceled after 0s
e2e / e2e-firefox (push) Canceled after 0s
Out of the box the wallet sent the user's addresses to Blockscout and each
recipient to Etherscan. Two settings, "Use Blockscout" and "Check recipients on
Etherscan", now gate those requests. Both are off in a new install and offered
unticked on Welcome and in Settings. While one is off, the screens that relied
on it say so in a plain line. Each gated request reads its setting from storage
before it asks and when the answer lands, and drops a late answer. An open popup
takes another page's change and draws its screens again. While "Use Blockscout"
is off, no address keeps an untracked token, and no screen names a token from
Blockscout's report. ENS lookups ask only the RPC endpoint.

Model: opus-5-5
2026-10-26 08:58:03 +00:00
5 changed files with 29 additions and 81 deletions

No files matched your search

+11 -12
View File
@@ -1176,9 +1176,8 @@ It is resolved from these sources, in this order (`resolveTokenDecimals()` in
The token's name comes from the same sources. While "Use Blockscout" is off, a The token's name comes from the same sources. While "Use Blockscout" is off, a
token's name or decimals may be missing from the bundled list and the tracked token's name or decimals may be missing from the bundled list and the tracked
tokens. Then a line under the token says "Blockscout's report of your balances tokens. Then a line under the token says "This token was not looked up on
is not used to name this token, because "Use Blockscout" is off in Settings." Blockscout, because "Use Blockscout" is off in Settings." These screens show it:
These screens show it:
- TxApproval and SignApproval - TxApproval and SignApproval
- WaitTx, SuccessTx and ErrorTx, which follow TxApproval - WaitTx, SuccessTx and ErrorTx, which follow TxApproval
@@ -1220,8 +1219,8 @@ for a bundled or tracked token the explorer merely omitted, which is not a
refusal the wallet has any reason to make. refusal the wallet has any reason to make.
While "Use Blockscout" is on, the Send screen also consults every address's While "Use Blockscout" is on, the Send screen also consults every address's
explorer reports. Two addresses may report different `decimals` for one explorer reports. So a contract two addresses report different `decimals` for
contract. That token then has no scale on Send, and its stored balance is has no scale there, and the stored balance, formatted at one of those scales, is
withdrawn with it. The Send screen's `Current balance` and the confirmation withdrawn with it. The Send screen's `Current balance` and the confirmation
screen's balance line then both read `unknown (SYMBOL)`. The balance list screen's balance line then both read `unknown (SYMBOL)`. The balance list
formats each explorer row as it is fetched, without that cross-address check, formats each explorer row as it is fetched, without that cross-address check,
@@ -2065,9 +2064,9 @@ view would leave a wallet one click from deletion.
`Unknown (could not be decoded)` with no symbol, not the transaction's ETH `Unknown (could not be decoded)` with no symbol, not the transaction's ETH
value. When that swap's `Token In` is `ETH (native)`, the transaction's value. When that swap's `Token In` is `ETH (native)`, the transaction's
ETH value in the network's currency, as for any other transaction ETH value in the network's currency, as for any other transaction
- A line under the amount, worded as on TxApproval. It shows while "Use - While "Use Blockscout" is off, TxApproval's line under the amount, when
Blockscout" is off and the token's name or decimals are missing from the the token's name or decimals are missing from the bundled list and the
bundled list and the tracked tokens. tracked tokens
- To: color dot + full address + etherscan link; for a contract creation, - To: color dot + full address + etherscan link; for a contract creation,
which has no recipient, "This transaction creates a new contract. It has which has no recipient, "This transaction creates a new contract. It has
no recipient." instead no recipient." instead
@@ -2601,10 +2600,10 @@ view would leave a wallet one click from deletion.
unknown (see Transaction Decoding) unknown (see Transaction Decoding)
- While "Use Blockscout" is off, a line under each token in the decoded - While "Use Blockscout" is off, a line under each token in the decoded
action whose name or decimals are missing from the bundled list and the action whose name or decimals are missing from the bundled list and the
tracked tokens: "Blockscout's report of your balances is not used to name tracked tokens: "This token was not looked up on Blockscout, because "Use
this token, because "Use Blockscout" is off in Settings." Blockscout's Blockscout" is off in Settings." Blockscout's report of the user's
report of the user's balances gives a token's name and decimals only while balances gives a token's name and decimals only while the setting is on
the setting is on (see Unknown token scale). (see Unknown token scale).
- From: color dot + full address + etherscan link - From: color dot + full address + etherscan link
- Contract: color dot + full address + etherscan link, token symbol label if - Contract: color dot + full address + etherscan link, token symbol label if
known; for a contract creation, the same sentence as on WaitTx known; for a contract creation, the same sentence as on WaitTx
+5 -8
View File
@@ -89,14 +89,11 @@ verify confirmations. The default is a free public RPC endpoint. You can change
this in Settings to any Ethereum JSON-RPC endpoint, including your own local this in Settings to any Ethereum JSON-RPC endpoint, including your own local
node. node.
When it is contacted: When it is contacted: on every balance refresh (every 10 seconds while the popup
is open, every 60 seconds in the background), when you review a send to an ENS
- on every balance refresh (every 10 seconds while the popup is open, every 60 name, when a send is prepared and broadcast, while a pending transaction is
seconds in the background) polled for its receipt, and for the reverse ENS lookups used to label addresses
- when you review a send to an ENS name (cached for 12 hours).
- when a send is prepared and broadcast
- while a pending transaction is polled for its receipt
- for the reverse ENS lookups used to label addresses (cached for 12 hours)
What gets sent: standard Ethereum JSON-RPC requests (balance queries, What gets sent: standard Ethereum JSON-RPC requests (balance queries,
transaction broadcasts, gas estimates, ENS lookups, contract-code checks). Your transaction broadcasts, gas estimates, ENS lookups, contract-code checks). Your
+3 -6
View File
@@ -330,10 +330,8 @@ function tokenSourcesByChainId(chainId) {
// decimals are missing from the bundled list and the tracked tokens. Otherwise // decimals are missing from the bundled list and the tracked tokens. Otherwise
// "". The token is a contract address on the network with `chainId`, or on the // "". The token is a contract address on the network with `chainId`, or on the
// active network when none is given. "ETH" and null are no contract, and get // active network when none is given. "ETH" and null are no contract, and get
// "". A token that is not text also gets "": WaitTx and ErrorTx pass a token // "".
// restored from storage unchecked.
function tokenLookupOffHtml(token, chainId) { function tokenLookupOffHtml(token, chainId) {
if (typeof token !== "string") return "";
if (state.useBlockscout || !token || token === "ETH") return ""; if (state.useBlockscout || !token || token === "ETH") return "";
const sources = tokenSourcesByChainId(chainId); const sources = tokenSourcesByChainId(chainId);
if ( if (
@@ -343,9 +341,8 @@ function tokenLookupOffHtml(token, chainId) {
return ""; return "";
} }
return ( return (
'<div class="text-xs text-muted">Blockscout\'s report of your balances' + '<div class="text-xs text-muted">This token was not looked up on' +
' is not used to name this token, because "Use Blockscout" is off in' + ' Blockscout, because "Use Blockscout" is off in Settings.</div>'
" Settings.</div>"
); );
} }
+3 -3
View File
@@ -220,9 +220,9 @@ function showWait(txInfo, txHash) {
// init and leaving wait-tx on screen with no back control. A non-numeric // init and leaving wait-tx on screen with no back control. A non-numeric
// broadcastTime leaves an unexitable wait counting "NaNs". txInfo.chainId picks // broadcastTime leaves an unexitable wait counting "NaNs". txInfo.chainId picks
// the node the receipt is asked of and the explorer the links open, so it has // the node the receipt is asked of and the explorer the links open, so it has
// to name a network. txInfo.token and txInfo.tokenSymbol are not checked here. // to name a network. txInfo.token and txInfo.tokenSymbol are deliberately
// tokenLookupOffHtml() shows no line for a token that is not text. Everything // unchecked: they are compared and coalesced rather than dereferenced, and
// else only compares and coalesces them, and tokenSymbol is null for ETH. // tokenSymbol is null for ETH.
function restoreWait() { function restoreWait() {
const d = state.viewData; const d = state.viewData;
if (!d || !d.pendingWait) return false; if (!d || !d.pendingWait) return false;
+7 -52
View File
@@ -1,14 +1,13 @@
// While "Use Blockscout" is off, the approval screens and the screens after // While "Use Blockscout" is off, the approval screens and the screens after
// TxApproval name a token, and scale its amount, from the bundled list and the // TxApproval name a token, and scale its amount, from the bundled list and the
// tracked tokens alone (https://git.eeqj.de/sneak/AutistMask/issues/668). A // tracked tokens alone (https://git.eeqj.de/sneak/AutistMask/issues/668). A
// token they lack gets a line saying Blockscout's report of the user's balances // token they lack gets a line saying it was not looked up on Blockscout. While
// is not used to name it. While the setting is on, what Blockscout reported for // the setting is on, what Blockscout reported for a token the user holds names
// a token the user holds names and scales it, as before. // and scales it, as before.
// //
// Booted through the real popup entry point, as the approval window or as a // Booted through the real popup entry point, as the approval window or as a
// popup reopened onto SuccessTx, WaitTx or ErrorTx. The vault is mocked so that // popup reopened onto SuccessTx. The vault is mocked so that no password has to
// no password has to be hashed: the stored secret decrypts to the test key // be hashed: the stored secret decrypts to the test key below.
// below.
jest.mock("../src/shared/vault", () => ({ jest.mock("../src/shared/vault", () => ({
decryptWithPassword: jest.fn(), decryptWithPassword: jest.fn(),
@@ -35,7 +34,7 @@ const TOKEN = "0xE2E0000000000000000000000000000000000E2e";
const USDC = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"; const USDC = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
const LINE = const LINE =
'Blockscout\'s report of your balances is not used to name this token, because "Use Blockscout" is off in Settings.'; 'This token was not looked up on Blockscout, because "Use Blockscout" is off in Settings.';
// TOKEN as Blockscout reports the user's holding of it. // TOKEN as Blockscout reports the user's holding of it.
const TOKEN_ROW = { const TOKEN_ROW = {
@@ -155,7 +154,7 @@ afterEach(() => {
}); });
describe("TxApproval", () => { describe("TxApproval", () => {
test("has the line under a token it cannot name while Use Blockscout is off", async () => { test("says a token it cannot name was not looked up on Blockscout while Use Blockscout is off", async () => {
const page = await bootApproval(profile(false, [])); const page = await bootApproval(profile(false, []));
const details = page.node("approve-tx-decoded-details").innerHTML; const details = page.node("approve-tx-decoded-details").innerHTML;
expect(details).toContain("Unknown token"); expect(details).toContain("Unknown token");
@@ -244,50 +243,6 @@ test("SuccessTx says so under the decoded token while Use Blockscout is off", as
expect(decoded).toContain(LINE); expect(decoded).toContain(LINE);
}); });
test.each([
[
"wait-tx",
{
pendingWait: {
hash: TX_HASH,
txInfo: {
to: RECIPIENT,
amount: "1",
token: 42,
chainId: "0x1",
},
broadcastTime: Date.now(),
},
},
],
[
"error-tx",
{
amount: "1",
symbol: "?",
token: 42,
to: RECIPIENT,
hash: TX_HASH,
message: "The transaction failed.",
chainId: "0x1",
},
],
])(
"a popup reopened onto %s shows no line for a stored token that is not text",
async (view, viewData) => {
const page = await bootPopup(
profile(false, [], {
currentView: view,
viewStack: ["main"],
viewData,
}),
);
expect(page.pageErrors).toEqual([]);
expect(page.visibleViews()).toEqual([view]);
expect(page.node(view + "-token-note").innerHTML).toBe("");
},
);
test("SignApproval says so under a permit's token while Use Blockscout is off", async () => { test("SignApproval says so under a permit's token while Use Blockscout is off", async () => {
const signParams = { const signParams = {
method: "eth_signTypedData_v4", method: "eth_signTypedData_v4",