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

accounts/abi: added new error type #23161

Merged
merged 3 commits into from Oct 14, 2021
Merged

Conversation

MariusVanDerWijden
Copy link
Member

closes: #23157

TODO:

  • Add unit tests
  • Add overloaded tests
  • Add logic that uses errors in a meaningful way (maybe follow-up)

Copy link
Member

@rjl493456442 rjl493456442 left a comment

Choose a reason for hiding this comment

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

Generally lgtm. But you should also fix the revert reason resolving part. Currently we hold the assumption that all the revert reason is encoded by the string format. But now it's possible to encode with the customized rules, so we need to generate the decode binding for users and also fix in the API.

accounts/abi/error.go Outdated Show resolved Hide resolved
accounts/abi/bind/bind_test.go Outdated Show resolved Hide resolved
@MariusVanDerWijden
Copy link
Member Author

@rjl493456442 I would like to merge this without the actual logic to unpack errors.
I'm currently working on that and it seems to have a pretty big impact on a lot of components (changes the interface of CallContract and CallPendingContract)

@connorwstein
Copy link
Contributor

@MariusVanDerWijden @rjl493456442 any updates here? It would be awesome to get this into 1.10.9

nkuba added a commit to keep-network/keep-core that referenced this pull request Oct 8, 2021
error is not yet supported by abigen: ethereum/go-ethereum#23161
abi.Events[name] = NewEvent(name, field.Name, field.Anonymous, field.Inputs)
case "error":
abi.Errors[field.Name] = NewError(field.Name, field.Inputs)
Copy link
Member

Choose a reason for hiding this comment

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

Does error type also support overloading? Should we also handle the overloading here?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, errors do not support overloading

@rjl493456442
Copy link
Member

Left one comment, otherwise lgtm for the first step to introduce builtin error type.

@fjl fjl merged commit 08e782c into ethereum:master Oct 14, 2021
@fjl fjl added this to the 1.10.10 milestone Oct 14, 2021
sidhujag pushed a commit to syscoin/go-ethereum that referenced this pull request Oct 14, 2021
This is the initial step for support of Solidity errors in contract bindings.
As of this change, errors can be decoded, but are not supported in
bindings yet.

Closes ethereum#23157
@MariusVanDerWijden MariusVanDerWijden deleted the abigen-error branch November 30, 2021 15:28
yongjun925 pushed a commit to DODOEX/go-ethereum that referenced this pull request Dec 3, 2022
This is the initial step for support of Solidity errors in contract bindings.
As of this change, errors can be decoded, but are not supported in
bindings yet.

Closes ethereum#23157
nibty pushed a commit to FairCrypto/go-ethereum that referenced this pull request Dec 15, 2023
This is the initial step for support of Solidity errors in contract bindings.
As of this change, errors can be decoded, but are not supported in
bindings yet.

Closes ethereum#23157
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.

abigen does not recognize error types
4 participants