From ed3740d575f06e56f0c1ac0221d041f823df4ede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ph=E1=BA=A1m=20Th=C3=A0nh=20Phong?= <49814372+phamphong9981@users.noreply.github.com> Date: Tue, 15 Aug 2023 13:30:22 +0700 Subject: [PATCH] fix: duplicate latest migrate contract (#316) --- .../crawl-cosmwasm/crawl_smart_contract.service.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/services/crawl-cosmwasm/crawl_smart_contract.service.ts b/src/services/crawl-cosmwasm/crawl_smart_contract.service.ts index af13fd5ea..dfe4e8faa 100644 --- a/src/services/crawl-cosmwasm/crawl_smart_contract.service.ts +++ b/src/services/crawl-cosmwasm/crawl_smart_contract.service.ts @@ -182,10 +182,12 @@ export default class CrawlSmartContractService extends BullableService { 'code_id', codeContractValues.map((contract) => contract.codeId) ), - SmartContract.query().whereIn( - 'address', - codeContractValues.map((contract) => contract.address) - ), + SmartContract.query() + .whereIn( + 'address', + codeContractValues.map((contract) => contract.address) + ) + .andWhere('status', SmartContract.STATUS.LATEST), ]); const codeContractsByKey = _.keyBy(contractsWithMigrateCode, 'code_id');