From 9f5b54e6c5f900f2b69eb10a651f3a456f916835 Mon Sep 17 00:00:00 2001 From: aitbc Date: Wed, 29 Apr 2026 13:16:35 +0200 Subject: [PATCH] fix: use release time 0 to pass validation in EscrowService test - Contract requires _releaseTime == 0 or _releaseTime > block.timestamp - Using 3600 was less than block.timestamp, causing validation failure - Changed all createEscrow calls to use release time 0 (immediate release) --- contracts/test/EscrowService.test.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/contracts/test/EscrowService.test.js b/contracts/test/EscrowService.test.js index 7da2d987..9bd65149 100644 --- a/contracts/test/EscrowService.test.js +++ b/contracts/test/EscrowService.test.js @@ -90,7 +90,7 @@ describe("EscrowService", function () { ESCROW_AMOUNT, 0, // Standard escrow type 0, // Manual release condition - 3600, // 1 hour release time + 0, // Immediate release "Test escrow" ); const receipt = await tx.wait(); @@ -107,7 +107,7 @@ describe("EscrowService", function () { ESCROW_AMOUNT, 0, 0, - 3600, + 0, "Test escrow" ) ).to.emit(escrowService, "EscrowCreated"); @@ -121,7 +121,7 @@ describe("EscrowService", function () { ethers.parseEther("0.0001"), // Below minimum 0, 0, - 3600, + 0, "Test escrow" ) ).to.be.reverted; @@ -135,7 +135,7 @@ describe("EscrowService", function () { ethers.parseEther("20000"), // Above maximum 0, 0, - 3600, + 0, "Test escrow" ) ).to.be.reverted; @@ -152,7 +152,7 @@ describe("EscrowService", function () { ESCROW_AMOUNT, 0, 0, - 3600, + 0, "Test escrow" ); const receipt = await tx.wait(); @@ -188,7 +188,7 @@ describe("EscrowService", function () { ESCROW_AMOUNT, 0, 0, - 3600, + 0, "Test escrow" ); const receipt = await tx.wait(); @@ -241,7 +241,7 @@ describe("EscrowService", function () { ESCROW_AMOUNT, 0, 0, - 3600, + 0, "Test escrow" ); const receipt = await tx.wait(); @@ -308,7 +308,7 @@ describe("EscrowService", function () { ESCROW_AMOUNT, 0, 0, - 3600, + 0, "Test escrow" ); const receipt = await tx.wait();