Skip to content

Commit 4a007e3

Browse files
committed
feat: supporting the simplified DK structure
1 parent 838e7bf commit 4a007e3

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

subgraph/schema.graphql

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,7 @@ type Draw @entity(immutable: true) {
198198
type DisputeKit @entity {
199199
id: ID!
200200
address: Bytes
201-
parent: DisputeKit
202-
children: [DisputeKit!]! @derivedFrom(field: "parent")
203201
needsFreezing: Boolean!
204-
depthLevel: BigInt!
205202
rounds: [Round!]! @derivedFrom(field: "disputeKit")
206203
courts: [Court!]! @derivedFrom(field: "supportedDisputeKits")
207204
}

subgraph/src/entities/DisputeKit.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,14 @@ import { ZERO, ONE } from "../utils";
44

55
export function createDisputeKitFromEvent(event: DisputeKitCreated): void {
66
const disputeKit = new DisputeKit(event.params._disputeKitID.toString());
7-
disputeKit.parent = event.params._parent.toString();
87
disputeKit.address = event.params._disputeKitAddress;
98
disputeKit.needsFreezing = false;
10-
const parent = DisputeKit.load(event.params._parent.toString());
11-
disputeKit.depthLevel = parent ? parent.depthLevel.plus(ONE) : ZERO;
129
disputeKit.save();
1310
}
1411

15-
export function filterSupportedDisputeKits(
16-
supportedDisputeKits: string[],
17-
disputeKitID: string
18-
): string[] {
12+
export function filterSupportedDisputeKits(supportedDisputeKits: string[], disputeKitID: string): string[] {
1913
let result: string[] = [];
2014
for (let i = 0; i < supportedDisputeKits.length; i++)
21-
if (supportedDisputeKits[i] !== disputeKitID)
22-
result = result.concat([supportedDisputeKits[i]]);
15+
if (supportedDisputeKits[i] !== disputeKitID) result = result.concat([supportedDisputeKits[i]]);
2316
return result;
2417
}

subgraph/subgraph.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ dataSources:
4242
handler: handleCourtCreated
4343
- event: CourtModified(indexed uint96,bool,uint256,uint256,uint256,uint256,uint256[4])
4444
handler: handleCourtModified
45-
- event: DisputeKitCreated(indexed uint256,indexed address,indexed uint256)
45+
- event: DisputeKitCreated(indexed uint256,indexed address)
4646
handler: handleDisputeKitCreated
4747
- event: DisputeKitEnabled(indexed uint96,indexed uint256,indexed bool)
4848
handler: handleDisputeKitEnabled

0 commit comments

Comments
 (0)