Skip to content

Commit

Permalink
fix: extract revert reason for new lotus
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Nov 7, 2024
1 parent 75b48ec commit 0a55b8b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions test/UniswapV3Pool.swaps.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 0a55b8b

Please sign in to comment.