From ad2b65f3a95116205de55b749c287eff9fdb7d42 Mon Sep 17 00:00:00 2001 From: phamphong9981 Date: Tue, 23 Jul 2024 15:18:42 +0700 Subject: [PATCH] refactor: instantiate erc20 module account --- src/services/evm/erc20.service.ts | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/services/evm/erc20.service.ts b/src/services/evm/erc20.service.ts index 021fa93b1..2ca5dcb7b 100644 --- a/src/services/evm/erc20.service.ts +++ b/src/services/evm/erc20.service.ts @@ -351,19 +351,18 @@ export default class Erc20Service extends BullableService { public async _start(): Promise { this.viemClient = getViemClient(); - if (config.evmOnly === false) { - const lcdClient = await getLcdClient(); - const erc20Account: QueryModuleAccountByNameResponseSDKType = - await lcdClient.provider.cosmos.auth.v1beta1.moduleAccountByName({ - name: 'erc20', - }); - - Erc20Handler.erc20ModuleAccount = - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - erc20Account.account.base_account.address; - } if (NODE_ENV !== 'test') { + if (config.evmOnly === false) { + const lcdClient = await getLcdClient(); + const erc20Account: QueryModuleAccountByNameResponseSDKType = + await lcdClient.provider.cosmos.auth.v1beta1.moduleAccountByName({ + name: 'erc20', + }); + Erc20Handler.erc20ModuleAccount = + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + erc20Account.account.base_account.address; + } await this.createJob( BULL_JOB_NAME.HANDLE_ERC20_CONTRACT, BULL_JOB_NAME.HANDLE_ERC20_CONTRACT,