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
feat: add format parameter to hardhat-abi-exporter #42
Conversation
Hey @ItsNickBarry , i was using your plugin to generate human readable ABI and realized this package supports only JSON and minimal. I've tweaked the parameter but this does like a breaking change and I wasn't sure if this is something you were considering. https://docs.ethers.io/v5/api/utils/abi/formats/ If you find this alright, would love to get feedback + have this merged. Btw neat plugin <3 love ittttt |
- udpate documentation - set default format to json - supported formats are json, fullName, minimal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't aware of any human readable ABI other than the "minimal" format. Could you post an example?
This seems like a reasonable change, but I don't want to make any breaking changes until next major version, which I"m not ready to release yet. However, it should be easy to keep both the pretty
and format
options for now, and remove pretty
later. See inline comments.
Ah sweet ! Will address the feedback And yup i came across this different formats just a few hours earlier 😅 This is an example of
This is an example of
This section covers the 3 abi options in a bit more detail: |
|
||
if (!config.format) { | ||
conf.format = conf.pretty ? "minimal": "json"; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ItsNickBarry let me know if you are good with this approach.
pretty internally just uses format and that way code is less messier in export_abi.js file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is the best way. Similar to flat/rename above.
|
||
if (!config.format) { | ||
conf.format = conf.pretty ? "minimal": "json"; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is the best way. Similar to flat/rename above.
Fixed a couple of things. See resolve comments. I'll merge and publish this soon. |
Perfect :D Thanks again for the super quick feedback |
Post-merge fix: 71e7dcb |
Thanks for the PR, @thelostone-mc. Released in |
Description
format
json
json
,fullName
,minimal