Skip to content

Commit 62d5723

Browse files
authored
Merge pull request #2134 from kleros/fix/invalid-dispute-vote-reveal
fix(web): invalid-dispute-vote-reveal
2 parents 36a2455 + 6bea072 commit 62d5723

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

web/src/pages/Cases/CaseDetails/Voting/Classic/Reveal.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,13 @@ const getSaltAndChoice = async (
149149
if (isUndefined(rawSalt)) return;
150150
const salt = keccak256(rawSalt);
151151

152-
const { choice } = answers.reduce<{ found: boolean; choice: bigint }>(
152+
// when dispute is invalid, just add RFA to the answers array
153+
const candidates =
154+
answers?.length > 0
155+
? answers
156+
: [{ id: "0x0", title: "Refuse To Arbitrate", description: "Refuse To Arbitrate" } as Answer];
157+
158+
const { choice } = candidates.reduce<{ found: boolean; choice: bigint }>(
153159
(acc, answer) => {
154160
if (acc.found) return acc;
155161
const innerCommit = keccak256(encodePacked(["uint256", "uint256"], [BigInt(answer.id), BigInt(salt)]));

web/wagmi.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dotenv.config();
1818

1919
const readArtifacts = async (type: ArbitratorTypes, viemChainName: string, hardhatChainName?: string) => {
2020
const artifactSuffix =
21-
type === ArbitratorTypes.vanilla
21+
type === ArbitratorTypes.vanilla || type === ArbitratorTypes.neo
2222
? ""
2323
: ArbitratorTypes[type].toString().charAt(0).toUpperCase() + ArbitratorTypes[type].toString().slice(1);
2424
const vanillaArtifacts = [
@@ -59,7 +59,7 @@ const readArtifacts = async (type: ArbitratorTypes, viemChainName: string, hardh
5959
// console.debug(`Skipping ${name} for deployment type ${ArbitratorTypes[type]}`);
6060
continue;
6161
}
62-
if (type !== ArbitratorTypes.vanilla) {
62+
if (type === ArbitratorTypes.university) {
6363
nameWithoutSuffix = name.slice(0, -artifactSuffix.length);
6464
// console.debug(`Using ${nameWithoutSuffix} instead of ${name}`);
6565
}

0 commit comments

Comments
 (0)