From 4ad54ddfa3f6f0063b9b6a94efe072bae14764ed Mon Sep 17 00:00:00 2001 From: Noah Gundotra Date: Tue, 19 Nov 2024 15:04:55 -0500 Subject: [PATCH] fix verification badge --- app/components/account/VerifiedBuildCard.tsx | 4 ++-- .../common/VerifiedProgramBadge.tsx | 21 +++++++------------ app/utils/verified-builds.tsx | 1 + 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/app/components/account/VerifiedBuildCard.tsx b/app/components/account/VerifiedBuildCard.tsx index 3188edb6..5fd481d4 100644 --- a/app/components/account/VerifiedBuildCard.tsx +++ b/app/components/account/VerifiedBuildCard.tsx @@ -86,8 +86,8 @@ type TableRow = { const ROWS: TableRow[] = [ { display: 'Verified', - key: 'verification_status', - type: DisplayType.String, + key: 'is_verified', + type: DisplayType.Boolean, }, { display: 'Message', diff --git a/app/components/common/VerifiedProgramBadge.tsx b/app/components/common/VerifiedProgramBadge.tsx index 47f85a38..e695afa0 100644 --- a/app/components/common/VerifiedProgramBadge.tsx +++ b/app/components/common/VerifiedProgramBadge.tsx @@ -2,7 +2,7 @@ import { PublicKey } from '@solana/web3.js'; import Link from 'next/link'; import { useClusterPath } from '@/app/utils/url'; -import { useVerifiedProgramRegistry, VerificationStatus } from '@/app/utils/verified-builds'; +import { useVerifiedProgramRegistry } from '@/app/utils/verified-builds'; import { ProgramDataAccountInfo } from '@/app/validators/accounts/upgradeable-program'; export function VerifiedProgramBadge({ @@ -29,19 +29,12 @@ export function VerifiedProgramBadge({ let badgeClass = ''; let badgeText = ''; - switch (registryInfo.verification_status) { - case VerificationStatus.Verified: - badgeClass = 'bg-success-soft'; - badgeText = 'Program Source Verified'; - break; - case VerificationStatus.PdaUploaded: - badgeClass = 'bg-warning-soft'; - badgeText = 'Not verified'; - break; - case VerificationStatus.NotVerified: - badgeClass = 'bg-warning-soft'; - badgeText = 'Not verified'; - break; + if (registryInfo.is_verified) { + badgeClass = 'bg-success-soft'; + badgeText = 'Program Source Verified'; + } else { + badgeClass = 'bg-warning-soft'; + badgeText = 'Not verified'; } return ( diff --git a/app/utils/verified-builds.tsx b/app/utils/verified-builds.tsx index 6c46f7d2..378e500a 100644 --- a/app/utils/verified-builds.tsx +++ b/app/utils/verified-builds.tsx @@ -18,6 +18,7 @@ export enum VerificationStatus { export type OsecRegistryInfo = { verification_status: VerificationStatus; + is_verified: boolean; message: string; on_chain_hash: string; executable_hash: string;