mirror of
https://github.com/oceanprotocol/ocean-subgraph.git
synced 2024-12-02 05:57:29 +01:00
Fixes
This commit is contained in:
parent
59e6935b4d
commit
a21b03c495
@ -469,7 +469,7 @@ type VeDelegation @entity {
|
|||||||
tokenId: BigInt!
|
tokenId: BigInt!
|
||||||
amount: BigDecimal!
|
amount: BigDecimal!
|
||||||
lockedAmount: BigDecimal!
|
lockedAmount: BigDecimal!
|
||||||
timeLeft: BigDecimal!
|
timeLeft: Int!
|
||||||
cancelTime: BigInt!
|
cancelTime: BigInt!
|
||||||
expireTime: BigInt!
|
expireTime: BigInt!
|
||||||
updates: [VeDelegationUpdate!] @derivedFrom(field: "veDelegation")
|
updates: [VeDelegationUpdate!] @derivedFrom(field: "veDelegation")
|
||||||
|
@ -137,7 +137,7 @@ export function getveDelegation(
|
|||||||
veDelegation.receiver = ''
|
veDelegation.receiver = ''
|
||||||
veDelegation.delegator = ''
|
veDelegation.delegator = ''
|
||||||
veDelegation.lockedAmount = BigDecimal.zero()
|
veDelegation.lockedAmount = BigDecimal.zero()
|
||||||
veDelegation.timeLeft = BigDecimal.zero()
|
veDelegation.timeLeft = BigInt.zero()
|
||||||
veDelegation.save()
|
veDelegation.save()
|
||||||
}
|
}
|
||||||
return veDelegation
|
return veDelegation
|
||||||
|
@ -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 ts = event.block.timestamp.toI32()
|
||||||
|
|
||||||
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 = ts - delegator.unlockTime
|
veDelegation.timeLeft = delegator.unlockTime - ts
|
||||||
veDelegation.cancelTime = _cancelTime
|
veDelegation.cancelTime = _cancelTime
|
||||||
veDelegation.expireTime = _expireTime
|
veDelegation.expireTime = _expireTime
|
||||||
veDelegation.save()
|
veDelegation.save()
|
||||||
|
Loading…
Reference in New Issue
Block a user