Skip to content

Commit

Permalink
ci(guardian-prover-health-check-ui): fix failing lint job
Browse files Browse the repository at this point in the history
  • Loading branch information
dionysuzx committed May 13, 2024
1 parent c7f3143 commit 727951d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion packages/guardian-prover-health-check-ui/src/app.config.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const configuredNetworks = ['hekla', 'devnet']
export const configuredNetworks = ['hekla', 'devnet'];
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ async function fetchGuardians() {

guardian.name = await getPseudonym(guardian.address);

console.log("getting balance for", guardian.name, guardian.id, guardian.address);
console.log('getting balance for', guardian.name, guardian.id, guardian.address);

const [status, uptime, balance] = await Promise.all([
fetchLatestGuardianProverHealthCheckFromApi(
Expand All @@ -125,7 +125,6 @@ async function fetchGuardians() {
),
fetchUptimeFromApi(import.meta.env.VITE_GUARDIAN_PROVER_API_URL, guardian.address),
publicClient.getBalance({ address: guardian.address as Address })

]);

guardian.balance = formatEther(balance);
Expand All @@ -141,7 +140,6 @@ async function fetchGuardians() {
guardianProvers.set(updatedGuardians);
lastGuardianFetchTimestamp.set(Date.now());
console.log('updatedGuardians', updatedGuardians);

}

async function fetchSignedBlockStats() {
Expand Down Expand Up @@ -188,7 +186,7 @@ async function fetchStats(): Promise<void> {
const guardians = get(guardianProvers);

const updatedGuardiansPromises = guardians.map(async (guardian) => {
console.log('fetching stats for', guardian.address)
console.log('fetching stats for', guardian.address);
const startupDataFetch = fetchStartupDataFromApi(
import.meta.env.VITE_GUARDIAN_PROVER_API_URL,
guardian.address
Expand All @@ -210,7 +208,6 @@ async function fetchStats(): Promise<void> {
revision: startupData.revision
};


const blockInfo: BlockInfo = {
latestL1BlockNumber: nodeInfo.latestL1BlockNumber,
latestL2BlockNumber: nodeInfo.latestL2BlockNumber
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { configuredNetworks } from "$config";
import { configuredNetworks } from '$config';

export async function loadGuardians(): Promise<{ [address: string]: string }> {
const network = import.meta.env.VITE_NETWORK_CONFIG;
if (!network) {
throw new Error('Network not configured. Please set VITE_NETWORK_CONFIG in .env file. Currently supported networks: ' + configuredNetworks.join(', '));
}
const path = `/config/${network}/guardians.json`;
const response = await fetch(path);
if (!response.ok) {
throw new Error(`Failed to load ${path}: ${response.statusText}`);
}
return response.json();
const network = import.meta.env.VITE_NETWORK_CONFIG;
if (!network) {
throw new Error(
'Network not configured. Please set VITE_NETWORK_CONFIG in .env file. Currently supported networks: ' +
configuredNetworks.join(', ')
);
}
const path = `/config/${network}/guardians.json`;
const response = await fetch(path);
if (!response.ok) {
throw new Error(`Failed to load ${path}: ${response.statusText}`);
}
return response.json();
}

2 changes: 1 addition & 1 deletion packages/guardian-prover-health-check-ui/src/lib/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Address } from "viem";
import type { Address } from 'viem';

export type SignedBlock = {
blockHash: string;
Expand Down

0 comments on commit 727951d

Please sign in to comment.