Skip to content

Commit

Permalink
Merge pull request #55 from zama-ai/improvedError
Browse files Browse the repository at this point in the history
chore: improved error message
  • Loading branch information
jatZama authored Dec 14, 2024
2 parents 0573224 + 221b3d4 commit 68e3468
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/fhevmjsMocked.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,12 @@ export const reencryptRequestMocked = async (
const acl = await hre.ethers.getContractAt(aclArtifact.abi, ACL_ADDRESS);
const userAllowed = await acl.persistAllowed(handle, userAddress);
const contractAllowed = await acl.persistAllowed(handle, contractAddress);
const isAllowed = userAllowed && contractAllowed;
if (!isAllowed) {
if (!userAllowed) {
throw new Error("User is not authorized to reencrypt this handle!");
}
if (!contractAllowed) {
throw new Error("dApp contract is not authorized to reencrypt this handle!");
}
if (userAddress === contractAddress) {
throw new Error("userAddress should not be equal to contractAddress when requesting reencryption!");
}
Expand Down

0 comments on commit 68e3468

Please sign in to comment.