Skip to content

Commit

Permalink
fix: subgraph
Browse files Browse the repository at this point in the history
  • Loading branch information
jaybuidl committed Oct 10, 2023
1 parent 788a48b commit ae3d854
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion subgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"create-local": "graph create --node http://localhost:8020/ kleros/kleros-v2-core-local",
"remove-local": "graph remove --node http://localhost:8020/ kleros/kleros-v2-core-local",
"deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 kleros/kleros-v2-core-local --version-label v$(date +%s)",
"rebuild-deploy-local": "yarn update:local && yarn codegen && yarn create-local && yarn deploy-local",
"rebuild-deploy-local": "yarn update:local && yarn codegen && yarn build && yarn create-local && yarn deploy-local",
"start-local-indexer": "docker compose -f ../services/graph-node/docker-compose.yml up -d && docker compose -f ../services/graph-node/docker-compose.yml logs -f",
"stop-local-indexer": "docker compose -f ../services/graph-node/docker-compose.yml down && rm -rf ../services/graph-node/data"
},
Expand Down
18 changes: 9 additions & 9 deletions subgraph/src/entities/Round.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import { BigInt } from "@graphprotocol/graph-ts";
import { KlerosCore__getRoundInfoResult } from "../../generated/KlerosCore/KlerosCore";
import { KlerosCore__getRoundInfoResultValue0Struct } from "../../generated/KlerosCore/KlerosCore";
import { Round } from "../../generated/schema";

export function createRoundFromRoundInfo(
disputeID: BigInt,
roundIndex: BigInt,
roundInfo: KlerosCore__getRoundInfoResult
roundInfo: KlerosCore__getRoundInfoResultValue0Struct
): void {
const roundID = `${disputeID.toString()}-${roundIndex.toString()}`;
const round = new Round(roundID);
const feeToken = roundInfo.getFeeToken().toHexString();
const feeToken = roundInfo.feeToken.toHexString();
round.feeToken = feeToken === "0x0000000000000000000000000000000000000000" ? null : feeToken;
round.disputeKit = roundInfo.getDisputeKitID().toString();
round.tokensAtStakePerJuror = roundInfo.getPnkAtStakePerJuror();
round.totalFeesForJurors = roundInfo.getTotalFeesForJurors();
round.nbVotes = roundInfo.getNbVotes();
round.repartitions = roundInfo.getRepartitions();
round.penalties = roundInfo.getPnkPenalties();
round.disputeKit = roundInfo.disputeKitID.toString();
round.tokensAtStakePerJuror = roundInfo.pnkAtStakePerJuror;
round.totalFeesForJurors = roundInfo.totalFeesForJurors;
round.nbVotes = roundInfo.nbVotes;
round.repartitions = roundInfo.repartitions;
round.penalties = roundInfo.pnkPenalties;
round.dispute = disputeID.toString();
round.save();
}
24 changes: 12 additions & 12 deletions subgraph/subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ dataSources:
name: KlerosCore
network: arbitrum-goerli
source:
address: "0x791812B0B9f2ba260B2DA432BB02Ee23BC1bB509"
address: "0x813DCc76dbA91DD9f6bDD038aea0877FC95656bE"
abi: KlerosCore
startBlock: 33640331
startBlock: 43823780
mapping:
kind: ethereum/events
apiVersion: 0.0.6
Expand All @@ -26,9 +26,9 @@ dataSources:
- Counter
abis:
- name: DisputeKitClassic
file: ../contracts/deployments/arbitrumGoerli/DisputeKitClassic.json
file: ../contracts/deployments/arbitrumGoerliDevnet/DisputeKitClassic.json
- name: KlerosCore
file: ../contracts/deployments/arbitrumGoerli/KlerosCore.json
file: ../contracts/deployments/arbitrumGoerliDevnet/KlerosCore.json
eventHandlers:
- event: AppealDecision(indexed uint256,indexed address)
handler: handleAppealDecision
Expand All @@ -48,7 +48,7 @@ dataSources:
handler: handleDisputeKitEnabled
- event: StakeSet(indexed address,uint256,uint256)
handler: handleStakeSet
- event: StakeDelayed(indexed address,uint256,uint256,uint256)
- event: StakeDelayed(indexed address,uint256,uint256)
handler: handleStakeDelayed
- event: TokenAndETHShift(indexed address,indexed uint256,indexed uint256,uint256,int256,int256,address)
handler: handleTokenAndETHShift
Expand All @@ -61,9 +61,9 @@ dataSources:
name: PolicyRegistry
network: arbitrum-goerli
source:
address: "0x4c129b9836E4CC3Cf6D833b39a4B7cfA25D86c86"
address: "0x0d7EeA661C1f9cB1AD389c9Df90B3beDE86a1529"
abi: PolicyRegistry
startBlock: 33436566
startBlock: 43823685
mapping:
kind: ethereum/events
apiVersion: 0.0.6
Expand All @@ -72,7 +72,7 @@ dataSources:
- Court
abis:
- name: PolicyRegistry
file: ../contracts/deployments/arbitrumGoerli/PolicyRegistry.json
file: ../contracts/deployments/arbitrumGoerliDevnet/PolicyRegistry.json
eventHandlers:
- event: PolicyUpdate(indexed uint256,string,string)
handler: handlePolicyUpdate
Expand All @@ -81,9 +81,9 @@ dataSources:
name: DisputeKitClassic
network: arbitrum-goerli
source:
address: "0x439f92b61783A752462527f9dA9C6c6180C9253a"
address: "0x6394A70cADD1376FdE5C38bA331761256DDd03E2"
abi: DisputeKitClassic
startBlock: 34139950
startBlock: 43823737
mapping:
kind: ethereum/events
apiVersion: 0.0.6
Expand All @@ -97,9 +97,9 @@ dataSources:
- ClassicContribution
abis:
- name: DisputeKitClassic
file: ../contracts/deployments/arbitrumGoerli/DisputeKitClassic.json
file: ../contracts/deployments/arbitrumGoerliDevnet/DisputeKitClassic.json
- name: KlerosCore
file: ../contracts/deployments/arbitrumGoerli/KlerosCore.json
file: ../contracts/deployments/arbitrumGoerliDevnet/KlerosCore.json
eventHandlers:
- event: DisputeCreation(indexed uint256,uint256,bytes)
handler: handleDisputeCreation
Expand Down

0 comments on commit ae3d854

Please sign in to comment.