Add debugFetch wrapper in log.js that logs method, URL, and body on request, and status code on response. Replace all fetch() calls across balances, transactions, tokens, background RPC proxy, and settings validation with debugFetch.
This commit is contained in:
@@ -8,6 +8,7 @@ const {
|
||||
} = require("../shared/constants");
|
||||
const { state, loadState, saveState } = require("../shared/state");
|
||||
const { refreshBalances } = require("../shared/balances");
|
||||
const { debugFetch } = require("../shared/log");
|
||||
|
||||
const storageApi =
|
||||
typeof browser !== "undefined"
|
||||
@@ -67,7 +68,7 @@ function extractHostname(origin) {
|
||||
// Proxy an RPC call to the Ethereum node
|
||||
async function proxyRpc(method, params) {
|
||||
const rpcUrl = await getRpcUrl();
|
||||
const resp = await fetch(rpcUrl, {
|
||||
const resp = await debugFetch(rpcUrl, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
|
||||
Reference in New Issue
Block a user