From 1818e51b02cc6160208e9ed38720bdab10fed328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20G=C3=B3mez?= Date: Fri, 15 Nov 2024 10:07:33 +0100 Subject: [PATCH] Fix TransactionResponse type (#38) --- .../use-cases/transfers/ether-between-safes.spec.ts | 8 ++++++-- .../use-cases/transfers/manage-native-coins.spec.ts | 12 ++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/__tests__/use-cases/transfers/ether-between-safes.spec.ts b/src/__tests__/use-cases/transfers/ether-between-safes.spec.ts index 194a969..3b9a9cd 100644 --- a/src/__tests__/use-cases/transfers/ether-between-safes.spec.ts +++ b/src/__tests__/use-cases/transfers/ether-between-safes.spec.ts @@ -11,7 +11,7 @@ import { faker } from '@faker-js/faker'; import SafeApiKit from '@safe-global/api-kit'; import Safe from '@safe-global/protocol-kit'; import { MetaTransactionData } from '@safe-global/safe-core-sdk-types'; -import { Wallet, ethers } from 'ethers'; +import { TransactionResponse, Wallet, ethers } from 'ethers'; let eoaSigner: Wallet; let primarySafeSdkInstance: Safe; @@ -98,7 +98,11 @@ describe('Transfers: receive/send native coins between Safes', () => { const safeTransaction = await apiKit.getTransaction(safeTxHash); const executeTxResponse = await primarySafeSdkInstance.executeTransaction(safeTransaction); - await executeTxResponse.transactionResponse?.wait(); + if (executeTxResponse.transactionResponse) { + await ( + executeTxResponse.transactionResponse as TransactionResponse + ).wait(); + } // Check the CGW history contains the transaction await retry(async () => { diff --git a/src/__tests__/use-cases/transfers/manage-native-coins.spec.ts b/src/__tests__/use-cases/transfers/manage-native-coins.spec.ts index 9bdc7c2..9bd408e 100644 --- a/src/__tests__/use-cases/transfers/manage-native-coins.spec.ts +++ b/src/__tests__/use-cases/transfers/manage-native-coins.spec.ts @@ -58,7 +58,11 @@ describe('Transactions cleanup', () => { const safeTransaction = await apiKit.getTransaction(tx.safeTxHash); const executeTxResponse = await sdkInstance.executeTransaction(safeTransaction); - await executeTxResponse.transactionResponse?.wait(); + if (executeTxResponse.transactionResponse) { + await ( + executeTxResponse.transactionResponse as TransactionResponse + ).wait(); + } // Check the CGW history contains the transaction await retry(async () => { @@ -196,7 +200,11 @@ describe('Transfers: receive/send native coins from/to EOA', () => { const safeTransaction = await apiKit.getTransaction(safeTxHash); const executeTxResponse = await sdkInstance.executeTransaction(safeTransaction); - await executeTxResponse.transactionResponse?.wait(); + if (executeTxResponse.transactionResponse) { + await ( + executeTxResponse.transactionResponse as TransactionResponse + ).wait(); + } // Check the CGW history contains the transaction await retry(async () => {