Skip to content

Web and Subgraph migration to the new Testnet #1134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 33 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
fb2b7fc
fix: interaction-popups
nhestrompia Aug 4, 2023
44b5cde
fix: voting-results-and-display
nhestrompia Aug 4, 2023
470998d
feat: pnk-faucet-button
nhestrompia Aug 4, 2023
f292113
fix: code smell
nhestrompia Aug 4, 2023
1c8db72
fix: code smells
nhestrompia Aug 7, 2023
0fcac02
fix(web): style adjustments, code abstractions
kemuru Aug 7, 2023
be17af5
fix(web): stake & withdraw popup appeared if user declined transaction
kemuru Aug 7, 2023
8d67d9f
feat(web): close popup if clicked outside
kemuru Aug 7, 2023
7cae39e
chore(web): revert last commit
kemuru Aug 7, 2023
dbc0f75
fix(web): dashboard-update-related-to-subgraph
nhestrompia Aug 7, 2023
c8ab3c5
Merge branch 'dev' into fix(web)/interaction-popups
alcercu Aug 7, 2023
0a94fc4
Use 375px as the lower bound size on all instances
alcercu Aug 7, 2023
5436bcd
Merge pull request #1105 from kleros/fix(web)/interaction-popups
alcercu Aug 7, 2023
0b10fb4
Merge pull request #1116 from kleros/fix(web)/dashboard-update-relate…
alcercu Aug 7, 2023
7d9cc65
refactor: abstract logic of vote choice
nhestrompia Aug 7, 2023
f646955
Change button text when funds have been claimed
alcercu Aug 7, 2023
f7045de
Use get vote choice on overridden disputes too
alcercu Aug 7, 2023
ee63cf5
Merge branch 'staging-web' into fix(web)/voting-results-and-display
alcercu Aug 7, 2023
5be2a1f
Merge pull request #1108 from kleros/fix(web)/voting-results-and-display
alcercu Aug 7, 2023
61eb581
fix: handle empty faucet
nhestrompia Aug 7, 2023
4eaa6c7
fix(web): wallet-logo-fix
nhestrompia Aug 8, 2023
183192b
Merge pull request #1119 from kleros/fix(web)/wallet-logo-fix
alcercu Aug 8, 2023
1bf70db
test: missing contract
jaybuidl Aug 8, 2023
1e6eb06
fix(deps): update all non-major dependencies
renovate[bot] Aug 8, 2023
4074ce8
chore: downgraded solidity-coverage and yarn
jaybuidl Aug 8, 2023
c09d403
fix(web): wrong major version for graphql-request, inconsistent with …
jaybuidl Aug 8, 2023
91e40a4
chore(deps): bump step-security/harden-runner from 2.4.1 to 2.5.0
dependabot[bot] Aug 8, 2023
f16a157
chore: allowed endpoints for dependency-review.yml
jaybuidl Aug 9, 2023
233b6b9
Merge pull request #1109 from kleros/feat(web)/pnk-faucet-button
alcercu Aug 9, 2023
0ed967f
Merge branch 'dev' into staging-web
alcercu Aug 9, 2023
ffe3ef0
fix(web): popup appear when transaction confirmed & other stakewithdr…
kemuru Aug 9, 2023
141d06a
Merge branch 'staging-web' into fix(web)/popup-appear-when-transactio…
alcercu Aug 9, 2023
eb5bcaa
Merge pull request #1132 from kleros/fix(web)/popup-appear-when-trans…
alcercu Aug 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/contracts-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@55d479fb1c5bcad5a4f9099a5d9f37c8857b2845 # v2.4.1
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604 # v2.5.0
with:
disable-sudo: true
egress-policy: block
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@55d479fb1c5bcad5a4f9099a5d9f37c8857b2845 # v2.4.1
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604 # v2.5.0
with:
disable-sudo: true
egress-policy: block
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
allowed-endpoints: >
api.github.com:443
github.com:443
pipelinesghubeus2.actions.githubusercontent.com:443
acghubeus1.actions.githubusercontent.com:443

