diff --git a/test/unit/services/erc721/erc721.spec.ts b/test/unit/services/erc721/erc721.spec.ts index 9d352233e..d2b8c30b0 100644 --- a/test/unit/services/erc721/erc721.spec.ts +++ b/test/unit/services/erc721/erc721.spec.ts @@ -48,7 +48,7 @@ export default class Erc721Test { evmTx = EVMTransaction.fromJson({ id: 11111, hash: '', - height: 111, + height: this.evmSmartContract.created_height, tx_msg_id: 222, tx_id: 223, contract_address: '', diff --git a/test/unit/services/erc721/erc721_handler.spec.ts b/test/unit/services/erc721/erc721_handler.spec.ts index 8bdee2bdb..f02644e7a 100644 --- a/test/unit/services/erc721/erc721_handler.spec.ts +++ b/test/unit/services/erc721/erc721_handler.spec.ts @@ -163,8 +163,8 @@ export default class Erc721HandlerTest { ]; await EvmEvent.query().insert(erc721Events).transacting(trx); const erc721Activities = await Erc721Handler.getErc721Activities( - 21937979, - 21937985, + this.evmTx.height - 1, + this.evmTx.height, this.broker.logger, undefined, trx @@ -195,8 +195,8 @@ export default class Erc721HandlerTest { }); const erc721ActivitiesByContract = await Erc721Handler.getErc721Activities( - 21937979, - 21937985, + this.evmTx.height - 1, + this.evmTx.height, this.broker.logger, [this.evmSmartContract2.address], trx diff --git a/test/unit/services/evm/crawl_contract_evm.spec.ts b/test/unit/services/evm/crawl_contract_evm.spec.ts index a83367c26..e6ca58c84 100644 --- a/test/unit/services/evm/crawl_contract_evm.spec.ts +++ b/test/unit/services/evm/crawl_contract_evm.spec.ts @@ -5,6 +5,7 @@ import knex from '../../../../src/common/utils/db_connection'; import { BlockCheckpoint, EVMSmartContract, + EVMTransaction, EvmInternalTransaction, } from '../../../../src/models'; @@ -69,6 +70,13 @@ export default class CrawlContractEvmTest { height: evmSmartContract.created_height, }), ]; + const mockTxQuery: any = { + select: () => mockTxQuery, + limit: () => ({ id: 1 }), + findOne: () => mockTxQuery, + orderBy: () => mockTxQuery, + }; + jest.spyOn(EVMTransaction, 'query').mockImplementation(() => mockTxQuery); const mockSelfDestructQuery: any = { select: () => mockSelfDestructQuery, joinRelated: () => mockSelfDestructQuery,