Skip to content

Commit

Permalink
fix: update query update balance
Browse files Browse the repository at this point in the history
  • Loading branch information
fibonacci998 committed Oct 11, 2024
1 parent 4d79ec6 commit 4465839
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/services/evm/crawl_evm_account.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,9 @@ export default class CrawlEvmAccountService extends BullableService {
if (accountsInstances.length === 0) {
return;
}
const accountBalanceInstance = await AccountBalance.query().findOne(
'account_id',
_payload.id
);
const accountBalanceInstance = await AccountBalance.query()
.findOne('account_id', _payload.id)
.andWhere('type', AccountBalance.TYPE.NATIVE);
if (!accountBalanceInstance) {
throw Error(`Missing account_balance_id: ${_payload.id}`);
}
Expand All @@ -366,8 +365,6 @@ export default class CrawlEvmAccountService extends BullableService {
})
.where({
id: accountBalanceInstance?.id,
denom: config.networkDenom,
type: AccountBalance.TYPE.NATIVE,
})
.transacting(trx);
});
Expand Down

0 comments on commit 4465839

Please sign in to comment.