Skip to content

Commit

Permalink
Merge pull request #136 from zama-ai/bump-version
Browse files Browse the repository at this point in the history
Bump version and add log
  • Loading branch information
immortal-tofu authored Nov 18, 2024
2 parents a223bd9 + 160d21d commit 8300efd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fhevmjs",
"version": "0.6.0-8",
"version": "0.6.0-9",
"description": "fhEVM SDK for blockchain using TFHE",
"main": "lib/node.js",
"types": "lib/node/node.d.ts",
Expand Down
9 changes: 8 additions & 1 deletion src/sdk/reencrypt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ export const reencryptRequest =
throw new Error("Gateway didn't response correctly");
}

if (json.status === 'failure') {
throw new Error("The reencryption didn't succeed");
}

const client = new_client(kmsSignatures, userAddress, 'default');

try {
Expand All @@ -88,7 +92,10 @@ export const reencryptRequest =
// Duplicate payloadForRequest and replace ciphertext_handle with ciphertext_digest.
const { ciphertext_handle, ...p } = payloadForRequest;
// TODO check all ciphertext digests are all the same
const payloadForVerification = { ...p, ciphertext_digest: json.response[0].ciphertext_digest };
const payloadForVerification = {
...p,
ciphertext_digest: json.response[0].ciphertext_digest,
};

const decryption = process_reencryption_resp_from_js(
client,
Expand Down

0 comments on commit 8300efd

Please sign in to comment.