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

Error if mismatching # of args for instantiate/call #966

Merged
merged 2 commits into from
Feb 13, 2023

Conversation

ascjones
Copy link
Collaborator

Currently if you forget to supply --args to an instantiate/call, it will fail with a trap because of invalid input. e.g calling a constructor which has args but forgetting to add --args:

contract contract instantiate --suri //Alice

This PR adds a simple check which validates the number of args supplied is equal to the expected number of arguments to the ink! constructor or message.

@ascjones ascjones added the bug Something isn't working label Feb 10, 2023
Copy link
Collaborator

@cmichi cmichi left a comment

Choose a reason for hiding this comment

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

Nice!

@ascjones ascjones merged commit fded85c into master Feb 13, 2023
@ascjones ascjones deleted the aj/check-missing-args branch February 13, 2023 12:46
@ascjones ascjones mentioned this pull request Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants