Skip to content

accounts/bind/v2: generate TryPack* methods #31692

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

mask-pp
Copy link
Contributor

@mask-pp mask-pp commented Apr 22, 2025

  1. Fix the error return format.
    todo: bindtype needs more complex logic to fix it.
    if err != nil { return nil, err } if err == nil { return obj, nil }
  2. Return pointer type object to avoid copying the whole struct content.
  3. Give the panic decision to the user.
  4. Fix empty line at the end of function.

TODO: fix some related test cases.

@mask-pp
Copy link
Contributor Author

mask-pp commented Apr 22, 2025

@MariusVanDerWijden If these changes make sense, then I will fix the related test cases.

Copy link
Member

@MariusVanDerWijden MariusVanDerWijden left a comment

Choose a reason for hiding this comment

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

LGTM, I agree with @mask-pp that we shouldn't have panic'd on Pack, but this is a good workaround imo

@fjl fjl changed the title accounts/bind/v2: Some upgrades about abigen v2 accounts/bind/v2: generate TryPack* methods Apr 24, 2025
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.

4 participants