-
Notifications
You must be signed in to change notification settings - Fork 468
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into merge-v1.12.1
- Loading branch information
Showing
4 changed files
with
45 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package staker | ||
|
||
import ( | ||
"io" | ||
"testing" | ||
) | ||
|
||
func TestExecutionRevertedRegexp(t *testing.T) { | ||
executionRevertedErrors := []string{ | ||
// go-ethereum and most other execution clients return "execution reverted" | ||
"execution reverted", | ||
// execution clients may decode the EVM revert data as a string and include it in the error | ||
"execution reverted: FOO", | ||
// besu returns "Execution reverted" | ||
"Execution reverted", | ||
} | ||
for _, errString := range executionRevertedErrors { | ||
if !executionRevertedRegexp.MatchString(errString) { | ||
t.Fatalf("execution reverted regexp didn't match %q", errString) | ||
} | ||
} | ||
// This regexp should not match random IO errors | ||
if executionRevertedRegexp.MatchString(io.ErrUnexpectedEOF.Error()) { | ||
t.Fatal("execution reverted regexp matched unexpected EOF") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters