From 3b003f6610a16d701100b6c7ab7af2d80f27ac10 Mon Sep 17 00:00:00 2001 From: danilo neves cruz Date: Thu, 12 Feb 2026 09:49:13 -0300 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9C=85=20server:=20wait=20for=20expected?= =?UTF-8?q?=20transfers=20instead=20of=20receipt=20count?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/clear-donkeys-grow.md | 2 ++ server/test/hooks/block.test.ts | 26 ++++++++++++-------------- 2 files changed, 14 insertions(+), 14 deletions(-) create mode 100644 .changeset/clear-donkeys-grow.md diff --git a/.changeset/clear-donkeys-grow.md b/.changeset/clear-donkeys-grow.md new file mode 100644 index 000000000..a845151cc --- /dev/null +++ b/.changeset/clear-donkeys-grow.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/server/test/hooks/block.test.ts b/server/test/hooks/block.test.ts index a810ee8d2..8ab41f0d1 100644 --- a/server/test/hooks/block.test.ts +++ b/server/test/hooks/block.test.ts @@ -904,6 +904,16 @@ describe("proposal", () => { const waitForTransactionReceipt = vi.spyOn(publicClient, "waitForTransactionReceipt"); const initialSettledResults = waitForTransactionReceipt.mock.settledResults.length; + const expected = [ + { + receiver: getAddress(decodeAbiParameters([{ name: "receiver", type: "address" }], withdraw.args.data)[0]), + amount: withdraw.args.amount, + }, + { + receiver: getAddress(decodeAbiParameters([{ name: "receiver", type: "address" }], idle.args.data)[0]), + amount: idle.args.amount, + }, + ]; await Promise.all([ appClient.index.$post({ @@ -926,23 +936,11 @@ describe("proposal", () => { }, }), vi.waitUntil( - () => waitForTransactionReceipt.mock.settledResults.filter(({ type }) => type !== "incomplete").length >= 5, + () => hasTransfers(waitForTransactionReceipt.mock.settledResults, initialSettledResults, expected), 26_666, ), ]); - - expect( - hasTransfers(waitForTransactionReceipt.mock.settledResults, initialSettledResults, [ - { - receiver: getAddress(decodeAbiParameters([{ name: "receiver", type: "address" }], withdraw.args.data)[0]), - amount: withdraw.args.amount, - }, - { - receiver: getAddress(decodeAbiParameters([{ name: "receiver", type: "address" }], idle.args.data)[0]), - amount: idle.args.amount, - }, - ]), - ).toBe(true); + expect(hasTransfers(waitForTransactionReceipt.mock.settledResults, initialSettledResults, expected)).toBe(true); expect(captureException).toHaveBeenCalledWith( expect.objectContaining({ name: "ContractFunctionExecutionError", functionName: "executeProposal" }), expect.objectContaining({ level: "error", fingerprint: ["{{ default }}", "NotNext"] }), From 35705b17ecdeb00ed064c15a8972349bd9bcaeb9 Mon Sep 17 00:00:00 2001 From: danilo neves cruz Date: Thu, 12 Feb 2026 10:17:30 -0300 Subject: [PATCH 2/2] =?UTF-8?q?=E2=9C=85=20server:=20consolidate=20withdra?= =?UTF-8?q?w=20decoding=20in=20block=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/test/hooks/block.test.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/server/test/hooks/block.test.ts b/server/test/hooks/block.test.ts index 8ab41f0d1..6c956ceb4 100644 --- a/server/test/hooks/block.test.ts +++ b/server/test/hooks/block.test.ts @@ -10,7 +10,6 @@ import { ContractFunctionExecutionError, ContractFunctionRevertedError, createWalletClient, - decodeAbiParameters, decodeEventLog, encodeAbiParameters, encodeErrorResult, @@ -44,7 +43,7 @@ import chain, { proposalManagerAbi, upgradeableModularAccountAbi, } from "@exactly/common/generated/chain"; -import ProposalType from "@exactly/common/ProposalType"; +import ProposalType, { decodeWithdraw } from "@exactly/common/ProposalType"; import deploy from "@exactly/plugin/deploy.json"; import app from "../../hooks/block"; @@ -104,13 +103,11 @@ describe("proposal", () => { const initialSettledResults = waitForTransactionReceipt.mock.settledResults.length; const expected = [ { - receiver: getAddress(decodeAbiParameters([{ name: "receiver", type: "address" }], withdraw.args.data)[0]), + receiver: getAddress(decodeWithdraw(withdraw.args.data)), amount: withdraw.args.amount, }, { - receiver: getAddress( - decodeAbiParameters([{ name: "receiver", type: "address" }], anotherWithdraw.args.data)[0], - ), + receiver: getAddress(decodeWithdraw(anotherWithdraw.args.data)), amount: anotherWithdraw.args.amount, }, ]; @@ -906,11 +903,11 @@ describe("proposal", () => { const initialSettledResults = waitForTransactionReceipt.mock.settledResults.length; const expected = [ { - receiver: getAddress(decodeAbiParameters([{ name: "receiver", type: "address" }], withdraw.args.data)[0]), + receiver: getAddress(decodeWithdraw(withdraw.args.data)), amount: withdraw.args.amount, }, { - receiver: getAddress(decodeAbiParameters([{ name: "receiver", type: "address" }], idle.args.data)[0]), + receiver: getAddress(decodeWithdraw(idle.args.data)), amount: idle.args.amount, }, ];