Skip to content

Commit 6e658fd

Browse files
authored
Merge branch 'dev' into feat(web)/add-function-return-types
2 parents 8e37a85 + 42cb23e commit 6e658fd

File tree

10 files changed

+188
-113
lines changed

10 files changed

+188
-113
lines changed

.github/workflows/dependabot-automerge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
2222
- name: Dependabot metadata
2323
id: metadata
24-
uses: dependabot/fetch-metadata@efb5c8deb113433243b6b08de1aa879d5aa01cf7 # v1.4.0
24+
uses: dependabot/fetch-metadata@cd6e996708b8cfe0b639401134a3b9a3177be7b2 # v1.5.1
2525
with:
2626
github-token: "${{ secrets.GITHUB_TOKEN }}"
2727

.github/workflows/deploy-bots.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
1414

1515
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
16-
- uses: actions/setup-python@57ded4d7d5e986d7296eab16560982c6dd7c923b
16+
- uses: actions/setup-python@bd6b4b6205c4dbad673328db7b31b7fab9e241c0
1717
- uses: aws-actions/setup-sam@2993f015a7af30461b7641a256042fe0c6fc0c2e
1818
- uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838
1919
with:

.github/workflows/scorecards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,6 @@ jobs:
8484

8585
# Upload the results to GitHub's code scanning dashboard.
8686
- name: "Upload to code-scanning"
87-
uses: github/codeql-action/upload-sarif@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.1.27
87+
uses: github/codeql-action/upload-sarif@83f0fe6c4988d98a455712a27f0255212bba9bd4 # v2.1.27
8888
with:
8989
sarif_file: results.sarif

bot-pinner/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3@sha256:30f9c5b85d6a9866dd6307d24f4688174f7237bc3293b9293d590b1e59c68fc7
1+
FROM python:3@sha256:3a619e3c96fd4c5fc5e1998fd4dcb1f1403eb90c4c6409c70d7e80b9468df7df
22

33
WORKDIR /usr/src/app
44

contracts/src/arbitration/KlerosCore.sol

Lines changed: 161 additions & 73 deletions
Large diffs are not rendered by default.

contracts/src/arbitration/SortitionModule.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ contract SortitionModule is ISortitionModule {
249249
if (currenCourtID == core.GENERAL_COURT()) {
250250
finished = true;
251251
} else {
252-
(currenCourtID, , , , , ) = core.courts(currenCourtID);
252+
(currenCourtID, , , , , , ) = core.courts(currenCourtID);
253253
}
254254
}
255255
}

