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

piecrust: allow passing no argument when constructor exist #338

Merged
merged 2 commits into from
Feb 22, 2024

Conversation

ureeves
Copy link
Member

@ureeves ureeves commented Feb 22, 2024

This PR allows passing no arguments even when a contract has a constructor.

If no argument is provided, the default used will be an empty byte vector. If the contract does require an argument, this will ensure that it errors during execution of the constructor, and thus error during deployment.

Resolves #316

@ureeves ureeves requested a review from miloszm February 22, 2024 12:00
Previously we were erroring out when providing no arguments for a
constructor that takes no argument. This is undesirable since downstream
does not necessarily know that the contract they deploy has a constructor.

A contract that is provided an argument that it doesn't expect will
still error at deploy time, during execution of the constructor.

Resolves #316
@ureeves ureeves force-pushed the empty-argument-ctor-316 branch from c54b113 to 0dc4c06 Compare February 22, 2024 12:20
Copy link
Contributor

@miloszm miloszm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ureeves ureeves merged commit 648f68d into main Feb 22, 2024
6 checks passed
@ureeves ureeves deleted the empty-argument-ctor-316 branch February 22, 2024 13:09
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.

Remove panic when an empty argument constructor exists and an argument is not provided
2 participants