Skip to content

Commit

Permalink
fix verification badge
Browse files Browse the repository at this point in the history
  • Loading branch information
ngundotra committed Nov 19, 2024
1 parent eb206db commit 4ad54dd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
4 changes: 2 additions & 2 deletions app/components/account/VerifiedBuildCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
21 changes: 7 additions & 14 deletions app/components/common/VerifiedProgramBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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 (
Expand Down
1 change: 1 addition & 0 deletions app/utils/verified-builds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4ad54dd

Please sign in to comment.