From 0a55b8bae850bcaf1254789e1239716c73f6f020 Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Thu, 7 Nov 2024 18:12:00 +1100 Subject: [PATCH] fix: extract revert reason for new lotus Ref: https://github.com/filecoin-project/lotus/pull/12675 --- test/UniswapV3Pool.swaps.spec.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/UniswapV3Pool.swaps.spec.ts b/test/UniswapV3Pool.swaps.spec.ts index a20281c..1dec403 100644 --- a/test/UniswapV3Pool.swaps.spec.ts +++ b/test/UniswapV3Pool.swaps.spec.ts @@ -513,10 +513,8 @@ describe('UniswapV3Pool swap tests', () => { try { await (await tx).wait() } catch (error) { - // extract reason - const match = /revert reason: Error\(([^)]+)\),/g.exec(error.message) || [null, null] + const match = /\[Error\(([^)]+)\)\]/g.exec(error) || [null, null] const vmError = `VM Exception while processing transaction: revert ${match[1]}` - expect({ swapError: vmError, poolBalance0: poolBalance0.toString(),