From b6fb45dd799c1d71a2090a5b74cea99e02627cae Mon Sep 17 00:00:00 2001 From: danilo neves cruz Date: Wed, 1 Apr 2026 17:00:45 -0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20server:=20scope=20simulate-contract?= =?UTF-8?q?=20assertions=20by=20proposal=20nonce?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/loud-houses-create.md | 2 ++ server/test/hooks/block.test.ts | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 .changeset/loud-houses-create.md diff --git a/.changeset/loud-houses-create.md b/.changeset/loud-houses-create.md new file mode 100644 index 0000000000..a845151cc8 --- /dev/null +++ b/.changeset/loud-houses-create.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/server/test/hooks/block.test.ts b/server/test/hooks/block.test.ts index 2ef532e43f..d3fea3e878 100644 --- a/server/test/hooks/block.test.ts +++ b/server/test/hooks/block.test.ts @@ -462,7 +462,9 @@ describe("proposal", () => { typeof hint === "object" && "fingerprint" in hint && Array.isArray(hint.fingerprint) ? [hint.fingerprint] : [], ); - expect(simulateContract).not.toHaveBeenCalled(); + expect(simulateContract).not.toHaveBeenCalledWith( + expect.objectContaining({ functionName: "executeProposal", args: [proposal.args.nonce] }), + ); expect(captureExceptionFingerprints).toEqual([ ["{{ default }}", "execution reverted: proposal outer reason fallback"], ]); @@ -527,7 +529,9 @@ describe("proposal", () => { typeof hint === "object" && "fingerprint" in hint && Array.isArray(hint.fingerprint) ? [hint.fingerprint] : [], ); - expect(simulateContract).not.toHaveBeenCalled(); + expect(simulateContract).not.toHaveBeenCalledWith( + expect.objectContaining({ functionName: "executeProposal", args: [proposal.args.nonce] }), + ); expect(captureExceptionFingerprints).toEqual([["{{ default }}", "0x12345678"]]); expect(captureException).toHaveBeenCalledWith( expect.objectContaining({ name: "ContractFunctionExecutionError", functionName: "executeProposal" }), @@ -586,7 +590,9 @@ describe("proposal", () => { typeof hint === "object" && "fingerprint" in hint && Array.isArray(hint.fingerprint) ? [hint.fingerprint] : [], ); - expect(simulateContract).not.toHaveBeenCalled(); + expect(simulateContract).not.toHaveBeenCalledWith( + expect.objectContaining({ functionName: "executeProposal", args: [proposal.args.nonce] }), + ); expect(captureExceptionFingerprints).toEqual([["{{ default }}", "unknown"]]); expect(captureException).toHaveBeenCalledWith( expect.objectContaining({ name: "ContractFunctionExecutionError", functionName: "executeProposal" }), @@ -640,7 +646,9 @@ describe("proposal", () => { typeof hint === "object" && "fingerprint" in hint && Array.isArray(hint.fingerprint) ? [hint.fingerprint] : [], ); - expect(simulateContract).not.toHaveBeenCalled(); + expect(simulateContract).not.toHaveBeenCalledWith( + expect.objectContaining({ functionName: "executeProposal", args: [proposal.args.nonce] }), + ); expect(captureExceptionFingerprints).toEqual([["{{ default }}", "unknown"]]); expect(captureException).toHaveBeenCalledWith( expect.objectContaining({ message: "nonce reset failed" }),