chore: drop eth_chainId and net_version from PROXY_METHODS (closes #326)
handleRpc answers both methods itself before it reaches its proxy branch, so the two list entries were never used and the list named two methods that are never sent to the RPC endpoint. No other entry is answered earlier. PROXY_METHODS is now exported from the background script so that tests/proxyMethods.test.js can send every listed method from a page and fail on any that does not reach the RPC endpoint. Model: opus-5-5
This commit was merged in pull request #470.
This commit is contained in:
@@ -741,11 +741,12 @@ async function handleConnectionRequest(origin) {
|
||||
}
|
||||
}
|
||||
|
||||
// Methods that are safe to proxy directly to the RPC node
|
||||
// Methods that are safe to proxy directly to the RPC node. A method handleRpc
|
||||
// answers before its proxy branch does not belong here: it would never reach
|
||||
// the node. tests/proxyMethods.test.js sends every one of these.
|
||||
const PROXY_METHODS = [
|
||||
"eth_blockNumber",
|
||||
"eth_call",
|
||||
"eth_chainId",
|
||||
"eth_estimateGas",
|
||||
"eth_gasPrice",
|
||||
"eth_getBalance",
|
||||
@@ -759,7 +760,6 @@ const PROXY_METHODS = [
|
||||
"eth_getTransactionReceipt",
|
||||
"eth_maxPriorityFeePerGas",
|
||||
"eth_sendRawTransaction",
|
||||
"net_version",
|
||||
"web3_clientVersion",
|
||||
"eth_feeHistory",
|
||||
"eth_getBlockTransactionCountByHash",
|
||||
@@ -1802,3 +1802,5 @@ runtime.onMessage.addListener((msg, sender, sendResponse) => {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = { PROXY_METHODS };
|
||||
|
||||
Reference in New Issue
Block a user