decodeCalldata() and tokenAmountText() move from src/popup/views/approval.js to the new src/shared/calldataDecoder.js. The function bodies do not change. TxApproval keeps its import of tokenAmountText() for the permit lines.
tokenSourcesByChainId() moves from src/popup/views/helpers.js to src/shared/state.js, beside currentNetwork(). The decoder needs it, and it reads only state and the network table. helpers.js, approval.js and send.js import it from state.js.
TransactionDetail and six test files change only their import path. tests/approvalDisplayFloor.test.js and src/shared/amountDisplay.js also had a comment naming the old file.
README.md: the shared module list gains calldataDecoder.js, and Transaction decoding names it.
What the diff does not show:
The decoder never called approvalAddressHtml(). That function was already in the view and stays there, so no address rendering moved.
The new module requires src/shared/state.js, so it is popup only, like ens.js. The build already fails if a background bundle reaches state.js.
Judgement call: tokenSourcesByChainId() went into state.js rather than a module of its own. Moving it again later changes the same four imports.
Model: opus-5-5
Closes https://git.eeqj.de/sneak/AutistMask/issues/759.
- `decodeCalldata()` and `tokenAmountText()` move from `src/popup/views/approval.js` to the new `src/shared/calldataDecoder.js`. The function bodies do not change. TxApproval keeps its import of `tokenAmountText()` for the permit lines.
- `tokenSourcesByChainId()` moves from `src/popup/views/helpers.js` to `src/shared/state.js`, beside `currentNetwork()`. The decoder needs it, and it reads only `state` and the network table. `helpers.js`, `approval.js` and `send.js` import it from `state.js`.
- TransactionDetail and six test files change only their import path. `tests/approvalDisplayFloor.test.js` and `src/shared/amountDisplay.js` also had a comment naming the old file.
- `README.md`: the shared module list gains `calldataDecoder.js`, and Transaction decoding names it.
What the diff does not show:
- The decoder never called `approvalAddressHtml()`. That function was already in the view and stays there, so no address rendering moved.
- The new module requires `src/shared/state.js`, so it is popup only, like `ens.js`. The build already fails if a background bundle reaches `state.js`.
Judgement call: `tokenSourcesByChainId()` went into `state.js` rather than a module of its own. Moving it again later changes the same four imports.
Model: opus-5-5
decodeCalldata() and tokenAmountText() move out of the TxApproval view into
src/shared/calldataDecoder.js. TxApproval, TransactionDetail and the decoder
tests import them from there.
tokenSourcesByChainId() moves from the popup view helpers to
src/shared/state.js, beside currentNetwork(), so the decoder requires nothing
under src/popup/. It reads only the state singleton and the network table.
Model: opus-5-5
PASS: the decoder now lives in src/shared/calldataDecoder.js, nothing under src/shared/ requires a file under src/popup/, and the definition of done in #759 is met.
Model: opus-5-5
PASS: the decoder now lives in `src/shared/calldataDecoder.js`, nothing under `src/shared/` requires a file under `src/popup/`, and the definition of done in https://git.eeqj.de/sneak/AutistMask/issues/759 is met.
Model: opus-5-5
clawbot
merged commit 6d158bf1b1 into next2026-11-10 22:33:26 +01:00
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.
Closes #759.
decodeCalldata()andtokenAmountText()move fromsrc/popup/views/approval.jsto the newsrc/shared/calldataDecoder.js. The function bodies do not change. TxApproval keeps its import oftokenAmountText()for the permit lines.tokenSourcesByChainId()moves fromsrc/popup/views/helpers.jstosrc/shared/state.js, besidecurrentNetwork(). The decoder needs it, and it reads onlystateand the network table.helpers.js,approval.jsandsend.jsimport it fromstate.js.tests/approvalDisplayFloor.test.jsandsrc/shared/amountDisplay.jsalso had a comment naming the old file.README.md: the shared module list gainscalldataDecoder.js, and Transaction decoding names it.What the diff does not show:
approvalAddressHtml(). That function was already in the view and stays there, so no address rendering moved.src/shared/state.js, so it is popup only, likeens.js. The build already fails if a background bundle reachesstate.js.Judgement call:
tokenSourcesByChainId()went intostate.jsrather than a module of its own. Moving it again later changes the same four imports.Model: opus-5-5
PASS: the decoder now lives in
src/shared/calldataDecoder.js, nothing undersrc/shared/requires a file undersrc/popup/, and the definition of done in #759 is met.Model: opus-5-5