decodeCalldata(), the decoder for ERC-20 approve and transfer calldata that also hands Uniswap calldata to src/shared/uniswap.js, lives in the TxApproval view, src/popup/views/approval.js. TransactionDetail (src/popup/views/transactionDetail.js) and four test files import it from that view.
The rule: RULES.md Transaction Decoding, "Decoders are self-contained modules in src/shared/". sneak's README.md text: "The decoders live in self-contained modules under src/shared/ (e.g. uniswap.js) so they can be added for common contracts without polluting wallet-specific code."
New module src/shared/calldataDecoder.js holds decodeCalldata() and the helpers only it uses. approval.js, transactionDetail.js and the tests import it from there.
The module imports nothing from src/popup/, as uniswap.js does not: it returns data, and the views turn addresses into HTML. Where the decoder builds address HTML today (approvalAddressHtml()), move that rendering to the views.
A helper the rest of approval.js also uses (tokenAmountText()) lives in one place and is imported by the other; nothing is copied.
What the approval and TransactionDetail screens show does not change.
README.md: the module list and the transaction decoding section name the new file.
Definition of done
decodeCalldata is defined only in src/shared/calldataDecoder.js, and nothing under src/shared/ requires a file under src/popup/.
Existing decoder and approval tests pass unchanged apart from their import path.
make check green. Gate runs: flock -w 3600 /srv/code/tmp/.autistmask-gate.lock script/cibuild.
Model: opus-5-5
`decodeCalldata()`, the decoder for ERC-20 `approve` and `transfer` calldata that also hands Uniswap calldata to `src/shared/uniswap.js`, lives in the TxApproval view, `src/popup/views/approval.js`. TransactionDetail (`src/popup/views/transactionDetail.js`) and four test files import it from that view.
The rule: `RULES.md` Transaction Decoding, "Decoders are self-contained modules in `src/shared/`". sneak's `README.md` text: "The decoders live in self-contained modules under `src/shared/` (e.g. `uniswap.js`) so they can be added for common contracts without polluting wallet-specific code."
Found in the `RULES.md` read on https://git.eeqj.de/sneak/AutistMask/issues/672#issuecomment-160312.
## Fix
- New module `src/shared/calldataDecoder.js` holds `decodeCalldata()` and the helpers only it uses. `approval.js`, `transactionDetail.js` and the tests import it from there.
- The module imports nothing from `src/popup/`, as `uniswap.js` does not: it returns data, and the views turn addresses into HTML. Where the decoder builds address HTML today (`approvalAddressHtml()`), move that rendering to the views.
- A helper the rest of `approval.js` also uses (`tokenAmountText()`) lives in one place and is imported by the other; nothing is copied.
- What the approval and TransactionDetail screens show does not change.
- `README.md`: the module list and the transaction decoding section name the new file.
## Definition of done
- `decodeCalldata` is defined only in `src/shared/calldataDecoder.js`, and nothing under `src/shared/` requires a file under `src/popup/`.
- Existing decoder and approval tests pass unchanged apart from their import path.
- `make check` green. Gate runs: `flock -w 3600 /srv/code/tmp/.autistmask-gate.lock script/cibuild`.
Model: opus-5-5
clawbot
self-assigned this 2026-11-10 20:54:18 +01:00
clawbot
added this to the 1.0.0 milestone 2026-11-10 20:54:24 +01:00
decodeCalldata() and tokenAmountText() are now in src/shared/calldataDecoder.js.
tokenSourcesByChainId() moved from the popup view helpers to src/shared/state.js, so the decoder requires nothing under src/popup/.
The issue says the decoder renders addresses through approvalAddressHtml(). It never did: that function was already in the view and stays there.
Model: opus-5-5
Built in https://git.eeqj.de/sneak/AutistMask/pulls/765.
- `decodeCalldata()` and `tokenAmountText()` are now in `src/shared/calldataDecoder.js`.
- `tokenSourcesByChainId()` moved from the popup view helpers to `src/shared/state.js`, so the decoder requires nothing under `src/popup/`.
- The issue says the decoder renders addresses through `approvalAddressHtml()`. It never did: that function was already in the view and stays there.
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.
decodeCalldata(), the decoder for ERC-20approveandtransfercalldata that also hands Uniswap calldata tosrc/shared/uniswap.js, lives in the TxApproval view,src/popup/views/approval.js. TransactionDetail (src/popup/views/transactionDetail.js) and four test files import it from that view.The rule:
RULES.mdTransaction Decoding, "Decoders are self-contained modules insrc/shared/". sneak'sREADME.mdtext: "The decoders live in self-contained modules undersrc/shared/(e.g.uniswap.js) so they can be added for common contracts without polluting wallet-specific code."Found in the
RULES.mdread on #672 (comment).Fix
src/shared/calldataDecoder.jsholdsdecodeCalldata()and the helpers only it uses.approval.js,transactionDetail.jsand the tests import it from there.src/popup/, asuniswap.jsdoes not: it returns data, and the views turn addresses into HTML. Where the decoder builds address HTML today (approvalAddressHtml()), move that rendering to the views.approval.jsalso uses (tokenAmountText()) lives in one place and is imported by the other; nothing is copied.README.md: the module list and the transaction decoding section name the new file.Definition of done
decodeCalldatais defined only insrc/shared/calldataDecoder.js, and nothing undersrc/shared/requires a file undersrc/popup/.make checkgreen. Gate runs:flock -w 3600 /srv/code/tmp/.autistmask-gate.lock script/cibuild.Model: opus-5-5
Built in #765.
decodeCalldata()andtokenAmountText()are now insrc/shared/calldataDecoder.js.tokenSourcesByChainId()moved from the popup view helpers tosrc/shared/state.js, so the decoder requires nothing undersrc/popup/.approvalAddressHtml(). It never did: that function was already in the view and stays there.Model: opus-5-5