A request the node refuses now reaches the page with the node's own JSON-RPC code and data. That covers a proxied read such as a reverting eth_call, an eth_sendTransaction whose gas estimate reverts, and a failed broadcast. Every other refusal the background sends also carries a code: 4100 when there is no address, and -32603 for a failure inside the wallet (an address switch, a refused signature, a node that cannot be reached).
requestError() in src/background/index.js builds each of these answers. On the transaction path the page keeps the wallet's own sentence, and only the code and data come from the node. src/content/inpage.js already passed both through and is unchanged.
The existing approval tests in tests/backgroundApproval.test.js now expect the codes. Its nonce-collision test throws the node's error under info.error, the place ethers puts it. The new test, tests/rpcErrorCodes.test.js, sends requests through the real background and real ethers to a fake node.
Judgement call: the two refusals in prepareApprovalTx() that blame the site's request (two different gas limits, a transaction type this wallet does not sign) answer -32602. The plan gave non-node preparation failures -32603, but its general rule gives -32602 to a request refused as malformed.
Deviation: nodeError(), which finds the node's error inside an ethers error, lives in src/shared/approvalVerify.js. failureTexts() already did the same lookup there inline, and both approvalTx.js and the background need it.
Unverified: not run in a browser.
Model: opus-5-5
Implements https://git.eeqj.de/sneak/AutistMask/issues/533 as planned on the issue.
A request the node refuses now reaches the page with the node's own JSON-RPC `code` and `data`. That covers a proxied read such as a reverting `eth_call`, an `eth_sendTransaction` whose gas estimate reverts, and a failed broadcast. Every other refusal the background sends also carries a code: `4100` when there is no address, and `-32603` for a failure inside the wallet (an address switch, a refused signature, a node that cannot be reached).
`requestError()` in `src/background/index.js` builds each of these answers. On the transaction path the page keeps the wallet's own sentence, and only the code and data come from the node. `src/content/inpage.js` already passed both through and is unchanged.
The existing approval tests in `tests/backgroundApproval.test.js` now expect the codes. Its nonce-collision test throws the node's error under `info.error`, the place ethers puts it. The new test, `tests/rpcErrorCodes.test.js`, sends requests through the real background and real ethers to a fake node.
Judgement call: the two refusals in `prepareApprovalTx()` that blame the site's request (two different gas limits, a transaction type this wallet does not sign) answer `-32602`. The plan gave non-node preparation failures `-32603`, but its general rule gives `-32602` to a request refused as malformed.
Deviation: `nodeError()`, which finds the node's error inside an ethers error, lives in `src/shared/approvalVerify.js`. `failureTexts()` already did the same lookup there inline, and both `approvalTx.js` and the background need it.
Unverified: not run in a browser.
Model: opus-5-5
A page's request that the node refuses now reaches it with the node's
own JSON-RPC code and data: a proxied read such as a reverting eth_call,
a transaction whose gas estimate reverts, and a failed broadcast. Every
other refusal carries a code too: 4100 when there is no address, -32602
when the site asks for two different gas limits or a transaction type
this wallet does not sign, and -32603 for a failure inside the wallet.
nodeError() in approvalVerify.js reads the node's error out of what
ethers throws, as failureTexts() already did inline.
Model: opus-5-5
PR body is too long: it runs to about 275 words, over the limit of about 250. Trim it to 250 words or fewer. For example, cut the sentence explaining how requestError() treats a string code (the code comment already says this) and the "(directory tests/)" aside. Keep the link to #533, the judgement call, the deviation, the unverified line and Model: opus-5-5. The code and the commit need no change.
Model: opus-5-5
Review failed.
- PR body is too long: it runs to about 275 words, over the limit of about 250. Trim it to 250 words or fewer. For example, cut the sentence explaining how `requestError()` treats a string `code` (the code comment already says this) and the "(directory `tests/`)" aside. Keep the link to https://git.eeqj.de/sneak/AutistMask/issues/533, the judgement call, the deviation, the unverified line and `Model: opus-5-5`. The code and the commit need no change.
Model: opus-5-5
PR body length: cut the sentence on how requestError() treats a string code and the directory aside; the body is now under 250 words, with the issue link, judgement call, deviation, unverified line and model line kept.
Model: opus-5-5
- PR body length: cut the sentence on how `requestError()` treats a string `code` and the directory aside; the body is now under 250 words, with the issue link, judgement call, deviation, unverified line and model line kept.
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.
Implements #533 as planned on the issue.
A request the node refuses now reaches the page with the node's own JSON-RPC
codeanddata. That covers a proxied read such as a revertingeth_call, aneth_sendTransactionwhose gas estimate reverts, and a failed broadcast. Every other refusal the background sends also carries a code:4100when there is no address, and-32603for a failure inside the wallet (an address switch, a refused signature, a node that cannot be reached).requestError()insrc/background/index.jsbuilds each of these answers. On the transaction path the page keeps the wallet's own sentence, and only the code and data come from the node.src/content/inpage.jsalready passed both through and is unchanged.The existing approval tests in
tests/backgroundApproval.test.jsnow expect the codes. Its nonce-collision test throws the node's error underinfo.error, the place ethers puts it. The new test,tests/rpcErrorCodes.test.js, sends requests through the real background and real ethers to a fake node.Judgement call: the two refusals in
prepareApprovalTx()that blame the site's request (two different gas limits, a transaction type this wallet does not sign) answer-32602. The plan gave non-node preparation failures-32603, but its general rule gives-32602to a request refused as malformed.Deviation:
nodeError(), which finds the node's error inside an ethers error, lives insrc/shared/approvalVerify.js.failureTexts()already did the same lookup there inline, and bothapprovalTx.jsand the background need it.Unverified: not run in a browser.
Model: opus-5-5
Review failed.
requestError()treats a stringcode(the code comment already says this) and the "(directorytests/)" aside. Keep the link to #533, the judgement call, the deviation, the unverified line andModel: opus-5-5. The code and the commit need no change.Model: opus-5-5
requestError()treats a stringcodeand the directory aside; the body is now under 250 words, with the issue link, judgement call, deviation, unverified line and model line kept.Model: opus-5-5
Review passed.
Model: opus-5-5