@@ -7,6 +7,7 @@ import { useLocalStorage } from "react-use";
77import { encodePacked , keccak256 , PrivateKeyAccount } from "viem" ;
88import { useWalletClient , usePublicClient , useConfig } from "wagmi" ;
99
10+ import { Answer } from "@kleros/kleros-sdk" ;
1011import { Button } from "@kleros/ui-components-library" ;
1112
1213import { simulateDisputeKitClassicCastVote } from "hooks/contracts/generated" ;
@@ -17,11 +18,10 @@ import { wrapWithToast, catchShortMessage } from "utils/wrapWithToast";
1718
1819import { useDisputeDetailsQuery } from "queries/useDisputeDetailsQuery" ;
1920
21+ import { EnsureChain } from "components/EnsureChain" ;
2022import InfoCard from "components/InfoCard" ;
2123
2224import JustificationArea from "./JustificationArea" ;
23- import { Answer } from "@kleros/kleros-sdk" ;
24- import { EnsureChain } from "components/EnsureChain" ;
2525
2626const Container = styled . div `
2727 width: 100%;
@@ -145,7 +145,13 @@ const getSaltAndChoice = async (
145145 if ( isUndefined ( rawSalt ) ) return ;
146146 const salt = keccak256 ( rawSalt ) ;
147147
148- const { choice } = answers . reduce < { found : boolean ; choice : bigint } > (
148+ // when dispute is invalid, just add RFA to the answers array
149+ const candidates =
150+ answers ?. length > 0
151+ ? answers
152+ : [ { id : "0x0" , title : "Refuse To Arbitrate" , description : "Refuse To Arbitrate" } as Answer ] ;
153+
154+ const { choice } = candidates . reduce < { found : boolean ; choice : bigint } > (
149155 ( acc , answer ) => {
150156 if ( acc . found ) return acc ;
151157 const innerCommit = keccak256 ( encodePacked ( [ "uint256" , "uint256" ] , [ BigInt ( answer . id ) , BigInt ( salt ) ] ) ) ;
0 commit comments