Skip to content

Commit df2b3d9

Browse files
committed
fix: arbitrable chainid passed as context, updated multiaddr check
1 parent f31bff3 commit df2b3d9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

kleros-sdk/src/dataMappings/utils/disputeDetailsSchema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { normalize } from "viem/ens";
55
const isHexAddress = (str: string): boolean => /^0x[a-fA-F0-9]{40}$/.test(str);
66
const isHexId = (str: string): boolean => /^0x[a-fA-F0-9]{1,64}$/.test(str);
77
const isMultiaddr = (str: string): boolean =>
8-
/^\/(?:ip4|ip6|dns4|dns6|dnsaddr|tcp|udp|utp|tls|ws|wss|ipfs|p2p-circuit|p2p-webrtc-star|p2p-webrtc-direct|p2p-websocket-star|onion)(\/[^\s\/]+)*$/.test(
8+
/^\/(?:ip4|ip6|dns4|dns6|dnsaddr|tcp|udp|utp|tls|ws|wss|p2p-circuit|p2p-webrtc-star|p2p-webrtc-direct|p2p-websocket-star|onion|ipfs)(\/[^\s\/]+)+$|^ipfs:\/\/[a-zA-Z0-9]+\/[a-zA-Z0-9]+(\.[a-zA-Z0-9]+)?$/.test(
99
str
1010
);
1111

web/src/hooks/queries/usePopulatedDisputeData.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { iArbitrableV2Abi } from "hooks/contracts/generated";
1212
import { useEvidenceGroup } from "queries/useEvidenceGroup";
1313
import { debounceErrorToast } from "utils/debounceErrorToast";
1414
import { isUndefined } from "utils/index";
15+
import { DEFAULT_CHAIN } from "consts/chains";
1516

1617
import { graphql } from "src/graphql";
1718

@@ -47,7 +48,6 @@ export const usePopulatedDisputeData = (disputeID?: string, arbitrableAddress?:
4748
if (isEnabled && !isError) {
4849
try {
4950
const { isCrossChainDispute, crossChainTemplateId } = crossChainData;
50-
console.log({ crossChainData }); //crosschaindata's chainId is 0 here 🤔
5151

5252
const templateId = isCrossChainDispute
5353
? crossChainTemplateId
@@ -66,7 +66,7 @@ export const usePopulatedDisputeData = (disputeID?: string, arbitrableAddress?:
6666
const initialContext = {
6767
disputeID: disputeID,
6868
arbitrableAddress: arbitrableAddress,
69-
arbitrableChainID: "whereDoWeGetThisValueFrom?",
69+
arbitrableChainID: isCrossChainDispute ? crossChainData.crossChainId.toString() : DEFAULT_CHAIN.toString(),
7070
graphApiKey: import.meta.env.REACT_APP_GRAPH_API_KEY,
7171
externalDisputeID: externalDisputeID,
7272
};

0 commit comments

Comments
 (0)