diff --git a/packages/web3-eth-contract/test/integration/local_account/contract_erc721.test.ts b/packages/web3-eth-contract/test/integration/local_account/contract_erc721.test.ts index 2b50e735257..159a4f93904 100644 --- a/packages/web3-eth-contract/test/integration/local_account/contract_erc721.test.ts +++ b/packages/web3-eth-contract/test/integration/local_account/contract_erc721.test.ts @@ -19,7 +19,6 @@ along with web3.js. If not, see . import Web3 from 'web3'; // eslint-disable-next-line import/no-extraneous-dependencies import { Web3Account } from 'web3-eth-accounts'; -import { EventLog } from 'web3-types'; import { Contract } from '../../../src'; import { ERC721TokenAbi, ERC721TokenBytecode } from '../../shared_fixtures/build/ERC721Token'; import { getSystemTestProvider, createLocalAccount } from '../../fixtures/system_test_utils'; @@ -80,8 +79,8 @@ describe('contract', () => { tempAccount.address.toLowerCase(), ); - const logs = await contractDeployed.getPastEvents('Transfer'); - const tokenId = (logs[0] as EventLog)?.returnValues?.tokenId as string; + + const tokenId = awardReceipt.events?.Transfer.returnValues.tokenId as string; expect( toUpperCaseHex( @@ -113,8 +112,7 @@ describe('contract', () => { tempAccount.address.toLowerCase(), ); - const logs = await contractDeployed.getPastEvents('Transfer'); - const tokenId = (logs[0] as EventLog)?.returnValues?.tokenId as string; + const tokenId = awardReceipt.events?.Transfer.returnValues.tokenId as string; const transferFromReceipt = await contractDeployed.methods .transferFrom(tempAccount.address, toAccount.address, tokenId) .send({ @@ -185,9 +183,8 @@ describe('contract', () => { expect(String(awardReceipt.events?.Transfer.returnValues[1]).toLowerCase()).toBe( tempAccount.address.toLowerCase(), ); - - const logs = await contractDeployed.getPastEvents('Transfer'); - const tokenId = (logs[0] as EventLog)?.returnValues?.tokenId as string; + + const tokenId = awardReceipt.events?.Transfer.returnValues.tokenId as string; const approveReceipt = await contractDeployed.methods .approve(toAccount.address, tokenId)