Add lockedAmount to veDelegation
This commit is contained in:
parent
e30047c430
commit
9b41d025e8
|
@ -468,6 +468,7 @@ type VeDelegation @entity {
|
|||
receiver: VeOCEAN!
|
||||
tokenId: BigInt!
|
||||
amount: BigDecimal!
|
||||
lockedAmount BigDecimal!
|
||||
cancelTime: BigInt!
|
||||
expireTime: BigInt!
|
||||
updates: [VeDelegationUpdate!] @derivedFrom(field: "veDelegation")
|
||||
|
@ -609,4 +610,3 @@ type NftTransferHistory @entity {
|
|||
timestamp: Int!
|
||||
block: Int!
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ export function handleDelegation(event: DelegateBoost): void {
|
|||
const _expireTime = event.params._expire_time
|
||||
// create veOcean if does not exists
|
||||
getveOCEAN(_receiver)
|
||||
getveOCEAN(_delegator)
|
||||
const delegator = getveOCEAN(_delegator)
|
||||
|
||||
const veDelegation = getveDelegation(event.address, _tokenId.toHex())
|
||||
veDelegation.delegator = _delegator
|
||||
|
@ -28,9 +28,11 @@ export function handleDelegation(event: DelegateBoost): void {
|
|||
_amount.toBigDecimal(),
|
||||
BigInt.fromI32(18).toI32()
|
||||
)
|
||||
veDelegation.lockedAmount = delegator.lockedAmount
|
||||
veDelegation.cancelTime = _cancelTime
|
||||
veDelegation.expireTime = _expireTime
|
||||
veDelegation.save()
|
||||
veDelegation.
|
||||
veDelegation.save()
|
||||
|
||||
const veDelegationUpdate = new VeDelegationUpdate(
|
||||
event.transaction.hash.toHex() + '-' + event.logIndex.toString()
|
||||
|
|
Loading…
Reference in New Issue