diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ec1253c..b5a9e47 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -22,7 +22,7 @@ jobs: run: echo "VITE_APP_BASE_URL=/zama_bounty/" >> $GITHUB_ENV - name: Install dependencies - run: npm ci --only=production + run: npm ci - name: Build project run: npm run build diff --git a/src/components/Gallery/Gallery.tsx b/src/components/Gallery/Gallery.tsx index a12429d..9c67ca1 100644 --- a/src/components/Gallery/Gallery.tsx +++ b/src/components/Gallery/Gallery.tsx @@ -180,12 +180,6 @@ export const Gallery = () => { const encryptedFile = await getEncryptedFileCidHash(cidHash); if (!encryptedFile) throw new Error("Dencrypting data failed."); - console.log("cid: ", cidHash); - console.log("Encrypted FIle: ", encryptedFile); - - // const encryptedKeys = deserializeEncryptedKeyParts(encryptedFile.encryptedFileKey); - - const reEncryptedFileKey = await contract.reencrypt(tokenId, publicKey, signature); const decryptedKey: bigint[] = []; diff --git a/src/components/Mint/Mint.tsx b/src/components/Mint/Mint.tsx index 99883c7..41d972f 100644 --- a/src/components/Mint/Mint.tsx +++ b/src/components/Mint/Mint.tsx @@ -47,9 +47,7 @@ export const Mint = () => { const encryptedFileKey = await fileKeyEncryption(fileKey); - const encryptedFile = { ...ciphFile, encryptedFileKey }; - - const cidHash = await uploadFileToIPFS(encryptedFile); + const cidHash = await uploadFileToIPFS(ciphFile); toast.info("Your file is currently being minted as an NFT. This may take a few moments."); diff --git a/src/components/Utils/utils.ts b/src/components/Utils/utils.ts index f7ecc21..9e60cc7 100644 --- a/src/components/Utils/utils.ts +++ b/src/components/Utils/utils.ts @@ -15,9 +15,9 @@ export interface CiphFile { }; } -export interface EncryptedFile extends CiphFile { - encryptedFileKey: Uint8Array[]; // Array of Uint8Array, each representing a key segment resulting from instance.encrypt64 -} +// export interface EncryptedFile extends CiphFile { +// encryptedFileKey: Uint8Array[]; // Array of Uint8Array, each representing a key segment resulting from instance.encrypt64 +// } export interface DecryptedFileMetaData { file: File; @@ -121,7 +121,7 @@ export async function decryptFile(ciphFile: CiphFile, key: CryptoKey): Promise => { +export const uploadFileToIPFS = async (encryptedFile: CiphFile): Promise => { const pinataJWT = import.meta.env.VITE_PINATA_JWT as string; const PINATA_API_URL = "https://api.pinata.cloud/pinning/pinFileToIPFS"; const LOCAL_IPFS_URL = (import.meta.env.VITE_LOCAL_IPFS_URL || 'http://localhost:5001') as string; @@ -187,7 +187,7 @@ export const uploadFileToIPFS = async (encryptedFile: EncryptedFile): Promise { +export async function getEncryptedFileCidHash(cidHash: string): Promise { try { const response = await fetch(cidHash, { @@ -201,7 +201,7 @@ export async function getEncryptedFileCidHash(cidHash: string): Promise