fix: Blockscout and Etherscan lookups are off until the user turns them on (closes #668)
Out of the box the wallet sent the user's addresses to Blockscout. It sent each recipient to Etherscan for its label. 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. An answer that lands after the setting went off is dropped. An open popup takes a change another page saved and draws its screens again. While "Use Blockscout" is off, no address keeps an untracked token. ENS lookups ask only the RPC endpoint. Model: opus-5-5
This commit is contained in:
@@ -100,7 +100,10 @@ global.fetch = jest.fn(() => {
|
||||
});
|
||||
|
||||
const { makeStorageStub } = require("./support/storageStub");
|
||||
global.chrome = { storage: makeStorageStub(), runtime: { sendMessage() {} } };
|
||||
global.chrome = {
|
||||
storage: makeStorageStub({ autistmask: { useBlockscout: true } }),
|
||||
runtime: { sendMessage() {} },
|
||||
};
|
||||
|
||||
// A stub DOM: every id resolves to a recording element.
|
||||
const elements = new Map();
|
||||
@@ -213,6 +216,9 @@ async function refreshWith(balanceWei, tokenItems = []) {
|
||||
];
|
||||
state.selectedWallet = 0;
|
||||
state.selectedAddress = 0;
|
||||
// Blockscout is asked only while the stored "Use Blockscout" is on. The
|
||||
// screens save this page's copy of it over the stored one.
|
||||
state.useBlockscout = true;
|
||||
await refreshBalances(
|
||||
state.wallets,
|
||||
"https://rpc.example.invalid",
|
||||
|
||||
Reference in New Issue
Block a user