From 86c3990c25920d0619beaba213ca8acf284842f4 Mon Sep 17 00:00:00 2001 From: man0s <95379755+losman0s@users.noreply.github.com> Date: Sun, 6 Feb 2022 11:11:12 +0100 Subject: [PATCH] Add verified/unverified badge to Program Account view (#22825) * Add verified/unverified badge to Program Account view * Generalize to any number of build verification providers --- .../UpgradeableLoaderAccountSection.tsx | 28 +++++ .../src/components/common/VerifiedBadge.tsx | 38 +++++++ explorer/src/utils/program-verification.tsx | 103 ++++++++++++++++++ 3 files changed, 169 insertions(+) create mode 100644 explorer/src/components/common/VerifiedBadge.tsx create mode 100644 explorer/src/utils/program-verification.tsx diff --git a/explorer/src/components/account/UpgradeableLoaderAccountSection.tsx b/explorer/src/components/account/UpgradeableLoaderAccountSection.tsx index 4e5ec1ca4d..37e1ef4a36 100644 --- a/explorer/src/components/account/UpgradeableLoaderAccountSection.tsx +++ b/explorer/src/components/account/UpgradeableLoaderAccountSection.tsx @@ -15,6 +15,9 @@ import { useCluster } from "providers/cluster"; import { ErrorCard } from "components/common/ErrorCard"; import { UnknownAccountCard } from "components/account/UnknownAccountCard"; import { Downloadable } from "components/common/Downloadable"; +import { CheckingBadge, VerifiedBadge } from "components/common/VerifiedBadge"; +import { InfoTooltip } from "components/common/InfoTooltip"; +import { useVerifiableBuilds } from "utils/program-verification"; export function UpgradeableLoaderAccountSection({ account, @@ -72,6 +75,7 @@ export function UpgradeableProgramSection({ const refresh = useFetchAccountInfo(); const { cluster } = useCluster(); const label = addressLabel(account.pubkey.toBase58(), cluster); + const { loading, verifiableBuilds } = useVerifiableBuilds(account.pubkey); return (