Skip to content

Commit 729777d

Browse files
committed
feat: postinstall script, use correct commit function
1 parent 05711fe commit 729777d

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

web/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
"check-types": "tsc --noEmit",
4444
"generate": "yarn generate:gql && yarn generate:hooks",
4545
"generate:gql": "graphql-codegen --require tsconfig-paths/register",
46-
"generate:hooks": "NODE_NO_WARNINGS=1 wagmi generate"
46+
"generate:hooks": "NODE_NO_WARNINGS=1 wagmi generate",
47+
"postinstall": "mkdir -p src/public/node_modules/@shutter-network/shutter-sdk/dist && cp -R ../node_modules/@shutter-network/shutter-sdk/dist/* src/public/node_modules/@shutter-network/shutter-sdk/dist"
4748
},
4849
"prettier": "@kleros/kleros-v2-prettier-config",
4950
"devDependencies": {

web/src/pages/Cases/CaseDetails/Voting/Shutter/Commit.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { useLocalStorage } from "react-use";
55
import { keccak256, encodePacked } from "viem";
66
import { useWalletClient, usePublicClient, useConfig } from "wagmi";
77

8-
import { simulateDisputeKitShutterCastCommit } from "hooks/contracts/generated";
8+
import { simulateDisputeKitShutterCastCommitShutter } from "hooks/contracts/generated";
99
import useSigningAccount from "hooks/useSigningAccount";
1010
import { isUndefined } from "utils/index";
1111
import { wrapWithToast } from "utils/wrapWithToast";
@@ -24,7 +24,7 @@ interface ICommit {
2424
refetch: () => void;
2525
}
2626

27-
const SEPARATOR = "";
27+
const SEPARATOR = "-";
2828

2929
const Commit: React.FC<ICommit> = ({ arbitrable, voteIDs, setIsOpen, refetch }) => {
3030
const { id } = useParams();
@@ -59,7 +59,7 @@ const Commit: React.FC<ICommit> = ({ arbitrable, voteIDs, setIsOpen, refetch })
5959
encodePacked(["uint256", "uint256", "string"], [choice, BigInt(salt), justification])
6060
);
6161

62-
const { request } = await simulateDisputeKitShutterCastCommit(wagmiConfig, {
62+
const { request } = await simulateDisputeKitShutterCastCommitShutter(wagmiConfig, {
6363
args: [parsedDisputeID, parsedVoteIDs, commitHash, identity as `0x${string}`, encryptedCommitment],
6464
});
6565
if (walletClient && publicClient) {

web/src/utils/shutter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { encryptData, decrypt as shutterDecrypt } from "@shutter-network/shutter
22
import { stringToHex, hexToString, Hex } from "viem";
33

44
// Time in seconds to wait before the message can be decrypted
5-
export const DECRYPTION_DELAY = 5;
5+
export const DECRYPTION_DELAY = 120;
66

77
interface ShutterApiMessageData {
88
eon: number;
@@ -145,7 +145,7 @@ function ensureHexString(hexString: string | undefined): `0x${string}` {
145145
*/
146146
function generateRandomBytes32(): `0x${string}` {
147147
return ("0x" +
148-
window.crypto
148+
crypto
149149
.getRandomValues(new Uint8Array(32))
150150
.reduce((acc, byte) => acc + byte.toString(16).padStart(2, "0"), "")) as Hex;
151151
}

0 commit comments

Comments
 (0)