diff --git a/subgraph/schema.graphql b/subgraph/schema.graphql index 2cad533d4..c9abe1630 100644 --- a/subgraph/schema.graphql +++ b/subgraph/schema.graphql @@ -24,6 +24,7 @@ interface DisputeKitDispute { interface DisputeKitRound { id: ID! localDispute: DisputeKitDispute! + votes: [Vote!]! @derivedFrom(field: "localRound") } interface Vote { @@ -185,8 +186,8 @@ type ClassicDispute implements DisputeKitDispute @entity { type ClassicRound implements DisputeKitRound @entity { id: ID! # disputeKit.id-coreDispute-dispute.rounds.length localDispute: DisputeKitDispute! + votes: [Vote!]! @derivedFrom(field: "localRound") - votes: [ClassicVote!]! winningChoice: BigInt! counts: [BigInt!]! tied: Boolean! diff --git a/subgraph/src/entities/ClassicRound.ts b/subgraph/src/entities/ClassicRound.ts index afed8be9e..6024c35b0 100644 --- a/subgraph/src/entities/ClassicRound.ts +++ b/subgraph/src/entities/ClassicRound.ts @@ -13,7 +13,6 @@ export function createClassicRound( const id = `${localDisputeID}-${roundIndex.toString()}`; const classicRound = new ClassicRound(id); classicRound.localDispute = localDisputeID; - classicRound.votes = []; classicRound.winningChoice = ZERO; classicRound.counts = new Array(choicesLength.toI32()).fill(ZERO); classicRound.tied = true; @@ -42,6 +41,7 @@ export function updateCounts(id: string, choice: BigInt): void { round.tied = false; } } + round.totalVoted = round.totalVoted.plus(ONE); round.save(); }