Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add utility for parsing errors, including as a string #82

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

peterbroadhurst
Copy link
Contributor

A helpful utility for custom errors, to let you send revertData to the function, and get back a string like:

ExampleError("test1","12345")

or for default revert("some string")

Error("some string")

Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
pkg/abi/abi.go Show resolved Hide resolved
pkg/abi/abi.go Show resolved Hide resolved
@@ -1027,3 +1027,48 @@ func TestComplexStructSolidityDef(t *testing.T) {
}, childStructs)

}

func TestErrorString(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might be missing a few test to cover all the error cases

Copy link
Contributor

@awrichar awrichar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

Copy link
Contributor

@EnriqueL8 EnriqueL8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - thanks Andrew for the replies

@EnriqueL8 EnriqueL8 merged commit 0b9dbf8 into main Oct 7, 2024
3 checks passed
@EnriqueL8 EnriqueL8 deleted the err-strings branch October 7, 2024 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants