Skip to content

Commit 61d2360

Browse files
authored
Merge pull request #215 from r4topunk/chore/mor-note2
chore: capture etherscan error string
2 parents b31ac81 + 13410ab commit 61d2360

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/services/stake-graph.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ async function etherscanReferred(pool: Address, referrer: Address, key: string):
158158
try {
159159
const res = await fetch(url, { cache: "no-store" });
160160
const j = (await res.json()) as { status?: string; message?: string; result?: unknown };
161-
_morNote = `${j.status ?? "?"}|${String(j.message ?? "?").slice(0, 40)}|${Array.isArray(j.result) ? j.result.length : typeof j.result}`;
161+
_morNote = `${j.status ?? "?"}|${String(j.message ?? "?").slice(0, 30)}|${Array.isArray(j.result) ? `n=${j.result.length}` : String(j.result).slice(0, 70)}`;
162162
if (j.status === "1" && Array.isArray(j.result)) {
163163
return (j.result as Array<{ topics: string[]; data: string }>).map((l) => ({ user: getAddress(`0x${l.topics[2].slice(26)}`), amount: BigInt(l.data) }));
164164
}

0 commit comments

Comments
 (0)