add chainId and nftAddress (#552)
* add chainId and nftAddress * handle null
This commit is contained in:
parent
7be20246c0
commit
95fcfe9ba7
|
@ -404,7 +404,9 @@ type VeAllocateUser @entity{
|
|||
type VeAllocateId @entity{
|
||||
"id = {DataNFT Address}-{chain id}"
|
||||
id: ID!
|
||||
|
||||
nftAddress: String!
|
||||
chainId: BigInt!
|
||||
|
||||
veAllocation: [VeAllocation!] @derivedFrom(field: "allocationId")
|
||||
allocatedTotal: BigDecimal!
|
||||
|
||||
|
|
|
@ -62,6 +62,8 @@ export function getveAllocateId(
|
|||
allocateId.tx = event.transaction.hash.toHex()
|
||||
allocateId.block = event.block.number.toI32()
|
||||
allocateId.lastContact = 0
|
||||
allocateId.chainId = BigInt.zero()
|
||||
allocateId.nftAddress = ''
|
||||
|
||||
allocateId.save()
|
||||
}
|
||||
|
@ -196,6 +198,9 @@ export function handleOneAllocation(
|
|||
allocationAmount
|
||||
)
|
||||
|
||||
allocateId.chainId = chainId
|
||||
allocateId.nftAddress = nftAddress
|
||||
|
||||
// save entities
|
||||
allocateUser.save()
|
||||
allocateId.save()
|
||||
|
|
Loading…
Reference in New Issue