- name: 'Checkout Repository'
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-bots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@55d479fb1c5bcad5a4f9099a5d9f37c8857b2845
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-subgraph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
environment: kleros-org-subgraph
steps:
- name: Harden Runner
uses: step-security/harden-runner@55d479fb1c5bcad5a4f9099a5d9f37c8857b2845 # v2.4.1
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604 # v2.5.0
with:
egress-policy: audit

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

steps:
- name: Harden Runner
uses: step-security/harden-runner@55d479fb1c5bcad5a4f9099a5d9f37c8857b2845 # v2.4.1
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604 # v2.5.0
with:
disable-sudo: true
egress-policy: block
Expand Down Expand Up @@ -86,6 +86,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@489225d82a57396c6f426a40e66d461b16b3461d # v2.20.4
uses: github/codeql-action/upload-sarif@5b6282e01c62d02e720b81eb8a51204f527c3624 # v2.21.3
with:
sarif_file: results.sarif
2 changes: 1 addition & 1 deletion .github/workflows/sentry-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
version: ${{ steps.set-version.outputs.version }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@55d479fb1c5bcad5a4f9099a5d9f37c8857b2845 # v2.4.1
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604 # v2.5.0
with:
disable-sudo: true
egress-policy: block
Expand Down
2 changes: 1 addition & 1 deletion bot-pinner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "MIT",
"packageManager": "[email protected]",
"volta": {
"node": "16.13.0"
"node": "16.20.1"
},
"scripts": {
"build:local": "docker compose build",
Expand Down
7 changes: 6 additions & 1 deletion contracts/deploy/03-vea-mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const deployHomeGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment)
console.log("Deploying to chainId %s with deployer %s", HARDHAT_NETWORK, deployer);

const klerosCore = await deployments.get("KlerosCore");
const disputeTemplateRegistry = await deployments.get("DisputeTemplateRegistry");

const vea = await deploy("VeaMock", {
from: deployer,
Expand Down Expand Up @@ -62,6 +61,12 @@ const deployHomeGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment)
await execute("ForeignGatewayOnEthereum", { from: deployer, log: true }, "changeCourtJurorFee", courtId, fee);
// TODO: set up the correct fees for the lower courts

const disputeTemplateRegistry = await deploy("DisputeTemplateRegistry", {
from: deployer,
args: [],
log: true,
});

// TODO: debug why this extraData fails but "0x00" works
// const extraData =
// "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003"; // General court, 3 jurors
Expand Down
2 changes: 1 addition & 1 deletion contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"node": ">=16.0.0"
},
"volta": {
"node": "16.18.1",
"node": "16.20.1",
"yarn": "3.3.1"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
],
"packageManager": "[email protected]",
"volta": {
"node": "16.18.1",
"node": "16.20.1",
"yarn": "3.3.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion services/graph-node/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ services:
GRAPH_LOG: info
stop_grace_period: 5s
ipfs:
image: ipfs/go-ipfs:v0.10.0
image: ipfs/go-ipfs:v0.22.0
ports:
- "5001:5001"
volumes:
Expand Down
4 changes: 2 additions & 2 deletions subgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
"stop-local-indexer": "docker compose -f ../services/graph-node/docker-compose.yml down && rm -rf ../services/graph-node/data"
},
"volta": {
"node": "16.18.1",
"node": "16.20.1",
"yarn": "3.3.1"
},
"dependencies": {
"@graphprotocol/graph-ts": "^0.31.0"
},
"devDependencies": {
"@graphprotocol/graph-cli": "^0.51.2",
"@graphprotocol/graph-cli": "^0.54.0",
"@kleros/kleros-v2-eslint-config": "workspace:^",
"@kleros/kleros-v2-prettier-config": "workspace:^",
"gluegun": "^5.1.2"
Expand Down
12 changes: 6 additions & 6 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"@kleros/kleros-v2-prettier-config": "workspace:^",
"@kleros/kleros-v2-tsconfig": "workspace:^",
"@netlify/functions": "^1.6.0",
"@parcel/transformer-svg-react": "~2.8.0",
"@parcel/watcher": "~2.1.0",
"@parcel/transformer-svg-react": "~2.9.0",
"@parcel/watcher": "~2.2.0",
"@types/amqplib": "^0.10.1",
"@types/busboy": "^1.5.0",
"@types/react": "^18.2.14",
Expand All @@ -61,7 +61,7 @@
"typescript": "^4.9.5"
},
"dependencies": {
"@filebase/client": "^0.0.4",
"@filebase/client": "^0.0.5",
"@kleros/kleros-v2-contracts": "workspace:^",
"@kleros/ui-components-library": "^2.6.1",
"@sentry/react": "^7.55.2",
Expand All @@ -76,9 +76,9 @@
"core-js": "^3.31.0",
"ethers": "^5.7.2",
"graphql": "^16.7.1",
"graphql-request": "~5.1.0",
"graphql-request": "~6.1.0",
"moment": "^2.29.4",
"parcel": "~2.8.0",
"parcel": "~2.9.0",
"react": "^18.2.0",
"react-chartjs-2": "^4.3.1",
"react-dom": "^18.2.0",
Expand All @@ -97,7 +97,7 @@
"wagmi": "^1.1.0"
},
"volta": {
"node": "16.18.1",
"node": "16.20.1",
"yarn": "3.3.1"
}
}
35 changes: 7 additions & 28 deletions web/src/components/Popup/Description/VoteWithCommit.tsx
Original file line number Diff line number Diff line change
@@ -1,39 +1,18 @@
import React from "react";
import styled from "styled-components";

