Skip to content

Commit

Permalink
chore: cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
filo87 committed Nov 13, 2024
1 parent 8c47318 commit 61ba413
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions src/mappings/handlers/evmHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@ import { InvestorTransactionData, InvestorTransactionService } from '../services
import { CurrencyService } from '../services/currencyService'
import { BlockchainService } from '../services/blockchainService'
import { CurrencyBalanceService } from '../services/currencyBalanceService'
import type { Provider } from '@ethersproject/providers'
import { TrancheBalanceService } from '../services/trancheBalanceService'
import { escrows } from '../../config'
import { InvestorPositionService } from '../services/investorPositionService'
import { getPeriodStart } from '../../helpers/timekeeperService'

const _ethApi = api as Provider
//const networkPromise = typeof ethApi.getNetwork === 'function' ? ethApi.getNetwork() : null

export const handleEvmDeployTranche = errorHandler(_handleEvmDeployTranche)
Expand Down Expand Up @@ -123,7 +120,7 @@ async function _handleEvmTransfer(event: TransferLog): Promise<void> {
await investLpCollect.save()

const trancheBalance = await TrancheBalanceService.getOrInit(
toAccount.id,
toAccount!.id,
orderData.poolId,
orderData.trancheId,
timestamp
Expand Down
4 changes: 2 additions & 2 deletions src/mappings/services/trancheBalanceService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export class TrancheBalanceService extends TrancheBalance {
return trancheBalance as TrancheBalanceService | undefined
}

static getOrInit = async (address: string, poolId: string, trancheId: string, timestamp: Date) => {
static async getOrInit(address: string, poolId: string, trancheId: string, timestamp: Date) {
let trancheBalance = await this.getById(address, poolId, trancheId)
if (trancheBalance === undefined) {
if (!trancheBalance) {
trancheBalance = this.init(address, poolId, trancheId, timestamp)
await trancheBalance.save()
}
Expand Down

0 comments on commit 61ba413

Please sign in to comment.