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 new type parse from string #114

Merged
merged 2 commits into from
Dec 6, 2023
Merged

Add new type parse from string #114

merged 2 commits into from
Dec 6, 2023

Conversation

ferranbt
Copy link
Collaborator

@ferranbt ferranbt commented Nov 30, 2023

📝 Summary

This PR adds a new function NewTypeFromString that takes a string representation of an ABI tuple, parses it, and returns an abi.Type object.

This is the initial step to implement the human-readable ABI format introduced by ethers.js

Before, we had to generate a JSON ABI type, create a dummy ABI, and decode the input type from there. Now, we just have to write the type in string format, for example:

abi.NewTypeFromString("tuple(a uint64, tuple(b uint64))")

📚 References


  • I have seen and agree to CONTRIBUTING.md

@ferranbt ferranbt merged commit b4d0ec6 into main Dec 6, 2023
3 checks passed
@ferranbt ferranbt deleted the newtype-from-string branch December 6, 2023 12:19
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.

2 participants