Skip to content

Commit

Permalink
chore: use contract method to get vesting total
Browse files Browse the repository at this point in the history
  • Loading branch information
1emu committed Jul 23, 2024
1 parent 3ea196d commit 1bdd110
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/clients/VestingData.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ChainId } from '@dcl/schemas'
import { JsonRpcProvider } from '@ethersproject/providers'
import { BigNumber, ethers } from 'ethers'
import { ethers } from 'ethers'

import { VestingStatus } from '../entities/Grant/types'
import { ErrorService } from '../services/ErrorService'
Expand Down Expand Up @@ -155,9 +155,7 @@ async function getVestingContractDataV2(

const released = parseContractValue(await vestingContract.getReleased())
const releasable = parseContractValue(await vestingContract.getReleasable())
const vestedPerPeriod: BigNumber[] = await vestingContract.getVestedPerPeriod()

const total = vestedPerPeriod.map(parseContractValue).reduce((acc, curr) => acc + curr, 0)
const total = parseContractValue(await vestingContract.getTotal())

let status = getInitialVestingStatus(start_at, finish_at)
const isRevoked = await vestingContract.getIsRevoked()
Expand Down
1 change: 0 additions & 1 deletion src/routes/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ async function getProject(req: Request<{ project: string }>) {
try {
return await ProjectService.getUpdatedProject(id)
} catch (e) {
console.log(`Error getting project: ${e}`) //TODO: remove before merging projects to main
throw new RequestError(`Project "${id}" not found`, RequestError.NotFound)
}
}
Expand Down

0 comments on commit 1bdd110

Please sign in to comment.