decodeCalldata() looked a token's symbol and decimals up in state.trackedTokens and the wallets' balances, which hold the active network's tokens only. With mainnet active, a Sepolia token transfer on TransactionDetail, or a Sepolia transaction on TxApproval, showed the token by address only and its amount in base units.
tokenSourcesByChainId() in src/popup/views/helpers.js, beside endpointsByChainId(), gives what the wallet knows of the tokens on the network a chain id names: the active network's tracked tokens and balances, or for another network the list applyChainSwitchFields() keeps for it in state.networkTrackedTokens, and no balances. decodeCalldata() uses it, so the swap decoder is handed the same tokens; src/shared/uniswap.js is unchanged. tokenLabel() takes an optional chain id and uses it too.
Same cause, fixed the same way: TxApproval's Contract and decoded Token labels and the token symbol it hands the wait, success and error screens, and SuccessTx's decoded Token label (src/popup/views/txStatus.js). README's paragraph on where a token's scale is looked up says this now.
Tests: TransactionDetail in tests/tokenTransferDetail.test.js, SuccessTx in tests/txStatus.test.js, TxApproval in the new tests/approvalTokenNetwork.test.js.
Judgement call: a chain id that names no network gets no tracked tokens and no balances; no chain id at all means the active network, as explorerUrl() does.
Judgement call: TxApproval's own token labels are fixed here, since the issue names TxApproval's gap; the signature screen's permit labels are untouched.
Model: opus-5-5
Fixes https://git.eeqj.de/sneak/AutistMask/issues/629.
`decodeCalldata()` looked a token's symbol and decimals up in `state.trackedTokens` and the wallets' balances, which hold the active network's tokens only. With mainnet active, a Sepolia token transfer on TransactionDetail, or a Sepolia transaction on TxApproval, showed the token by address only and its amount in base units.
`tokenSourcesByChainId()` in `src/popup/views/helpers.js`, beside `endpointsByChainId()`, gives what the wallet knows of the tokens on the network a chain id names: the active network's tracked tokens and balances, or for another network the list `applyChainSwitchFields()` keeps for it in `state.networkTrackedTokens`, and no balances. `decodeCalldata()` uses it, so the swap decoder is handed the same tokens; `src/shared/uniswap.js` is unchanged. `tokenLabel()` takes an optional chain id and uses it too.
Same cause, fixed the same way: TxApproval's Contract and decoded Token labels and the token symbol it hands the wait, success and error screens, and SuccessTx's decoded Token label (`src/popup/views/txStatus.js`). README's paragraph on where a token's scale is looked up says this now.
Tests: TransactionDetail in `tests/tokenTransferDetail.test.js`, SuccessTx in `tests/txStatus.test.js`, TxApproval in the new `tests/approvalTokenNetwork.test.js`.
- Judgement call: a chain id that names no network gets no tracked tokens and no balances; no chain id at all means the active network, as `explorerUrl()` does.
- Judgement call: TxApproval's own token labels are fixed here, since the issue names TxApproval's gap; the signature screen's permit labels are untouched.
Model: opus-5-5
decodeCalldata() looked a token's symbol and decimals up in the active
network's tracked tokens and balances, whatever chain id it was given, so
TransactionDetail and TxApproval showed a token tracked on another network
by address only, with its amount in base units. The lookup now uses what the
wallet knows of the tokens on the transaction's network: the active
network's tracked tokens and balances, or for another network the tokens
tracked on it and no balances. TxApproval's token labels, the symbol it
hands the wait, success and error screens, and SuccessTx's decoded token
label use the same lookup.
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.
Fixes #629.
decodeCalldata()looked a token's symbol and decimals up instate.trackedTokensand the wallets' balances, which hold the active network's tokens only. With mainnet active, a Sepolia token transfer on TransactionDetail, or a Sepolia transaction on TxApproval, showed the token by address only and its amount in base units.tokenSourcesByChainId()insrc/popup/views/helpers.js, besideendpointsByChainId(), gives what the wallet knows of the tokens on the network a chain id names: the active network's tracked tokens and balances, or for another network the listapplyChainSwitchFields()keeps for it instate.networkTrackedTokens, and no balances.decodeCalldata()uses it, so the swap decoder is handed the same tokens;src/shared/uniswap.jsis unchanged.tokenLabel()takes an optional chain id and uses it too.Same cause, fixed the same way: TxApproval's Contract and decoded Token labels and the token symbol it hands the wait, success and error screens, and SuccessTx's decoded Token label (
src/popup/views/txStatus.js). README's paragraph on where a token's scale is looked up says this now.Tests: TransactionDetail in
tests/tokenTransferDetail.test.js, SuccessTx intests/txStatus.test.js, TxApproval in the newtests/approvalTokenNetwork.test.js.explorerUrl()does.Model: opus-5-5
Review: PASS
Model: opus-5-5