Skip to content

Commit

Permalink
fix: ignore invalid addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
Jabolol committed Oct 20, 2024
1 parent d4435b3 commit 623368d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/sdk/src/metrics/fetchMetricsForPool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Tables } from "types.js";
import { FailResult, OkResult, Result } from "typescript-monads";
import { metricsForProject, type PoolEntryMetrics } from "../utils/metrics.js";
import core from "@actions/core";
import { isAddress } from "viem";

type ExtendedMetrics = {
info: Tables<"pool_registrations">;
Expand Down Expand Up @@ -33,7 +34,11 @@ export const fetchMetricsForPool = async (
return new FailResult(poolError);
}

for (const project of poolData) {
const hasValidAddress = poolData.filter(
(project) => isAddress(project.wallet_address),
);

for (const project of hasValidAddress) {
const projectMetric = await metricsForProject(
project.artifact_namespace,
project.artifact_name,
Expand Down

0 comments on commit 623368d

Please sign in to comment.