From 756f043c336431ede95ef25fc11e3d95f5f2e322 Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Thu, 2 May 2024 09:51:28 -0230 Subject: [PATCH] Fix type errors --- app/scripts/lib/transaction/metrics.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/scripts/lib/transaction/metrics.ts b/app/scripts/lib/transaction/metrics.ts index 5e2f1d28ac54..667643bd8408 100644 --- a/app/scripts/lib/transaction/metrics.ts +++ b/app/scripts/lib/transaction/metrics.ts @@ -102,6 +102,11 @@ export type TransactionEventPayload = { error?: string; }; +export type TransactionMetaEventPayload = TransactionMeta & { + actionId?: string; + error?: string; +}; + /** * This function is called when a transaction is added to the controller. * @@ -197,7 +202,7 @@ export const handleTransactionFailed = async ( */ export const handleTransactionConfirmed = async ( transactionMetricsRequest: TransactionMetricsRequest, - transactionEventPayload: TransactionEventPayload, + transactionEventPayload: TransactionMetaEventPayload, ) => { if (Object.keys(transactionEventPayload).length === 0) { return; @@ -206,7 +211,7 @@ export const handleTransactionConfirmed = async ( // TODO: Replace `any` with type // eslint-disable-next-line @typescript-eslint/no-explicit-any const extraParams = {} as Record; - const transactionMeta = transactionEventPayload; + const transactionMeta = { ...transactionEventPayload }; const { txReceipt } = transactionMeta; extraParams.gas_used = txReceipt?.gasUsed;