Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(guardian-prover-health-check-ui): fix failing lint job #17122

Merged
merged 4 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions .github/workflows/guardians-ui-ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Guardians UI Build and Checks

on:
workflow_call
on: workflow_call

jobs:
check-guardian-prover-health-check-ui:
Expand Down Expand Up @@ -31,9 +30,3 @@ jobs:
- name: Linting
working-directory: ./packages/guardian-prover-health-check-ui
run: pnpm lint

- name: Unit tests
env:
SKIP_ENV_VALIDATION: "true"
working-directory: ./packages/guardian-prover-health-check-ui
run: pnpm test:unit
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