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

Enhancements to ABI for Struct Generation #7

Merged
merged 3 commits into from
Jul 1, 2023
Merged

Conversation

0x19
Copy link
Contributor

@0x19 0x19 commented Jul 1, 2023

This PR introduces several enhancements to the ABI related to the generation of structs. The main changes include:

  • Struct Definition Entry and Exit: Two new functions, EnterStructDefinition and ExitStructDefinition, have been added. These functions are triggered when the parser enters and exits a struct definition, respectively. EnterStructDefinition appends a new struct to the ABI, while ExitStructDefinition prepares the struct for component resolution.
  • Struct Appending: The AppendStruct function has been introduced. This function is called within EnterStructDefinition and is responsible for appending a new struct to the ABI.
  • Struct Resolution: A new function, ResolveStructComponents, has been added. This function is called within ExitStructDefinition and is responsible for resolving the components of a struct, including handling nested structs and forward declarations.
  • Struct Existence Check: A new function, isStructType, has been added. This function checks if a given type name corresponds to a defined struct. This helps in ensuring that only valid structs are processed further.

These changes aim to improve the robustness and clarity of the ABI generation process, particularly in relation to struct handling. Feedback and suggestions for further improvements are welcome.

@0x19 0x19 added documentation Improvements or additions to documentation enhancement New feature or request abi Application Binary Interface labels Jul 1, 2023
@0x19 0x19 self-assigned this Jul 1, 2023
@0x19 0x19 linked an issue Jul 1, 2023 that may be closed by this pull request
@coveralls
Copy link

coveralls commented Jul 1, 2023

Pull Request Test Coverage Report for Build 5430741003

  • 73 of 131 (55.73%) changed or added relevant lines in 3 files are covered.
  • 42 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-10.7%) to 63.276%

Changes Missing Coverage Covered Lines Changed/Added Lines %
abi_listener.go 11 21 52.38%
abi_parser.go 58 106 54.72%
Files with Coverage Reduction New Missed Lines %
abi_listener.go 6 32.0%
abi_parser.go 36 62.22%
Totals Coverage Status
Change from base Build 5427608906: -10.7%
Covered Lines: 367
Relevant Lines: 580

💛 - Coveralls

@0x19 0x19 changed the title ABI Complex Types Support Enhancements to ABI for Struct Generation Jul 1, 2023
@0x19 0x19 merged commit c5eb61e into main Jul 1, 2023
@0x19 0x19 deleted the 6-complex-abi-types branch July 1, 2023 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
abi Application Binary Interface documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce complex types ABI parsing for methods and variables
2 participants