Skip to content

Commit 47d4fbe

Browse files
committed
fix: changed cancellableAt to BigInt
1 parent 6fb1383 commit 47d4fbe

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

schema.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1458,7 +1458,7 @@ type Dispute @entity(immutable: false) {
14581458
"Time dispute was closed at"
14591459
closedAt: Int!
14601460
"Time dispute becomes cancellable by the fisherman"
1461-
cancellableAt: Int!
1461+
cancellableAt: BigInt!
14621462
"Status of the dispute. Accepted means the Indexer was slashed"
14631463
status: DisputeStatus!
14641464
"Total amount of tokens slashed on the dispute"

src/mappings/disputeManager.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import {
1313
import { DisputeManagerStitched } from '../types/DisputeManager/DisputeManagerStitched'
1414
import { createOrLoadGraphNetwork } from './helpers/helpers'
1515

16+
const BIGINT_ZERO = BigInt.fromI32(0)
17+
1618
// This handles Single query and Conflicting disputes
1719
export function handleQueryDisputeCreated(event: QueryDisputeCreated): void {
1820
let id = event.params.disputeID.toHexString()
@@ -22,7 +24,7 @@ export function handleQueryDisputeCreated(event: QueryDisputeCreated): void {
2224
dispute.deposit = event.params.tokens
2325
dispute.isLegacy = true
2426
dispute.createdAt = event.block.timestamp.toI32()
25-
dispute.cancellableAt = 0 // Legacy disputes are not cancellable
27+
dispute.cancellableAt = BIGINT_ZERO // Legacy disputes are not cancellable
2628
dispute.status = 'Undecided'
2729
dispute.tokensSlashed = BigDecimal.fromString('0')
2830
dispute.tokensBurned = BigDecimal.fromString('0')
@@ -36,9 +38,9 @@ export function handleQueryDisputeCreated(event: QueryDisputeCreated): void {
3638
let request = '0x'.concat(attestationData.slice(2, 66))
3739
let response = '0x'.concat(attestationData.slice(66, 130))
3840
let attestation = new Attestation(request.concat('-').concat(response))
39-
let v = attestationData.slice(194, 196)
40-
let r = attestationData.slice(196, 260)
41-
let s = attestationData.slice(260, 324)
41+
let r = attestationData.slice(194, 258)
42+
let s = attestationData.slice(258, 322)
43+
let v = attestationData.slice(322, 324)
4244
attestation.responseCID = response
4345
attestation.requestCID = request
4446
attestation.subgraphDeployment = dispute.subgraphDeployment
@@ -61,7 +63,7 @@ export function handleIndexingDisputeCreated(event: IndexingDisputeCreated): voi
6163
dispute.deposit = event.params.tokens
6264
dispute.isLegacy = true
6365
dispute.createdAt = event.block.timestamp.toI32()
64-
dispute.cancellableAt = 0 // Legacy disputes are not cancellable
66+
dispute.cancellableAt = BIGINT_ZERO // Legacy disputes are not cancellable
6567
dispute.status = 'Undecided'
6668
dispute.tokensSlashed = BigDecimal.fromString('0')
6769
dispute.tokensBurned = BigDecimal.fromString('0')

src/mappings/horizonDisputeManager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function handleQueryDisputeCreated(event: QueryDisputeCreated): void {
4444
dispute.deposit = event.params.tokens
4545
dispute.isLegacy = false
4646
dispute.createdAt = event.block.timestamp.toI32()
47-
dispute.cancellableAt = event.params.cancellableAt.toI32()
47+
dispute.cancellableAt = event.params.cancellableAt
4848
dispute.status = STATUS_UNDECIDED
4949
dispute.tokensSlashed = BIGDECIMAL_ZERO
5050
dispute.tokensRewarded = BIGINT_ZERO
@@ -83,7 +83,7 @@ export function handleIndexingDisputeCreated(event: IndexingDisputeCreated): voi
8383
dispute.deposit = event.params.tokens
8484
dispute.isLegacy = false
8585
dispute.createdAt = event.block.timestamp.toI32()
86-
dispute.cancellableAt = event.params.cancellableAt.toI32()
86+
dispute.cancellableAt = event.params.cancellableAt
8787
dispute.status = STATUS_UNDECIDED
8888
dispute.tokensSlashed = BigDecimal.fromString('0')
8989
dispute.tokensBurned = BigDecimal.fromString('0')
@@ -104,7 +104,7 @@ export function handleLegacyDisputeCreated(event: LegacyDisputeCreated): void {
104104
dispute.deposit = BigInt.fromString('0')
105105
dispute.isLegacy = true
106106
dispute.createdAt = event.block.timestamp.toI32()
107-
dispute.cancellableAt = 0 // Legacy disputes are not cancellable
107+
dispute.cancellableAt = BIGINT_ZERO // Legacy disputes are not cancellable
108108
dispute.status = STATUS_UNDECIDED
109109
dispute.tokensSlashed = BigDecimal.fromString('0')
110110
dispute.tokensBurned = BigDecimal.fromString('0')

0 commit comments

Comments
 (0)