Use event.params.ts

This commit is contained in:
trizin 2023-05-04 13:59:21 +03:00 committed by GitHub
parent de7b439cc4
commit 59e6935b4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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