diff --git a/apps/contract-verification/src/app/Receipts/EtherscanReceipt.tsx b/apps/contract-verification/src/app/Receipts/EtherscanReceipt.tsx deleted file mode 100644 index 34ce9eb1f4..0000000000 --- a/apps/contract-verification/src/app/Receipts/EtherscanReceipt.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import React, { useState, useEffect } from 'react' -import { EtherscanVerifier } from '../Verifiers/EtherscanVerifier' -import { ReceiptProps } from './props' - -export const EtherscanReceipt: React.FC = ({ verifyPromise, address, chainId, verifier }) => { - const [status, setStatus] = useState(null) - const [submissionDate] = useState(new Date()) - - useEffect(() => { - // Handle the promise here or perform other side effects - verifyPromise - .then(() => { - // Handle promise resolution - // Update status based on the result - }) - .catch(() => { - // Handle promise rejection - }) - - // This effect should only run once on mount, hence the empty dependency array - }, [verifyPromise]) - - return ( -
-

Verification Receipt

-

Address: {address}

-

Chain ID: {chainId}

-

Submission Date: {submissionDate.toLocaleString()}

-

Status: {status ? status : 'Pending'}

-
- ) -} - -export default EtherscanReceipt diff --git a/apps/contract-verification/src/app/Receipts/SourcifyReceipt.tsx b/apps/contract-verification/src/app/Receipts/SourcifyReceipt.tsx deleted file mode 100644 index 063c73d5bf..0000000000 --- a/apps/contract-verification/src/app/Receipts/SourcifyReceipt.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import React, { useState, useEffect } from 'react' -import { SourcifyVerifier } from '../Verifiers/SourcifyVerifier' -// import { SourcifyVerificationStatus } from '../types' -import { ReceiptProps } from './props' - -// A receipt is something to be rendered -export const SourcifyReceipt: React.FC = ({ verifyPromise, address, chainId, verifier }) => { - const [status, setStatus] = useState< null>(null) - const [submissionDate] = useState(new Date()) // This will be set once and not change - - useEffect(() => { - // You might want to handle the promise here or perform other side effects - verifyPromise - .then(() => { - // Handle promise resolution - // Update status based on the result - }) - .catch(() => { - // Handle promise rejection - }) - - // This effect should only run once on mount, hence the empty dependency array - }, [verifyPromise]) - - return ( -
-

Verification Receipt

-

Address: {address}

-

Chain ID: {chainId}

-

Submission Date: {submissionDate.toLocaleString()}

-

Status: {status ? status : 'Pending'}

-
- ) -} - -export default SourcifyReceipt diff --git a/apps/contract-verification/src/app/Receipts/props.ts b/apps/contract-verification/src/app/Receipts/props.ts deleted file mode 100644 index e1f4b1e60f..0000000000 --- a/apps/contract-verification/src/app/Receipts/props.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { EtherscanVerifier } from '../Verifiers/EtherscanVerifier' -import { SourcifyVerifier } from '../Verifiers/SourcifyVerifier' - -export interface ReceiptProps { - verifyPromise: Promise - address: string - chainId: string - verifier: EtherscanVerifier | SourcifyVerifier -} diff --git a/apps/contract-verification/src/app/Verifiers/EtherscanVerifier.ts b/apps/contract-verification/src/app/Verifiers/EtherscanVerifier.ts index 09c631ec1d..a0e729fb91 100644 --- a/apps/contract-verification/src/app/Verifiers/EtherscanVerifier.ts +++ b/apps/contract-verification/src/app/Verifiers/EtherscanVerifier.ts @@ -76,7 +76,6 @@ export class EtherscanVerifier extends AbstractVerifier { return { status: 'pending', receiptId: verificationResponse.result } } - // TODO retry with backoff in case this throws error async checkVerificationStatus(receiptId: string): Promise { const url = new URL(this.apiUrl + '/api') url.searchParams.append('module', 'contract')