Skip to content

Commit

Permalink
Fix type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
danjm committed May 2, 2024
1 parent c64e67f commit 756f043
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/scripts/lib/transaction/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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;
Expand All @@ -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<string, any>;
const transactionMeta = transactionEventPayload;
const transactionMeta = { ...transactionEventPayload };
const { txReceipt } = transactionMeta;

extraParams.gas_used = txReceipt?.gasUsed;
Expand Down

0 comments on commit 756f043

Please sign in to comment.