const Container = styled.div`
display: flex;
flex-direction: column;
`;

const StyledDescription = styled.div`
margin-bottom: calc(16px + (32 - 16) * ((100vw - 300px) / (1250 - 300)));
margin-left: calc(8px + (32 - 8) * ((100vw - 300px) / (1250 - 300)));
margin-right: calc(8px + (32 - 8) * ((100vw - 300px) / (1250 - 300)));
color: ${({ theme }) => theme.secondaryText};
text-align: center;
line-height: 21.8px;
`;

const EmphasizedDate = styled.span`
font-size: 16px;
font-weight: 400;
line-height: 21.8px;
color: ${({ theme }) => theme.primaryText};
`;
import VoteDescriptionEmphasizedDate from "components/Popup";

interface IVoteWithCommit {
date: string;
}

const VoteWithCommit: React.FC<IVoteWithCommit> = ({ date }) => {
return (
<Container>
<StyledDescription>
Your vote is confirmed. It's kept secret until all jurors have cast their votes.
<EmphasizedDate> You'll need to justify and reveal your vote on {date}</EmphasizedDate>
</StyledDescription>
</Container>
<>
Your vote is confirmed. It's kept secret until all jurors have cast their votes.
<VoteDescriptionEmphasizedDate>
You'll need to justify and reveal your vote on {date}
</VoteDescriptionEmphasizedDate>
</>
);
};
export default VoteWithCommit;
33 changes: 5 additions & 28 deletions web/src/components/Popup/Description/VoteWithoutCommit.tsx
Original file line number Diff line number Diff line change
@@ -1,39 +1,16 @@
import React from "react";
import styled from "styled-components";

const Container = styled.div`
display: flex;
flex-direction: column;
`;

const StyledDescription = styled.div`
margin-bottom: calc(16px + (32 - 16) * ((100vw - 300px) / (1250 - 300)));
margin-left: calc(8px + (32 - 8) * ((100vw - 300px) / (1250 - 300)));
margin-right: calc(8px + (32 - 8) * ((100vw - 300px) / (1250 - 300)));
color: ${({ theme }) => theme.secondaryText};
text-align: center;
line-height: 21.8px;
`;

const EmphasizedDate = styled.span`
font-size: 16px;
font-weight: 400;
line-height: 21.8px;
color: ${({ theme }) => theme.primaryText};
`;
import VoteDescriptionEmphasizedDate from "components/Popup";

interface IVoteWithoutCommit {
date: string;
}

