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

abigen: create output type for structured contract functions #30578

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joey1123455
Copy link

@joey1123455 joey1123455 commented Oct 12, 2024

Enhance abigen to Generate Output Types for Contract Functions

Description

Issue #29689

Current limitations:

  • It does not create separate output types for contract functions
  • This makes it challenging to use the generated bindings in a generic way across different projects

Proposed enhancements:

  1. Generate dedicated structs for each function's return type
  2. Export these structs in the generated package

Example before:

func SomeFunction() (struct{ Field1 int, Field2 string }, error)

Example after:

type SomeFunctionOutput struct {
    Field1 int
    Field2 string
}

func SomeFunction() (SomeFunctionOutput, error)

@joey1123455
Copy link
Author

@gballet hello, I'm waiting on a review for this pull request

@joey1123455
Copy link
Author

@MariusVanDerWijden hello, could you please review my pull request

@fjl
Copy link
Contributor

fjl commented Nov 21, 2024

We will not modify abigen v1 anymore because v2 will be added soon. We will apply this change on abigen v2 when it is ready. The PR can remain open until then.

@fjl fjl removed the status:triage label Nov 21, 2024
@joey1123455
Copy link
Author

Alright are there any other contributions needed for V2 @fjl so I can pitch in?

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