Skip to content

Commit 2f6c197

Browse files
committed
Fix CI lint errors: const, unused imports, setState in effect, any type
1 parent 5c521f8 commit 2f6c197

4 files changed

Lines changed: 19 additions & 19 deletions

File tree

src/app/clear-signing/admin/page.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,22 @@ export default function AdminPage() {
7878
setLoading(false);
7979
}, []);
8080

81+
// Load entries on mount (effect subscribes to external ENS state)
8182
useEffect(() => {
82-
refreshEntries();
83-
}, [refreshEntries]);
83+
let cancelled = false;
84+
(async () => {
85+
const map = new Map<string, EnsSpecEntry | null>();
86+
for (const c of KNOWN_CONTRACTS) {
87+
const entry = await readSpecFromEns(c.address);
88+
map.set(c.address.toLowerCase(), entry);
89+
}
90+
if (!cancelled) {
91+
setEntries(map);
92+
setLoading(false);
93+
}
94+
})();
95+
return () => { cancelled = true; };
96+
}, []);
8497

8598
// ── Write a preset entry ──
8699
const handleWritePreset = useCallback(

src/app/clear-signing/engine/decoder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ export function encodeCalldata(
165165
params: { type: ParamType; value: Value }[]
166166
): string {
167167
const sel = selector.startsWith("0x") ? selector.slice(2) : selector;
168-
let staticParts: string[] = [];
169-
let dynamicParts: string[] = [];
168+
const staticParts: string[] = [];
169+
const dynamicParts: string[] = [];
170170
// Track dynamic data offset (starts after all static words)
171171
let dynamicOffset = params.length * 32;
172172

src/app/clear-signing/engine/loader.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,25 +81,12 @@ function parseHole(
8181
}
8282

8383
function parseTemplate(
84-
t: { text: string; holes: { name: string; format: any }[] },
84+
t: { text: string; holes: { name: string; format: { kind: string; decimals?: number; symbol?: string } }[] },
8585
deploymentMeta?: { decimals?: number; symbol?: string }
8686
): Template {
8787
return { text: t.text, holes: t.holes.map(h => parseHole(h, deploymentMeta)) };
8888
}
8989

90-
function parseExpr(e: JsonExpr): Expr {
91-
switch (e.kind) {
92-
case "param":
93-
return { kind: "param", name: e.name };
94-
case "const":
95-
return { kind: "const", value: BigInt(e.value) };
96-
case "eq":
97-
return { kind: "eq", left: parseExpr(e.left), right: parseExpr(e.right) };
98-
default:
99-
return { kind: "const", value: 0n };
100-
}
101-
}
102-
10390
function parseParamType(t: string): ParamType {
10491
if (t.startsWith("array(")) return "address[]"; // Simplified
10592
switch (t) {

src/app/clear-signing/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import React, { useState, useCallback, useRef, useEffect } from "react";
44
import { ExternalLink, Disclosure } from "../components";
5-
import { findSpec, findSpecFromEns } from "./engine/specs";
5+
import { findSpecFromEns } from "./engine/specs";
66
import { extractSelector, decodeCalldata } from "./engine/decoder";
77
import { evaluateIntent, collectAllTemplates } from "./engine/evaluator";
88
import {

0 commit comments

Comments
 (0)