diff --git a/packages/delegator-e2e/test/caveats/ownershipTransfer.test.ts b/packages/delegator-e2e/test/caveats/ownershipTransfer.test.ts index 814d428c..b1990d01 100644 --- a/packages/delegator-e2e/test/caveats/ownershipTransfer.test.ts +++ b/packages/delegator-e2e/test/caveats/ownershipTransfer.test.ts @@ -148,7 +148,11 @@ describe('Ownership Transfer Caveat', () => { ...gasPrice, }); - await expectUserOperationToSucceed(userOpHash); + const receipt = await sponsoredBundlerClient.waitForUserOperationReceipt({ + hash: userOpHash, + }); + + await expectUserOperationToSucceed(receipt); // Verify ownership was transferred successfully const finalOwner = await getContractOwner(contractAddress); @@ -304,7 +308,11 @@ describe('Ownership Transfer Caveat', () => { ...gasPrice, }); - await expectUserOperationToSucceed(userOpHash); + const receipt = await sponsoredBundlerClient.waitForUserOperationReceipt({ + hash: userOpHash, + }); + + await expectUserOperationToSucceed(receipt); // Verify ownership was transferred successfully const finalOwner = await getContractOwner(contractAddress); diff --git a/packages/delegator-e2e/test/utils/assertions.ts b/packages/delegator-e2e/test/utils/assertions.ts index 16659224..e5b72bad 100644 --- a/packages/delegator-e2e/test/utils/assertions.ts +++ b/packages/delegator-e2e/test/utils/assertions.ts @@ -1,8 +1,7 @@ import { Address } from 'viem'; import { expect } from 'vitest'; import { publicClient } from './helpers'; -import { UserOperationReceiptResponse } from '@metamask/delegation-toolkit'; - +import type { UserOperationReceipt } from 'viem/account-abstraction'; // common assertions to be shared across tests export const expectCodeAt = async (address: Address, message?: string) => { @@ -21,11 +20,11 @@ export const expectNoCodeAt = async (address: Address, message?: string) => { // todo: make this attempt to decode the failure logs // that is why I've made this asyncronous export const expectUserOperationToSucceed = async ( - receipt: UserOperationReceiptResponse, + receipt: UserOperationReceipt, message?: string, ) => { expect( receipt.success, message || `Expected user operation ${receipt.userOpHash} to succeed`, - ).toBeTruthy; + ).toBeTruthy(); };