Skip to content

Commit

Permalink
2️⃣ Fix Optimism revertedWith matcher 2 (#742)
Browse files Browse the repository at this point in the history
  • Loading branch information
yivlad committed Jun 7, 2022
1 parent 9b0e87c commit e631daf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/yellow-pugs-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ethereum-waffle/chai": patch
---

Fix Optimism revertedWith matcher 2
2 changes: 1 addition & 1 deletion waffle-chai/src/matchers/revertedWith.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const decodeOptimismError = (error: any) => {
const body = error?.body;
if (body) {
const errorString = JSON.parse(body)?.error?.message;
const regexp = /"execution reverted: (.*)"/g;
const regexp = /execution reverted: (.*)/g;
const matches = regexp.exec(errorString);
if (matches && matches.length >= 1) {
return matches[1];
Expand Down

0 comments on commit e631daf

Please sign in to comment.