const VoteWithoutCommit: React.FC<IVoteWithoutCommit> = ({ date }) => {
return (
<Container>
<StyledDescription>
The decision date is <EmphasizedDate>{date}</EmphasizedDate> with the possibility for appeals. After that time
you will be informed about the jury decision.
</StyledDescription>
</Container>
<>
The decision date is <VoteDescriptionEmphasizedDate>{date}</VoteDescriptionEmphasizedDate> with the possibility
for appeals. After that time you will be informed about the jury decision.
</>
);
};
export default VoteWithoutCommit;
45 changes: 37 additions & 8 deletions web/src/components/Popup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,28 +52,31 @@ type PopupProps = IStakeWithdraw | IVoteWithoutCommit | IVoteWithCommit | IAppea

const Header = styled.h1`
display: flex;
margin-top: calc(12px + (32 - 12) * ((100vw - 300px) / (1250 - 300)));
margin-bottom: calc(12px + (24 - 12) * ((100vw - 300px) / (1250 - 300)));
margin-top: calc(12px + (32 - 12) * ((100vw - 375px) / (1250 - 375)));
margin-bottom: calc(12px + (24 - 12) * ((100vw - 375px) / (1250 - 375)));
margin-left: calc(8px + (12 - 8) * ((100vw - 375px) / (1250 - 375)));
margin-right: calc(8px + (12 - 8) * ((100vw - 375px) / (1250 - 375)));
text-align: center;
font-size: 24px;
font-weight: 600;
line-height: 32.68px;
`;

const IconContainer = styled.div`
width: calc(150px + (350 - 150) * (100vw - 375px) / (1250 - 375));
width: calc(150px + (228 - 150) * (100vw - 375px) / (1250 - 375));
display: flex;
align-items: center;
justify-content: center;

svg {
display: inline-block;
width: calc(150px + (350 - 150) * (100vw - 375px) / (1250 - 375));
height: calc(150px + (350 - 150) * (100vw - 375px) / (1250 - 375));
width: calc(150px + (228 - 150) * (100vw - 375px) / (1250 - 375));
height: calc(150px + (228 - 150) * (100vw - 375px) / (1250 - 375));
}
`;

const StyledButton = styled(Button)`
margin: calc(16px + (32 - 16) * ((100vw - 300px) / (1250 - 300)));
margin: calc(16px + (32 - 16) * ((100vw - 375px) / (1250 - 375)));
`;

const Container = styled.div`
Expand All @@ -99,6 +102,24 @@ const Container = styled.div`
}
`;

const VoteDescriptionContainer = styled.div`
display: flex;
flex-direction: column;
margin-bottom: calc(16px + (32 - 16) * ((100vw - 375px) / (1250 - 375)));
margin-left: calc(8px + (32 - 8) * ((100vw - 375px) / (1250 - 375)));
margin-right: calc(8px + (32 - 8) * ((100vw - 375px) / (1250 - 375)));
color: ${({ theme }) => theme.secondaryText};
text-align: center;
line-height: 21.8px;
`;

export const VoteDescriptionEmphasizedDate = styled.span`
font-size: 16px;
font-weight: 400;
line-height: 21.8px;
color: ${({ theme }) => theme.primaryText};
`;

const Popup: React.FC<PopupProps & IPopup> = ({
title,
icon: Icon,
Expand Down Expand Up @@ -128,12 +149,20 @@ const Popup: React.FC<PopupProps & IPopup> = ({
}
case PopupType.VOTE_WITHOUT_COMMIT: {
const { date } = props as IVoteWithoutCommit;
PopupComponent = <VoteWithoutCommit date={date} />;
PopupComponent = (
<VoteDescriptionContainer>
<VoteWithoutCommit date={date} />
</VoteDescriptionContainer>
);
break;
}
case PopupType.VOTE_WITH_COMMIT: {
const { date } = props as IVoteWithCommit;
PopupComponent = <VoteWithCommit date={date} />;
PopupComponent = (
<VoteDescriptionContainer>
<VoteWithCommit date={date} />
</VoteDescriptionContainer>
);
break;
}
case PopupType.APPEAL: {
Expand Down
Loading