From e75671ced3eb0b41cd1102f1fa3e59d602702d26 Mon Sep 17 00:00:00 2001 From: Manuel Wedler Date: Tue, 30 Jul 2024 12:43:35 +0200 Subject: [PATCH] Check proxy receipt status frequently --- apps/contract-verification/src/app/app.tsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/apps/contract-verification/src/app/app.tsx b/apps/contract-verification/src/app/app.tsx index aea4e607b5..13f4e8394f 100644 --- a/apps/contract-verification/src/app/app.tsx +++ b/apps/contract-verification/src/app/app.tsx @@ -4,7 +4,7 @@ import { ContractVerificationPluginClient } from './ContractVerificationPluginCl import { AppContext } from './AppContext' import DisplayRoutes from './routes' -import type { ContractVerificationSettings, ThemeType, Chain, SubmittedContracts, VerificationReceipt } from './types' +import type { ContractVerificationSettings, ThemeType, Chain, SubmittedContracts, VerificationReceipt, VerificationResponse } from './types' import { mergeChainSettingsWithDefaults } from './utils' import './App.css' @@ -65,6 +65,11 @@ const App = () => { pendingReceipts.push(receipt) } } + for (const proxyReceipt of submission.proxyReceipts ?? []) { + if (proxyReceipt.status === 'pending') { + pendingReceipts.push(proxyReceipt) + } + } } return pendingReceipts } @@ -96,7 +101,13 @@ const App = () => { } try { - const { status, message } = await verifier.checkVerificationStatus(receiptId) + let response: VerificationResponse + if (receipt.isProxyReceipt) { + response = await verifier.checkProxyVerificationStatus(receiptId) + } else { + response = await verifier.checkVerificationStatus(receiptId) + } + const { status, message } = response receipt.status = status receipt.message = message } catch (e) {} // try again in next call