Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: abstract-zero #31

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gtcr-subgraph",
"version": "1.1.4",
"version": "1.1.6",
"description": "Subgraph for Generalized TCR contracts",
"scripts": {
"clean": "graph clean",
16 changes: 8 additions & 8 deletions src/LightGTCRFactoryMapping.ts
Original file line number Diff line number Diff line change
@@ -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();
}
2 changes: 1 addition & 1 deletion src/fileHandlers/EvidenceMetadataHandler.ts
Original file line number Diff line number Diff line change
@@ -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;
}
1 change: 1 addition & 0 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -75,3 +75,4 @@ export function JSONValueToBool(
return _default;
}
}
export const ZERO = BigInt.fromI32(0);