Skip to content

Commit 49498e2

Browse files
authored
Merge branch 'dev' into refactor(web)/extract-calc-to-ResponsiveSize-function
2 parents 609c49a + 4a007e3 commit 49498e2

File tree

9 files changed

+484
-130
lines changed

9 files changed

+484
-130
lines changed

contracts/src/arbitration/KlerosCore.sol

Lines changed: 37 additions & 105 deletions
Large diffs are not rendered by default.

contracts/src/arbitration/arbitrables/Escrow.sol

Lines changed: 420 additions & 0 deletions
Large diffs are not rendered by default.

contracts/test/arbitration/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ describe("DisputeKitClassic", async () => {
1818
expect(events.length).to.equal(1);
1919
expect(events[0].args._disputeKitID).to.equal(1);
2020
expect(events[0].args._disputeKitAddress).to.equal(disputeKit.address);
21-
expect(events[0].args._parent).to.equal(0);
2221

2322
// Reminder: the Forking court will be added which will break these expectations.
2423
events = await core.queryFilter(core.filters.CourtCreated());

subgraph/schema.graphql

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,7 @@ type Draw @entity(immutable: true) {
198198
type DisputeKit @entity {
199199
id: ID!
200200
address: Bytes
201-
parent: DisputeKit
202-
children: [DisputeKit!]! @derivedFrom(field: "parent")
203201
needsFreezing: Boolean!
204-
depthLevel: BigInt!
205202
rounds: [Round!]! @derivedFrom(field: "disputeKit")
206203
courts: [Court!]! @derivedFrom(field: "supportedDisputeKits")
207204
}

subgraph/src/entities/DisputeKit.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,14 @@ import { ZERO, ONE } from "../utils";
44

55
export function createDisputeKitFromEvent(event: DisputeKitCreated): void {
66
const disputeKit = new DisputeKit(event.params._disputeKitID.toString());
7-
disputeKit.parent = event.params._parent.toString();
87
disputeKit.address = event.params._disputeKitAddress;
98
disputeKit.needsFreezing = false;
10-
const parent = DisputeKit.load(event.params._parent.toString());
11-
disputeKit.depthLevel = parent ? parent.depthLevel.plus(ONE) : ZERO;
129
disputeKit.save();
1310
}
1411

15-
export function filterSupportedDisputeKits(
16-
supportedDisputeKits: string[],
17-
disputeKitID: string
18-
): string[] {
12+
export function filterSupportedDisputeKits(supportedDisputeKits: string[], disputeKitID: string): string[] {
1913
let result: string[] = [];
2014
for (let i = 0; i < supportedDisputeKits.length; i++)
21-
if (supportedDisputeKits[i] !== disputeKitID)
22-
result = result.concat([supportedDisputeKits[i]]);
15+
if (supportedDisputeKits[i] !== disputeKitID) result = result.concat([supportedDisputeKits[i]]);
2316
return result;
2417
}

subgraph/subgraph.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ dataSources:
4242
handler: handleCourtCreated
4343
- event: CourtModified(indexed uint96,bool,uint256,uint256,uint256,uint256,uint256[4])
4444
handler: handleCourtModified
45-
- event: DisputeKitCreated(indexed uint256,indexed address,indexed uint256)
45+
- event: DisputeKitCreated(indexed uint256,indexed address)
4646
handler: handleDisputeKitCreated
4747
- event: DisputeKitEnabled(indexed uint96,indexed uint256,indexed bool)
4848
handler: handleDisputeKitEnabled

web/.env.devnet.public

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
export REACT_APP_DEPLOYMENT=devnet
33
export REACT_APP_KLEROS_CORE_SUBGRAPH_DEVNET=https://api.thegraph.com/subgraphs/name/kleros/kleros-v2-core-devnet
44
export REACT_APP_DISPUTE_TEMPLATE_ARBGOERLI_SUBGRAPH_DEVNET=https://api.thegraph.com/subgraphs/name/kleros/kleros-v2-dr-devnet
5+
export REACT_APP_STATUS_URL=https://kleros-v2-devnet.betteruptime.com/badge

web/.env.testnet.public

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
export REACT_APP_DEPLOYMENT=testnet
33
export REACT_APP_KLEROS_CORE_SUBGRAPH_TESTNET=https://api.thegraph.com/subgraphs/name/kleros/kleros-v2-core-testnet-2
44
export REACT_APP_DISPUTE_TEMPLATE_ARBGOERLI_SUBGRAPH_TESTNET=https://api.thegraph.com/subgraphs/name/kleros/kleros-v2-dr-testnet-2
5+
export REACT_APP_STATUS_URL=https://kleros-v2.betteruptime.com/badge

web/src/layout/Header/navbar/Debug.tsx

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
import React from "react";
1+
import React, { useMemo } from "react";
22
import styled from "styled-components";
33
import { useSortitionModulePhase } from "hooks/contracts/generated";
4+
import { useToggleTheme } from "hooks/useToggleThemeContext";
45
import { GIT_BRANCH, GIT_DIRTY, GIT_HASH, GIT_TAGS, GIT_URL, RELEASE_VERSION } from "consts/index";
56

67
const Container = styled.div`
8+
display: flex;
9+
flex-direction: column;
10+
gap: 12px;
11+
712
label,
813
a {
914
font-family: "Roboto Mono", monospace;
@@ -13,6 +18,13 @@ const Container = styled.div`
1318
}
1419
`;
1520

21+
const StyledIframe = styled.iframe`
22+
border: none;
23+
width: 100%;
24+
height: 30px;
25+
border-radius: 300px;
26+
`;
27+
1628
const Version = () => (
1729
<label>
1830
v{RELEASE_VERSION}{" "}
@@ -25,6 +37,13 @@ const Version = () => (
2537
</label>
2638
);
2739

40+
const ServicesStatus = () => {
41+
const [theme] = useToggleTheme();
42+
const statusUrlParameters = useMemo(() => (theme === "light" ? "?theme=light" : "?theme=dark"), [theme]);
43+
const statusUrl = process.env.REACT_APP_STATUS_URL;
44+
return <label>{statusUrl && <StyledIframe src={`${statusUrl + statusUrlParameters}`} />}</label>;
45+
};
46+
2847
enum Phases {
2948
staking,
3049
generating,
@@ -35,21 +54,13 @@ const Phase = () => {
3554
const { data: phase } = useSortitionModulePhase({
3655
watch: true,
3756
});
38-
return (
39-
<>
40-
{phase !== undefined && (
41-
<label>
42-
<br />
43-
phase: {Phases[phase]}
44-
</label>
45-
)}
46-
</>
47-
);
57+
return <>{phase !== undefined && <label>Phase: {Phases[phase]}</label>}</>;
4858
};
4959

5060
const Debug: React.FC = () => {
5161
return (
5262
<Container>
63+
<ServicesStatus />
5364
<Version />
5465
<Phase />
5566
</Container>

0 commit comments

Comments
 (0)