Skip to content

Commit

Permalink
refactor: instantiate erc20 module account
Browse files Browse the repository at this point in the history
  • Loading branch information
phamphong9981 committed Jul 23, 2024
1 parent ec99b97 commit ad2b65f
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions src/services/evm/erc20.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,19 +351,18 @@ export default class Erc20Service extends BullableService {

public async _start(): Promise<void> {
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,
Expand Down

0 comments on commit ad2b65f

Please sign in to comment.