Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump version and add log #136

Merged
merged 2 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading