Skip to content
This repository was archived by the owner on Nov 9, 2022. It is now read-only.

Commit cd23f52

Browse files
committed
chore: subgraph fixes and mainnet deploy
1 parent 476cbd5 commit cd23f52

File tree

8 files changed

+21
-10
lines changed

8 files changed

+21
-10
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
## (2021-01-25)
1+
## (2021-01-26)
22

33
- chore: build subgraph schema ([9810923](https://github.com/kleros/governor-web/commit/9810923))
44
- chore: fix subgraph bugs ([767545d](https://github.com/kleros/governor-web/commit/767545d))
55
- chore: generate first changelog ([2e41de7](https://github.com/kleros/governor-web/commit/2e41de7))
6+
- chore: implement session card part of the front page ([476cbd5](https://github.com/kleros/governor-web/commit/476cbd5))
67
- chore: map appeal funding in subgraph ([990a87d](https://github.com/kleros/governor-web/commit/990a87d))
78
- chore: map governance functions in subgraph ([360d007](https://github.com/kleros/governor-web/commit/360d007))
89
- chore: map list submissions in subgraph ([8cbbe41](https://github.com/kleros/governor-web/commit/8cbbe41))

_pages/index/session-card.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default function SessionCard({ contract, session }) {
5353
</Text>
5454
<Text>
5555
<Text as="span" sx={{ fontWeight: "bold" }}>
56-
Session:
56+
Current Session:
5757
</Text>{" "}
5858
Votes approved before{" "}
5959
<Text as="span">{sessionStart?.toLocaleString()}</Text>

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
"build:analyze": "cross-env ANALYZE=true npm run build",
8181
"build:graph": "cd subgraph && mustache config/kovan.json subgraph.template.yaml > subgraph.yaml && graph codegen && graph build",
8282
"deploy:graph:kovan": "npm run build:graph && cd subgraph && graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ epiqueras/governor-kovan",
83+
"deploy:graph:mainnet": "cd subgraph && mustache config/mainnet.json subgraph.template.yaml > subgraph.yaml && graph codegen && graph build && graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ epiqueras/governor-mainnet",
8384
"changelog": "conventional-changelog --infile README.md --same-file --release-count 0 && prettier --write README.md",
8485
"ci:depcheck": "npm run depcheck",
8586
"ci:prettier": "prettier --ignore-path .gitignore --check .",

pages/_app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const header = {
6969
left: (
7070
<NextLink href="/">
7171
<Link variant="unstyled" sx={{ marginLeft: 1 }}>
72-
<WhiteKlerosLogo height={49} width={148} />
72+
<WhiteKlerosLogo height={35} width={105} />
7373
</Link>
7474
</NextLink>
7575
),
@@ -81,7 +81,7 @@ const header = {
8181
right: <AccountSettingsPopup />,
8282
};
8383
const footer = {
84-
left: <WhiteSecuredByKleros height={24} width={130} />,
84+
left: <WhiteSecuredByKleros height={20} width={105} />,
8585
right: <SocialIcons />,
8686
};
8787
const AnimatedBox = animated(Box);

subgraph/config/kovan.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
22
"network": "kovan",
3-
"address": "0x5355629eebb23b4b86a623f8d247b5fe44005613"
3+
"address": "0x5355629eebb23b4b86a623f8d247b5fe44005613",
4+
"startBlock": 22001129
45
}

subgraph/config/mainnet.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"network": "mainnet",
3+
"address": "0xe5bcea6f87aaee4a81f64dfdb4d30d400e0e5cf4",
4+
"startBlock": 11068577
5+
}

subgraph/src/mapping.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ export function withdrawFeesAndRewards(call: WithdrawFeesAndRewardsCall): void {
407407
export function ruling(event: Ruling): void {
408408
let governor = Governor.bind(event.address);
409409
let contract = initializeContract(
410-
event.transaction.to as Address,
410+
event.address,
411411
event.transaction.from,
412412
event.block.timestamp
413413
);
@@ -419,7 +419,9 @@ export function ruling(event: Ruling): void {
419419
if (event.params._ruling.notEqual(BigInt.fromI32(0))) {
420420
let submittedLists = session.submittedLists;
421421
let submission = Submission.load(
422-
submittedLists[event.params._ruling.toI32()].toHexString()
422+
submittedLists[
423+
event.params._ruling.minus(BigInt.fromI32(1)).toI32()
424+
].toHexString()
423425
);
424426
submission.approved = true;
425427
submission.approvalTime = event.block.timestamp;

subgraph/subgraph.template.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1+
# {{=<% %>=}}
12
specVersion: 0.0.2
23
schema:
34
file: ./schema.graphql
45
dataSources:
56
- kind: ethereum/contract
67
name: Governor
7-
network: "{{network}}"
8+
network: "<%network%>"
89
source:
9-
address: "{{address}}"
10+
address: "<%address%>"
1011
abi: Governor
11-
startBlock: 22001129
12+
startBlock: <%startBlock%>
1213
mapping:
1314
kind: ethereum/events
1415
apiVersion: 0.0.4

0 commit comments

Comments
 (0)