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:
@@ -7,7 +7,7 @@
|
||||
// a pure function that applies anti-poisoning heuristics.
|
||||
|
||||
const { formatEther, formatUnits } = require("ethers");
|
||||
const { log } = require("./log");
|
||||
const { log, debugFetch } = require("./log");
|
||||
const { KNOWN_SYMBOLS } = require("./tokens");
|
||||
|
||||
function formatTxValue(val) {
|
||||
@@ -67,8 +67,8 @@ async function fetchRecentTransactions(address, blockscoutUrl, count = 25) {
|
||||
const addrLower = address.toLowerCase();
|
||||
|
||||
const [txResp, ttResp] = await Promise.all([
|
||||
fetch(blockscoutUrl + "/addresses/" + address + "/transactions"),
|
||||
fetch(
|
||||
debugFetch(blockscoutUrl + "/addresses/" + address + "/transactions"),
|
||||
debugFetch(
|
||||
blockscoutUrl +
|
||||
"/addresses/" +
|
||||
address +
|
||||
|
||||
Reference in New Issue
Block a user