Skip to content

Commit

Permalink
Fix TransactionResponse type (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorgomezv authored Nov 15, 2024
1 parent 2a551b2 commit 1818e51
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/__tests__/use-cases/transfers/ether-between-safes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 () => {
Expand Down
12 changes: 10 additions & 2 deletions src/__tests__/use-cases/transfers/manage-native-coins.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down Expand Up @@ -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 () => {
Expand Down

0 comments on commit 1818e51

Please sign in to comment.