Replace lockedAmountinVe with timeLeft

This commit is contained in:
trizin 2023-05-04 13:58:01 +03:00 committed by GitHub
parent 392e1f28d9
commit de7b439cc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -469,7 +469,7 @@ type VeDelegation @entity {
tokenId: BigInt!
amount: BigDecimal!
lockedAmount: BigDecimal!
lockedAmountinVe: BigDecimal!
timeLeft: BigDecimal!
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.lockedAmountinVe = BigDecimal.zero()
veDelegation.timeLeft = BigDecimal.zero()
veDelegation.save()
}
return veDelegation

View File

@ -31,7 +31,7 @@ export function handleDelegation(event: DelegateBoost): void {
BigInt.fromI32(18).toI32()
)
veDelegation.lockedAmount = delegator.lockedAmount
veDelegation.lockedAmountinVe = delegator.lockedAmount.mul(timeLeft).divDecimal(MAX_TIME)
veDelegation.timeLeft = Datetime.now() - delegator.unlockTime
veDelegation.cancelTime = _cancelTime
veDelegation.expireTime = _expireTime
veDelegation.save()