From 1dd74d57e606bf48b71ea06e807ec13469650f5d Mon Sep 17 00:00:00 2001 From: Joshua Date: Thu, 19 Feb 2026 13:56:08 -0800 Subject: [PATCH] Make control-plane smoke resilient to tx pending/revert --- scripts/e2e-control-plane-flow.cjs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/scripts/e2e-control-plane-flow.cjs b/scripts/e2e-control-plane-flow.cjs index 61be4ac..eff251d 100644 --- a/scripts/e2e-control-plane-flow.cjs +++ b/scripts/e2e-control-plane-flow.cjs @@ -7,6 +7,7 @@ const CHAIN_ID = Number((process.env.SECRET_API_CHAIN_ID || "84532").trim()); const PRIVATE_KEY = (process.env.DEPLOYER_PRIVATE_KEY || "").trim(); const RPC_URL = (process.env.BASE_SEPOLIA_RPC_URL || "").trim(); const GAS_PRICE_WEI = (process.env.E2E_GAS_PRICE_WEI || "").trim(); +const GAS_LIMIT = (process.env.E2E_GAS_LIMIT || "500000").trim(); const OFFER_ID = (process.env.E2E_OFFER_ID || "edut.workspace.core").trim(); const ORG_ROOT_ID = (process.env.E2E_ORG_ROOT_ID || "org.e2e.workspace").trim(); @@ -71,6 +72,9 @@ async function submitTransaction(signer, txLike) { data: txLike.data, value: ethers.BigNumber.from(txLike.value || "0x0"), }; + if (GAS_LIMIT && GAS_LIMIT !== "0") { + txRequest.gasLimit = ethers.BigNumber.from(GAS_LIMIT); + } if (GAS_PRICE_WEI) { txRequest.gasPrice = ethers.BigNumber.from(GAS_PRICE_WEI); } @@ -93,6 +97,12 @@ function isInsufficientFundsError(err) { return text.includes("insufficient funds"); } +function isTxRevertError(err) { + const code = String(err?.code || "").toUpperCase(); + const text = String(err?.message || err || "").toLowerCase(); + return code === "CALL_EXCEPTION" || text.includes("transaction failed"); +} + function isTxPendingResponse(result) { if (!result || result.ok) { return false; @@ -188,6 +198,12 @@ async function main() { 0, String(err?.message || err) ); + } else if (isTxRevertError(err)) { + result.stages.membership_activation = summarizeSkip( + "tx_reverted", + 0, + String(err?.message || err) + ); } else { throw err; } @@ -295,6 +311,12 @@ async function main() { 0, String(err?.message || err) ); + } else if (isTxRevertError(err)) { + result.stages.marketplace_checkout = summarizeSkip( + "tx_reverted", + 0, + String(err?.message || err) + ); } else { throw err; }