Setting zero value for new VeDelegation amountFraction
This commit is contained in:
parent
ecda94eb8c
commit
3c82e02bcf
|
@ -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 = ''
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue