Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e66aac60e2 |
No files matched your search
@@ -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
|
||||
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
|
||||
is not used to name this token, because "Use Blockscout" is off in Settings."
|
||||
These screens show it:
|
||||
tokens. Then a line under the token says "This token was not looked up on
|
||||
Blockscout, because "Use Blockscout" is off in Settings." These screens show it:
|
||||
|
||||
- TxApproval and SignApproval
|
||||
- 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.
|
||||
|
||||
While "Use Blockscout" is on, the Send screen also consults every address's
|
||||
explorer reports. Two addresses may report different `decimals` for one
|
||||
contract. That token then has no scale on Send, and its stored balance is
|
||||
explorer reports. So a contract two addresses report different `decimals` for
|
||||
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
|
||||
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,
|
||||
@@ -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
|
||||
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
|
||||
- A line under the amount, worded as on TxApproval. It shows while "Use
|
||||
Blockscout" is off and the token's name or decimals are missing from the
|
||||
bundled list and the tracked tokens.
|
||||
- While "Use Blockscout" is off, TxApproval's line under the amount, when
|
||||
the token's name or decimals are missing from the bundled list and the
|
||||
tracked tokens
|
||||
- To: color dot + full address + etherscan link; for a contract creation,
|
||||
which has no recipient, "This transaction creates a new contract. It has
|
||||
no recipient." instead
|
||||
@@ -2601,10 +2600,10 @@ view would leave a wallet one click from deletion.
|
||||
unknown (see Transaction Decoding)
|
||||
- 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
|
||||
tracked tokens: "Blockscout's report of your balances is not used to name
|
||||
this token, because "Use Blockscout" is off in Settings." Blockscout's
|
||||
report of the user's balances gives a token's name and decimals only while
|
||||
the setting is on (see Unknown token scale).
|
||||
tracked tokens: "This token was not looked up on Blockscout, because "Use
|
||||
Blockscout" is off in Settings." Blockscout's report of the user's
|
||||
balances gives a token's name and decimals only while the setting is on
|
||||
(see Unknown token scale).
|
||||
- From: color dot + full address + etherscan link
|
||||
- Contract: color dot + full address + etherscan link, token symbol label if
|
||||
known; for a contract creation, the same sentence as on WaitTx
|
||||
|
||||
+5
-8
@@ -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
|
||||
node.
|
||||
|
||||
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 name
|
||||
- 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)
|
||||
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
|
||||
name, when a send is prepared and broadcast, while a pending transaction is
|
||||
polled for its receipt, and for the reverse ENS lookups used to label addresses
|
||||
(cached for 12 hours).
|
||||
|
||||
What gets sent: standard Ethereum JSON-RPC requests (balance queries,
|
||||
transaction broadcasts, gas estimates, ENS lookups, contract-code checks). Your
|
||||
|
||||
@@ -330,10 +330,8 @@ function tokenSourcesByChainId(chainId) {
|
||||
// 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
|
||||
// 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) {
|
||||
if (typeof token !== "string") return "";
|
||||
if (state.useBlockscout || !token || token === "ETH") return "";
|
||||
const sources = tokenSourcesByChainId(chainId);
|
||||
if (
|
||||
@@ -343,9 +341,8 @@ function tokenLookupOffHtml(token, chainId) {
|
||||
return "";
|
||||
}
|
||||
return (
|
||||
'<div class="text-xs text-muted">Blockscout\'s report of your balances' +
|
||||
' is not used to name this token, because "Use Blockscout" is off in' +
|
||||
" Settings.</div>"
|
||||
'<div class="text-xs text-muted">This token was not looked up on' +
|
||||
' Blockscout, because "Use Blockscout" is off in Settings.</div>'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -220,9 +220,9 @@ function showWait(txInfo, txHash) {
|
||||
// init and leaving wait-tx on screen with no back control. A non-numeric
|
||||
// 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
|
||||
// to name a network. txInfo.token and txInfo.tokenSymbol are not checked here.
|
||||
// tokenLookupOffHtml() shows no line for a token that is not text. Everything
|
||||
// else only compares and coalesces them, and tokenSymbol is null for ETH.
|
||||
// to name a network. txInfo.token and txInfo.tokenSymbol are deliberately
|
||||
// unchecked: they are compared and coalesced rather than dereferenced, and
|
||||
// tokenSymbol is null for ETH.
|
||||
function restoreWait() {
|
||||
const d = state.viewData;
|
||||
if (!d || !d.pendingWait) return false;
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
// 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
|
||||
// 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
|
||||
// is not used to name it. While the setting is on, what Blockscout reported for
|
||||
// a token the user holds names and scales it, as before.
|
||||
// token they lack gets a line saying it was not looked up on Blockscout. While
|
||||
// the setting is on, what Blockscout reported for a token the user holds names
|
||||
// and scales it, as before.
|
||||
//
|
||||
// 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
|
||||
// no password has to be hashed: the stored secret decrypts to the test key
|
||||
// below.
|
||||
// popup reopened onto SuccessTx. The vault is mocked so that no password has to
|
||||
// be hashed: the stored secret decrypts to the test key below.
|
||||
|
||||
jest.mock("../src/shared/vault", () => ({
|
||||
decryptWithPassword: jest.fn(),
|
||||
@@ -35,7 +34,7 @@ const TOKEN = "0xE2E0000000000000000000000000000000000E2e";
|
||||
const USDC = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
|
||||
|
||||
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.
|
||||
const TOKEN_ROW = {
|
||||
@@ -155,7 +154,7 @@ afterEach(() => {
|
||||
});
|
||||
|
||||
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 details = page.node("approve-tx-decoded-details").innerHTML;
|
||||
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);
|
||||
});
|
||||
|
||||
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 () => {
|
||||
const signParams = {
|
||||
method: "eth_signTypedData_v4",
|
||||
|
||||
Reference in new issue
Block a user