This commit is contained in:
trizin 2023-05-04 14:01:57 +03:00 committed by GitHub
parent 59e6935b4d
commit a21b03c495
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -469,7 +469,7 @@ type VeDelegation @entity {
tokenId: BigInt!
amount: BigDecimal!
lockedAmount: BigDecimal!
timeLeft: BigDecimal!
timeLeft: Int!
cancelTime: BigInt!
expireTime: BigInt!
updates: [VeDelegationUpdate!] @derivedFrom(field: "veDelegation")

View File

@ -137,7 +137,7 @@ export function getveDelegation(
veDelegation.receiver = ''
veDelegation.delegator = ''
veDelegation.lockedAmount = BigDecimal.zero()
veDelegation.timeLeft = BigDecimal.zero()
veDelegation.timeLeft = BigInt.zero()
veDelegation.save()
}
return veDelegation

View File

@ -20,7 +20,7 @@ export function handleDelegation(event: DelegateBoost): void {
getveOCEAN(_receiver)
const delegator = getveOCEAN(_delegator)
const veDelegation = getveDelegation(event.address, _tokenId.toHex())
const ts = event.params.ts
const ts = event.block.timestamp.toI32()
const MAX_TIME = 4 * 365 * 86400 // max lock time
veDelegation.delegator = _delegator
@ -31,7 +31,7 @@ export function handleDelegation(event: DelegateBoost): void {
BigInt.fromI32(18).toI32()
)
veDelegation.lockedAmount = delegator.lockedAmount
veDelegation.timeLeft = ts - delegator.unlockTime
veDelegation.timeLeft = delegator.unlockTime - ts
veDelegation.cancelTime = _cancelTime
veDelegation.expireTime = _expireTime
veDelegation.save()