From 8b7ca91ed0182b3160f296d71213e1d3fcb9356f Mon Sep 17 00:00:00 2001 From: tawadaa <10723626+tawadaa@users.noreply.github.com> Date: Mon, 9 Mar 2026 19:06:21 +0100 Subject: [PATCH 1/3] fix(test-suite): fix delegated decrypt assertion --- .../delegatedUserDecryption.ts | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/test-suite/e2e/test/delegatedUserDecryption/delegatedUserDecryption.ts b/test-suite/e2e/test/delegatedUserDecryption/delegatedUserDecryption.ts index 6481174a02..5c91a1e19f 100644 --- a/test-suite/e2e/test/delegatedUserDecryption/delegatedUserDecryption.ts +++ b/test-suite/e2e/test/delegatedUserDecryption/delegatedUserDecryption.ts @@ -58,9 +58,9 @@ describe('Delegated user decryption', function () { ); await delegateTx.wait(); - // Wait for 15 blocks to ensure delegation is propagated by the coprocessor. + // Wait for 2 blocks to ensure delegation is propagated by the coprocessor. const currentBlock = await ethers.provider.getBlockNumber(); - await waitForBlock(currentBlock + 15); + await waitForBlock(currentBlock + 2); // Get the encrypted balance handle of the smartWallet. const balanceHandle = await this.token.balanceOf(this.smartWalletAddress); @@ -95,9 +95,9 @@ describe('Delegated user decryption', function () { ); await delegateTx.wait(); - // Wait for 15 blocks to ensure delegation is propagated by the coprocessor. + // Wait for 2 blocks to ensure delegation is propagated by the coprocessor. const currentBlock = await ethers.provider.getBlockNumber(); - await waitForBlock(currentBlock + 15); + await waitForBlock(currentBlock + 2); // Get the encrypted balance handle of the smartWallet. const balanceHandle = await this.token.balanceOf(this.smartWalletAddress); @@ -132,9 +132,9 @@ describe('Delegated user decryption', function () { ); await delegateTx.wait(); - // Wait for 15 blocks to ensure delegation is propagated by the coprocessor. + // Wait for 2 blocks to ensure delegation is propagated by the coprocessor. let currentBlock = await ethers.provider.getBlockNumber(); - await waitForBlock(currentBlock + 15); + await waitForBlock(currentBlock + 2); // Get the current smartWallet balance before transfer const smartWalletBalanceBefore = await this.token.balanceOf(this.smartWalletAddress); @@ -212,9 +212,9 @@ describe('Delegated user decryption', function () { ); await delegateTx.wait(); - // Wait for 15 blocks to ensure delegation is propagated by the coprocessor. + // Wait for 2 blocks to ensure delegation is propagated by the coprocessor. const currentBlock1 = await ethers.provider.getBlockNumber(); - await waitForBlock(currentBlock1 + 15); + await waitForBlock(currentBlock1 + 2); // Revoke the delegation for Bob's EOA. const revokeTx = await this.smartWallet @@ -225,9 +225,9 @@ describe('Delegated user decryption', function () { ); await revokeTx.wait(); - // Wait for 15 blocks to ensure revocation is propagated by the coprocessor. + // Wait for 2 blocks to ensure revocation is propagated by the coprocessor. const currentBlock2 = await ethers.provider.getBlockNumber(); - await waitForBlock(currentBlock2 + 15); + await waitForBlock(currentBlock2 + 2); // Try to decrypt the smartWallet balance with Bob's EOA, which should now fail. const balanceHandle = await this.token.balanceOf(this.smartWalletAddress); @@ -243,9 +243,7 @@ describe('Delegated user decryption', function () { this.signers.bob, privateKey, publicKey, - ) - ).to.be.rejectedWith( - new RegExp(USER_DECRYPTION_NOT_DELEGATED_SELECTOR), - ); + ), + ).to.be.rejectedWith('Execution reverted'); }); }); From ab6d3c1821ac863c85e930ddfc5cc980fae3388b Mon Sep 17 00:00:00 2001 From: tawadaa <10723626+tawadaa@users.noreply.github.com> Date: Tue, 10 Mar 2026 09:55:56 +0100 Subject: [PATCH 2/3] fix(test-suite): cleanup const --- .../e2e/test/delegatedUserDecryption/delegatedUserDecryption.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/test-suite/e2e/test/delegatedUserDecryption/delegatedUserDecryption.ts b/test-suite/e2e/test/delegatedUserDecryption/delegatedUserDecryption.ts index 5c91a1e19f..69975265a0 100644 --- a/test-suite/e2e/test/delegatedUserDecryption/delegatedUserDecryption.ts +++ b/test-suite/e2e/test/delegatedUserDecryption/delegatedUserDecryption.ts @@ -5,8 +5,6 @@ import { createInstances } from '../instance'; import { getSigners, initSigners } from '../signers'; import { delegatedUserDecryptSingleHandle, waitForBlock } from '../utils'; -const USER_DECRYPTION_NOT_DELEGATED_SELECTOR = '0x0190c506'; - describe('Delegated user decryption', function () { before(async function () { await initSigners(3); From 297f1157fef8478d065cfaf472f672382aad3832 Mon Sep 17 00:00:00 2001 From: tawadaa <10723626+tawadaa@users.noreply.github.com> Date: Wed, 11 Mar 2026 14:49:53 +0100 Subject: [PATCH 3/3] fix(test-suite): update timeout for delegatedUserDecryption --- .../delegatedUserDecryption.ts | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/test-suite/e2e/test/delegatedUserDecryption/delegatedUserDecryption.ts b/test-suite/e2e/test/delegatedUserDecryption/delegatedUserDecryption.ts index 69975265a0..83d78b290d 100644 --- a/test-suite/e2e/test/delegatedUserDecryption/delegatedUserDecryption.ts +++ b/test-suite/e2e/test/delegatedUserDecryption/delegatedUserDecryption.ts @@ -6,6 +6,8 @@ import { getSigners, initSigners } from '../signers'; import { delegatedUserDecryptSingleHandle, waitForBlock } from '../utils'; describe('Delegated user decryption', function () { + this.timeout(600000); + before(async function () { await initSigners(3); this.signers = await getSigners(); @@ -56,9 +58,9 @@ describe('Delegated user decryption', function () { ); await delegateTx.wait(); - // Wait for 2 blocks to ensure delegation is propagated by the coprocessor. + // Wait for 15 blocks to ensure delegation is propagated by the coprocessor. const currentBlock = await ethers.provider.getBlockNumber(); - await waitForBlock(currentBlock + 2); + await waitForBlock(currentBlock + 15); // Get the encrypted balance handle of the smartWallet. const balanceHandle = await this.token.balanceOf(this.smartWalletAddress); @@ -93,9 +95,9 @@ describe('Delegated user decryption', function () { ); await delegateTx.wait(); - // Wait for 2 blocks to ensure delegation is propagated by the coprocessor. + // Wait for 15 blocks to ensure delegation is propagated by the coprocessor. const currentBlock = await ethers.provider.getBlockNumber(); - await waitForBlock(currentBlock + 2); + await waitForBlock(currentBlock + 15); // Get the encrypted balance handle of the smartWallet. const balanceHandle = await this.token.balanceOf(this.smartWalletAddress); @@ -130,9 +132,9 @@ describe('Delegated user decryption', function () { ); await delegateTx.wait(); - // Wait for 2 blocks to ensure delegation is propagated by the coprocessor. + // Wait for 15 blocks to ensure delegation is propagated by the coprocessor. let currentBlock = await ethers.provider.getBlockNumber(); - await waitForBlock(currentBlock + 2); + await waitForBlock(currentBlock + 15); // Get the current smartWallet balance before transfer const smartWalletBalanceBefore = await this.token.balanceOf(this.smartWalletAddress); @@ -210,9 +212,9 @@ describe('Delegated user decryption', function () { ); await delegateTx.wait(); - // Wait for 2 blocks to ensure delegation is propagated by the coprocessor. + // Wait for 15 blocks to ensure delegation is propagated by the coprocessor. const currentBlock1 = await ethers.provider.getBlockNumber(); - await waitForBlock(currentBlock1 + 2); + await waitForBlock(currentBlock1 + 15); // Revoke the delegation for Bob's EOA. const revokeTx = await this.smartWallet @@ -223,9 +225,9 @@ describe('Delegated user decryption', function () { ); await revokeTx.wait(); - // Wait for 2 blocks to ensure revocation is propagated by the coprocessor. + // Wait for 15 blocks to ensure revocation is propagated by the coprocessor. const currentBlock2 = await ethers.provider.getBlockNumber(); - await waitForBlock(currentBlock2 + 2); + await waitForBlock(currentBlock2 + 15); // Try to decrypt the smartWallet balance with Bob's EOA, which should now fail. const balanceHandle = await this.token.balanceOf(this.smartWalletAddress);