This repository has been archived by the owner on Oct 19, 2024. It is now read-only.
FIX: Generate structs for constructor arguments #2631
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
I noticed that the
Abigen
did not generate astruct
for the constructor parameters. This was a struct that did not appear anywhere else in the interface, so I thought it was because ethers only generates bindings for interacting with an already deployed contract, especially because there was an open issue seemingly asking for this feature: #1239 and also because the generateddeploy
method took a generic input parameter.Upon closer inspection it looked like it should generate structs for the constructor inputs, however this did not happen because the constructor (at least in our case) didn't have a
name
. This would normally be the name of thefunction
, but since aconstructor
doesn't need any, it's empty.Solution
Use the name
"constructor"
if theitem.name
is empty.PR Checklist