Skip to content

Commit

Permalink
removed EAS references from indexer
Browse files Browse the repository at this point in the history
  • Loading branch information
Oba-One committed Aug 26, 2024
1 parent 81ed4e2 commit c94c0c5
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 1,274 deletions.
7 changes: 0 additions & 7 deletions packages/indexer/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ contracts:
- event: GardenerRemoved
- event: GardenOperatorAdded
- event: GardenOperatorRemoved
- name: EAS
abi_file_path: src/abis/EAS.json
handler: src/EventHandlers.ts
events:
- event: Attested
networks:
- id: 42161 # Arbitrum
start_block: 242630858
Expand All @@ -35,5 +30,3 @@ networks:
address: 0x70Df51173B3EF27A245e1a0F129e2BAab39A937E
- name: GardenToken
address: 0x5D29C573581270d2bF436382820B3b64904AEeD7
- name: EAS
address: 0xbD75f629A22Dc1ceD33dDA0b68c546A1c035c458
49 changes: 0 additions & 49 deletions packages/indexer/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,6 @@ enum Capital {
UNKNOWN
}

type GardenAssessment {
id: ID! # Bytes32
authorAddress: String! # Address
soilMoisturePercentage: Int!
carbonTonStock: Int!
carbonTonPotential: Int!
gardenSquareMeters: Int!
biome: String!
remoteReportCID: String!
speciesRegistryCID: String!
polygonCoordinates: [Int!]!
treeGenusesObserved: [String!]!
weedGenusesObserved: [String!]!
issues: [String!]!
tags: [String!]!
createdAt: BigInt!

garden: Garden!
}

type Action {
id: ID! # Bytes32
ownerAddress: String! # Address
Expand All @@ -42,40 +22,11 @@ type Action {
createdAt: BigInt!
}

type Work {
id: ID! # Bytes32
ownerAddress: String! # Address
title: String!
feedback: String!
metadata: String!
media: [String!]!
createdAt: BigInt!

workApprovals: [WorkApproval!]! @derivedFrom(field: "work")

action: Action!
garden: Garden!
}

type WorkApproval {
id: ID! # Bytes32
approverAddress: String! # Address
approved: Boolean!
feedback: String!
createdAt: BigInt!

action: Action!
work: Work!
}

type Garden {
id: ID! # Address
tokenAddress: String! # Address
tokenID: Int!
name: String!
description: String!
createdAt: BigInt!

assessments: [GardenAssessment!]! @derivedFrom(field: "garden")
works: [Work!]! @derivedFrom(field: "garden")
}
33 changes: 0 additions & 33 deletions packages/indexer/src/EventHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,9 @@ import {
ActionRegistry,
GardenToken,
GardenAccount,
EAS,
Action,
// Garden,
} from "generated";
import { Capital_t } from "generated/src/db/Enums.gen";

import {
getWorkAttestation,
getWorkApprovalAttestation,
getGardenAssessmentAttestation,
} from "./eas";
import {
WORK_SCHEMA_UID,
WORK_APPROVAL_SCHEMA_UID,
GARDEN_ASSESSMENT_SCHEMA_UID,
} from "./constants";

// Handler for the ActionRegistered event
ActionRegistry.ActionRegistered.handler(async ({ event, context }) => {
Expand Down Expand Up @@ -90,23 +77,3 @@ GardenAccount.GardenOperatorAdded.handler(async ({ event, context }) => {});

// Handler for the GardenAccount GardenOperatorRemoved event
GardenAccount.GardenOperatorRemoved.handler(async ({ event, context }) => {});

// Handler for EAS.Attested event
EAS.Attested.handler(async ({ event, context }) => {
const uid = event.params.uid;
const schemaUID = event.params.schemaUID;

if (schemaUID === WORK_SCHEMA_UID) {
const work = await getWorkAttestation(uid);

context.Work.set(work);
} else if (schemaUID === WORK_APPROVAL_SCHEMA_UID) {
const workApproval = await getWorkApprovalAttestation(uid);

context.WorkApproval.set(workApproval);
} else if (schemaUID === GARDEN_ASSESSMENT_SCHEMA_UID) {
const gardenAssessment = await getGardenAssessmentAttestation(uid);

context.GardenAssessment.set(gardenAssessment);
}
});
Loading

0 comments on commit c94c0c5

Please sign in to comment.