contracts/src/arbitration/dispute-kits/DisputeKitClassic.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ contract DisputeKitClassic is BaseDisputeKit, IEvidence {
227227

228228
Round storage round = dispute.rounds[dispute.rounds.length - 1];
229229
(uint96 courtID, , , , ) = core.disputes(_coreDisputeID);
230-
(, bool hiddenVotes, , , , ) = core.courts(courtID);
230+
(, bool hiddenVotes, , , , , ) = core.courts(courtID);
231231

232232
// Save the votes.
233233
for (uint256 i = 0; i < _voteIDs.length; i++) {
@@ -538,12 +538,12 @@ contract DisputeKitClassic is BaseDisputeKit, IEvidence {
538538
/// @return Whether the address can be drawn or not.
539539
function _postDrawCheck(uint256 _coreDisputeID, address _juror) internal view override returns (bool) {
540540
(uint96 courtID, , , , ) = core.disputes(_coreDisputeID);
541-
(uint256 lockedAmountPerJuror, , , , , ) = core.getRoundInfo(
541+
(uint256 lockedAmountPerJuror, , , , , , , ) = core.getRoundInfo(
542542
_coreDisputeID,
543543
core.getNumberOfRounds(_coreDisputeID) - 1
544544
);
545545
(uint256 stakedTokens, uint256 lockedTokens, ) = core.getJurorBalance(_juror, courtID);
546-
(, , uint256 minStake, , , ) = core.courts(courtID);
546+
(, , uint256 minStake, , , , ) = core.courts(courtID);
547547
return stakedTokens >= lockedTokens + lockedAmountPerJuror && stakedTokens >= minStake;
548548
}
549549
}

contracts/src/arbitration/dispute-kits/DisputeKitSybilResistant.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ contract DisputeKitSybilResistant is BaseDisputeKit, IEvidence {
247247

248248
Round storage round = dispute.rounds[dispute.rounds.length - 1];
249249
(uint96 courtID, , , , ) = core.disputes(_coreDisputeID);
250-
(, bool hiddenVotes, , , , ) = core.courts(courtID);
250+
(, bool hiddenVotes, , , , , ) = core.courts(courtID);
251251

252252
// Save the votes.
253253
for (uint256 i = 0; i < _voteIDs.length; i++) {
@@ -558,12 +558,12 @@ contract DisputeKitSybilResistant is BaseDisputeKit, IEvidence {
558558
/// @return Whether the address can be drawn or not.
559559
function _postDrawCheck(uint256 _coreDisputeID, address _juror) internal view override returns (bool) {
560560
(uint96 courtID, , , , ) = core.disputes(_coreDisputeID);
561-
(uint256 lockedAmountPerJuror, , , , , ) = core.getRoundInfo(
561+
(uint256 lockedAmountPerJuror, , , , , , , ) = core.getRoundInfo(
562562
_coreDisputeID,
563563
core.getNumberOfRounds(_coreDisputeID) - 1
564564
);
565565
(uint256 stakedTokens, uint256 lockedTokens, ) = core.getJurorBalance(_juror, courtID);
566-
(, , uint256 minStake, , , ) = core.courts(courtID);
566+
(, , uint256 minStake, , , , ) = core.courts(courtID);
567567
if (stakedTokens < lockedTokens + lockedAmountPerJuror || stakedTokens < minStake) {
568568
return false;
569569
} else {

web/src/hooks/useFocusOutside.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import React, { useEffect } from "react";
22

3-
export function useFocusOutside(
4-
ref: React.RefObject<HTMLDivElement>,
5-
callback: () => void
6-
) {
3+
export function useFocusOutside(ref: React.RefObject<HTMLDivElement>, callback: () => void) {
74
useEffect(() => {
8-
function handleEvent(event: any) {
9-
if (ref.current && !ref.current.contains(event.target)) {
5+
function handleEvent(event: FocusEvent | MouseEvent) {
6+
if (ref.current && !ref.current.contains(event.target as Node)) {
107
callback();
118
}
129
}

web/src/pages/Courts/CourtDetails/Description.tsx

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,34 @@
11
import React, { useEffect, useState } from "react";
22
import styled from "styled-components";
33
import ReactMarkdown from "react-markdown";
4-
import {
5-
Routes,
6-
Route,
7-
Navigate,
8-
useParams,
9-
useNavigate,
10-
useLocation,
11-
} from "react-router-dom";
4+
import { Routes, Route, Navigate, useParams, useNavigate, useLocation } from "react-router-dom";
125
import { Tabs } from "@kleros/ui-components-library";
136
import { useCourtPolicy } from "queries/useCourtPolicy";
147

8+
interface IPolicy {
9+
description?: string;
10+
requiredSkills?: string;
11+
summary?: string;
12+
}
13+
1514
const TABS = [
1615
{
1716
text: "Purpose",
1817
value: 0,
1918
path: "purpose",
20-
isVisible: (policy: any) => !!policy?.description,
19+
isVisible: (policy: IPolicy) => !!policy?.description,
2120
},
2221
{
2322
text: "Skills",
2423
value: 1,
2524
path: "skills",
26-
isVisible: (policy: any) => !!policy?.requiredSkills,
25+
isVisible: (policy: IPolicy) => !!policy?.requiredSkills,
2726
},
2827
{
2928
text: "Policy",
3029
value: 2,
3130
path: "policy",
32-
isVisible: (policy: any) => !!policy?.summary,
31+
isVisible: (policy: IPolicy) => !!policy?.summary,
3332
},
3433
];
3534

@@ -38,13 +37,8 @@ const Description: React.FC = () => {
3837
const { data: policy } = useCourtPolicy(id);
3938
const navigate = useNavigate();
4039
const currentPathName = useLocation().pathname.split("/").at(-1);
41-
const [currentTab, setCurrentTab] = useState(
42-
TABS.findIndex(({ path }) => path === currentPathName)
43-
);
44-
useEffect(
45-
() => setCurrentTab(TABS.findIndex(({ path }) => path === currentPathName)),
46-
[currentPathName]
47-
);
40+
const [currentTab, setCurrentTab] = useState(TABS.findIndex(({ path }) => path === currentPathName));
41+
useEffect(() => setCurrentTab(TABS.findIndex(({ path }) => path === currentPathName)), [currentPathName]);
4842

4943
const filteredTabs = TABS.filter(({ isVisible }) => isVisible(policy));
5044

@@ -72,11 +66,7 @@ const Description: React.FC = () => {
7266

7367
const formatMarkdown = (markdown?: string) =>
7468
markdown ? (
75-
<ReactMarkdown>
76-
{typeof markdown === "string"
77-
? markdown.replace(/\n/g, " \n")
78-
: markdown}
79-
</ReactMarkdown>
69+
<ReactMarkdown>{typeof markdown === "string" ? markdown.replace(/\n/g, " \n") : markdown}</ReactMarkdown>
8070
) : (
8171
<p>Loading...</p>
8272
);

0 commit comments

Comments
 (0)