Setting zero value for new VeDelegation amountFraction

This commit is contained in:
Jamie Hewitt 2023-03-29 13:05:26 -04:00
parent ecda94eb8c
commit 3c82e02bcf
2 changed files with 7 additions and 6 deletions

View File

@ -129,6 +129,7 @@ export function getveDelegation(id: string): VeDelegation {
veDelegation.cancelTime = BigInt.zero()
veDelegation.expireTime = BigInt.zero()
veDelegation.tokenId = BigInt.zero()
veDelegation.amountFraction = BigDecimal.zero()
veDelegation.amount = BigInt.zero()
veDelegation.receiver = ''
veDelegation.delegator = ''

View File

@ -42,12 +42,12 @@ export function handleExtendBoost(event: ExtendBoost): void {
const _expireTime = event.params._expire_time
const veDelegation = getveDelegation(_tokenId.toHex())
// const delegatorVeOcean = getveOCEAN(_delegator)
// if (_amount && delegatorVeOcean.lockedAmount) {
// veDelegation.amountFraction = _amount.divDecimal(
// delegatorVeOcean.lockedAmount
// )
// }
const delegatorVeOcean = getveOCEAN(_delegator)
if (_amount && delegatorVeOcean.lockedAmount) {
veDelegation.amountFraction = _amount.divDecimal(
delegatorVeOcean.lockedAmount
)
}
veDelegation.delegator = _delegator
veDelegation.receiver = _receiver
veDelegation.tokenId = _tokenId