Skip to content

Commit 49be36e

Browse files
committed
feat(subgraph): add-fields-for-transaction-hash-and-timestamp
1 parent c106865 commit 49be36e

File tree

6 files changed

+21
-11
lines changed

6 files changed

+21
-11
lines changed

subgraph/core-neo/subgraph.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ dataSources:
88
name: KlerosCore
99
network: arbitrum-one
1010
source:
11-
address: "0xCd415C03dfa85B02646C7e2977F22a480c4354F1"
11+
address: "0x991d2df165670b9cac3B022f4B68D65b664222ea"
1212
abi: KlerosCore
13-
startBlock: 190274596
13+
startBlock: 272063254
1414
mapping:
1515
kind: ethereum/events
1616
apiVersion: 0.0.7
@@ -64,9 +64,9 @@ dataSources:
6464
name: PolicyRegistry
6565
network: arbitrum-one
6666
source:
67-
address: "0x26c1980120F1C82cF611D666CE81D2b54d018547"
67+
address: "0x553dcbF6aB3aE06a1064b5200Df1B5A9fB403d3c"
6868
abi: PolicyRegistry
69-
startBlock: 190274403
69+
startBlock: 272063037
7070
mapping:
7171
kind: ethereum/events
7272
apiVersion: 0.0.7
@@ -84,9 +84,9 @@ dataSources:
8484
name: DisputeKitClassic
8585
network: arbitrum-one
8686
source:
87-
address: "0xb7c292cD9Fd3d20De84a71AE1caF054eEB6374A9"
87+
address: "0x70B464be85A547144C72485eBa2577E5D3A45421"
8888
abi: DisputeKitClassic
89-
startBlock: 190274518
89+
startBlock: 272063168
9090
mapping:
9191
kind: ethereum/events
9292
apiVersion: 0.0.7
@@ -119,9 +119,9 @@ dataSources:
119119
name: EvidenceModule
120120
network: arbitrum-one
121121
source:
122-
address: "0xe62B776498F48061ef9425fCEf30F3d1370DB005"
122+
address: "0x48e052B4A6dC4F30e90930F1CeaAFd83b3981EB3"
123123
abi: EvidenceModule
124-
startBlock: 190274441
124+
startBlock: 272063086
125125
mapping:
126126
kind: ethereum/events
127127
apiVersion: 0.0.7
@@ -140,9 +140,9 @@ dataSources:
140140
name: SortitionModule
141141
network: arbitrum-one
142142
source:
143-
address: "0x614498118850184c62f82d08261109334bFB050f"
143+
address: "0x21A9402aDb818744B296e1d1BE58C804118DC03D"
144144
abi: SortitionModule
145-
startBlock: 190274557
145+
startBlock: 272063201
146146
mapping:
147147
kind: ethereum/events
148148
apiVersion: 0.0.7

subgraph/core/schema.graphql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ type Dispute @entity {
160160
disputeID: BigInt!
161161
court: Court!
162162
createdAt: BigInt
163+
transactionHash: String!
163164
arbitrated: Arbitrable!
164165
period: Period!
165166
ruled: Boolean!
@@ -180,6 +181,8 @@ type Dispute @entity {
180181
arbitrableChainId:BigInt
181182
externalDisputeId:BigInt
182183
templateId:BigInt
184+
rulingTimestamp:BigInt
185+
rulingTransactionHash:String
183186
}
184187

185188
type PeriodIndexCounter @entity {
@@ -303,6 +306,8 @@ type ClassicJustification @entity {
303306
choice: BigInt!
304307
votes: [ClassicVote!]! @derivedFrom(field: "justification")
305308
reference: String!
309+
transactionHash: String!
310+
timestamp: BigInt!
306311
}
307312

308313
type ClassicEvidenceGroup implements EvidenceGroup @entity {

subgraph/core/src/DisputeKitClassic.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ export function handleVoteCast(event: VoteCast): void {
6666
justification.localRound = currentLocalRoundID;
6767
justification.choice = choice;
6868
justification.reference = event.params._justification;
69+
justification.transactionHash = event.transaction.hash.toHexString();
70+
justification.timestamp = event.block.timestamp;
6971
justification.save();
7072
const currentRulingInfo = updateCountsAndGetCurrentRuling(
7173
currentLocalRoundID,

subgraph/core/src/KlerosCore.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ export function handleRuling(event: Ruling): void {
184184
const dispute = Dispute.load(disputeID.toString());
185185
if (!dispute) return;
186186
dispute.ruled = true;
187+
dispute.rulingTransactionHash = event.transaction.hash.toHexString();
188+
dispute.rulingTimestamp = event.block.timestamp;
187189
dispute.save();
188190
const court = Court.load(dispute.court);
189191
if (!court) return;

subgraph/core/src/entities/Dispute.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export function createDisputeFromEvent(event: DisputeCreation): void {
2121
dispute.lastPeriodChange = event.block.timestamp;
2222
dispute.lastPeriodChangeBlockNumber = event.block.number;
2323
dispute.periodNotificationIndex = getAndIncrementPeriodCounter(dispute.period);
24+
dispute.transactionHash = event.transaction.hash.toHexString();
2425
const court = Court.load(courtID);
2526
if (!court) return;
2627
dispute.periodDeadline = event.block.timestamp.plus(court.timesPerPeriod[0]);

subgraph/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kleros/kleros-v2-subgraph",
3-
"version": "0.9.1",
3+
"version": "0.10.1",
44
"license": "MIT",
55
"scripts": {
66
"update:core:arbitrum-sepolia-devnet": "./scripts/update.sh arbitrumSepoliaDevnet arbitrum-sepolia core/subgraph.yaml",

0 commit comments

Comments
 (0)