diff --git a/package.json b/package.json index 2ea7d73..3f18f08 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gtcr-subgraph", - "version": "1.1.4", + "version": "1.1.7", "description": "Subgraph for Generalized TCR contracts", "scripts": { "clean": "graph clean", diff --git a/src/LightGTCRFactoryMapping.ts b/src/LightGTCRFactoryMapping.ts index 55fcadb..90f11cd 100644 --- a/src/LightGTCRFactoryMapping.ts +++ b/src/LightGTCRFactoryMapping.ts @@ -1,8 +1,8 @@ /* eslint-disable prefer-const */ -import { BigInt } from '@graphprotocol/graph-ts'; import { NewGTCR } from '../generated/LightGTCRFactory/LightGTCRFactory'; import { MetaEvidence, LRegistry } from '../generated/schema'; import { LightGeneralizedTCR as LightGeneralizedTCRDataSource } from '../generated/templates'; +import { ZERO } from './utils'; export function handleNewGTCR(event: NewGTCR): void { LightGeneralizedTCRDataSource.create(event.params._address); @@ -17,14 +17,14 @@ export function handleNewGTCR(event: NewGTCR): void { clearingMetaEvidence.URI = ''; clearingMetaEvidence.save(); - registry.metaEvidenceCount = BigInt.fromI32(0); + registry.metaEvidenceCount = ZERO; registry.registrationMetaEvidence = registrationMetaEvidence.id; registry.clearingMetaEvidence = clearingMetaEvidence.id; - registry.numberOfAbsent = BigInt.fromI32(0); - registry.numberOfRegistered = BigInt.fromI32(0); - registry.numberOfRegistrationRequested = BigInt.fromI32(0); - registry.numberOfClearingRequested = BigInt.fromI32(0); - registry.numberOfChallengedRegistrations = BigInt.fromI32(0); - registry.numberOfChallengedClearing = BigInt.fromI32(0); + registry.numberOfAbsent = ZERO; + registry.numberOfRegistered = ZERO; + registry.numberOfRegistrationRequested = ZERO; + registry.numberOfClearingRequested = ZERO; + registry.numberOfChallengedRegistrations = ZERO; + registry.numberOfChallengedClearing = ZERO; registry.save(); } diff --git a/src/LightGeneralizedTCRMapping.ts b/src/LightGeneralizedTCRMapping.ts index 96a7c9d..f2bd5dd 100644 --- a/src/LightGeneralizedTCRMapping.ts +++ b/src/LightGeneralizedTCRMapping.ts @@ -253,7 +253,10 @@ export function handleNewItem(event: NewItem): void { const ipfsHash = extractPath(event.params._data); item.metadata = `${ipfsHash}-${graphItemID}`; - log.debug('Creating datasource for ipfs hash : {}', [ipfsHash]); + log.debug('Creating datasource for ipfs hash : {}, graphItemID: {}', [ + ipfsHash, + graphItemID, + ]); const context = new DataSourceContext(); context.setString('graphItemID', graphItemID); diff --git a/src/fileHandlers/EvidenceMetadataHandler.ts b/src/fileHandlers/EvidenceMetadataHandler.ts index 883423c..4eea540 100644 --- a/src/fileHandlers/EvidenceMetadataHandler.ts +++ b/src/fileHandlers/EvidenceMetadataHandler.ts @@ -13,7 +13,7 @@ export function handleGTCREvidenceMetadata(content: Bytes): void { log.debug(`ipfs hash : {}, content : {}`, [id, content.toString()]); if (!parsedResult.isOk || parsedResult.isError) { - log.warning(`Error converting object for evidence {}`, [id]); + log.warning(`Error converting object for GTCR evidence {}`, [id]); evidence.save(); return; } diff --git a/src/utils/index.ts b/src/utils/index.ts index 49f788a..1703430 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -75,3 +75,4 @@ export function JSONValueToBool( return _default; } } +export const ZERO = BigInt.fromI32(0);