Skip to content

Commit 6ce6279

Browse files
committed
feat: added isLegacy to Dispute and minor comment on schema
1 parent d4a32d1 commit 6ce6279

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

schema.graphql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ type GraphNetwork @entity(immutable: false) {
223223
fishermanRewardPercentage: Int!
224224
"[HORIZON]Reward to Fisherman on successful disputes. In parts per million"
225225
fishermanRewardCut: Int!
226-
"Maximum Penalty to Indexer on successful disputes for indexing disputes. In parts per million"
226+
"Maximum Penalty to Indexer on successful disputes for indexing disputes. Percentage of the indexer's stake snapshot (own stake plus delegated). In parts per million"
227227
maxSlashingCut: Int!
228228

229229
# Bridge totals (Only available on L1 networks)
@@ -1448,6 +1448,8 @@ type Dispute @entity(immutable: false) {
14481448
fisherman: GraphAccount!
14491449
"Fisherman deposit"
14501450
deposit: BigInt!
1451+
"Whether this dispute was created in the legacy protocol"
1452+
isLegacy: Boolean!
14511453

14521454
"Time dispute was created"
14531455
createdAt: Int!

src/mappings/disputeManager.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export function handleQueryDisputeCreated(event: QueryDisputeCreated): void {
2020
dispute.subgraphDeployment = event.params.subgraphDeploymentID.toHexString()
2121
dispute.fisherman = event.params.fisherman.toHexString()
2222
dispute.deposit = event.params.tokens
23+
dispute.isLegacy = true
2324
dispute.createdAt = event.block.timestamp.toI32()
2425
dispute.status = 'Undecided'
2526
dispute.tokensSlashed = BigDecimal.fromString('0')
@@ -57,6 +58,7 @@ export function handleIndexingDisputeCreated(event: IndexingDisputeCreated): voi
5758
dispute.subgraphDeployment = allocation.subgraphDeployment
5859
dispute.fisherman = event.params.fisherman.toHexString()
5960
dispute.deposit = event.params.tokens
61+
dispute.isLegacy = true
6062
dispute.createdAt = event.block.timestamp.toI32()
6163
dispute.status = 'Undecided'
6264
dispute.tokensSlashed = BigDecimal.fromString('0')

src/mappings/horizonDisputeManager.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export function handleQueryDisputeCreated(event: QueryDisputeCreated): void {
3939
dispute.subgraphDeployment = event.params.subgraphDeploymentId.toHexString()
4040
dispute.fisherman = event.params.fisherman.toHexString()
4141
dispute.deposit = event.params.tokens
42+
dispute.isLegacy = false
4243
dispute.createdAt = event.block.timestamp.toI32()
4344
dispute.status = STATUS_UNDECIDED
4445
dispute.tokensSlashed = BIGDECIMAL_ZERO
@@ -76,6 +77,7 @@ export function handleIndexingDisputeCreated(event: IndexingDisputeCreated): voi
7677
dispute.subgraphDeployment = allocation.subgraphDeployment
7778
dispute.fisherman = event.params.fisherman.toHexString()
7879
dispute.deposit = event.params.tokens
80+
dispute.isLegacy = false
7981
dispute.createdAt = event.block.timestamp.toI32()
8082
dispute.status = STATUS_UNDECIDED
8183
dispute.tokensSlashed = BigDecimal.fromString('0')

0 commit comments

Comments
 (0)