Skip to content

Commit

Permalink
feat: add attestations field to portal entity
Browse files Browse the repository at this point in the history
  • Loading branch information
0xEillo committed Sep 27, 2023
1 parent 5a06646 commit ce2a429
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 29 deletions.
57 changes: 29 additions & 28 deletions subgraph/schema.graphql
Original file line number Diff line number Diff line change
@@ -1,39 +1,40 @@
type Attestation @entity {
id: ID!
schemaId: Bytes!
replacedBy: Bytes!
attester: Bytes!
portal: Bytes!
attestedDate: BigInt!
expirationDate: BigInt!
revocationDate: BigInt!
version: BigInt!
revoked: Boolean!
subject: Bytes!
attestationData: Bytes!
id: ID!
schemaId: Bytes!
replacedBy: Bytes!
attester: Bytes!
portal: Portal!
attestedDate: BigInt!
expirationDate: BigInt!
revocationDate: BigInt!
version: BigInt!
revoked: Boolean!
subject: Bytes!
attestationData: Bytes!
}

type Module @entity {
id: ID!
moduleAddress: Bytes!
name: String!
description: String!
id: ID!
moduleAddress: Bytes!
name: String!
description: String!
}

type Portal @entity {
id: ID!
ownerAddress: Bytes!
modules: [Bytes!]
isRevocable: Boolean!
name: String!
description: String!
ownerName: String!
id: ID!
ownerAddress: Bytes!
modules: [Bytes!]
isRevocable: Boolean!
name: String!
description: String!
ownerName: String!
attestations: [Attestation!]! @derivedFrom(field: "portal")
}

type Schema @entity {
id: ID!
name: String!
description: String!
context: String!
schema: String!
id: ID!
name: String!
description: String!
context: String!
schema: String!
}
2 changes: 1 addition & 1 deletion subgraph/src/attestation-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function handleAttestationRegistered(event: AttestationRegisteredEvent):
attestation.schemaId = attestationData.schemaId;
attestation.replacedBy = attestationData.replacedBy;
attestation.attester = attestationData.attester;
attestation.portal = attestationData.portal;
attestation.portal = attestationData.portal.toHexString();
attestation.attestedDate = attestationData.attestedDate;
attestation.expirationDate = attestationData.expirationDate;
attestation.revocationDate = attestationData.revocationDate;
Expand Down

0 comments on commit ce2a429

Please sign in to comment.