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:
1 parent
47e690f466
commit
d24c10ca9c
6 files changed
+24
-11
No files matched your search
@@ -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