add chainId and nftAddress (#552)

* add chainId and nftAddress

* handle null
pull/553/head
mihaisc 2 months ago committed by GitHub
parent 7be20246c0
commit 95fcfe9ba7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      schema.graphql
  2. 5
      src/mappings/utils/veUtils.ts

@ -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…
Cancel
Save