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

Force the user to specify a purpose for the validator script #112

Merged
merged 12 commits into from
Apr 24, 2023

Conversation

nielstron
Copy link
Contributor

@nielstron nielstron commented Mar 31, 2023

This should make sure that (likely) mistakes as in OpShin/opshin-pioneer-program#25 are caught by the compilation script.

Leaves an option to circumvent the check.

Copy link
Contributor

@juliusfrost juliusfrost left a comment

Choose a reason for hiding this comment

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

Looks great!

Comment on lines 141 to 146
a.add_argument(
"purpose",
type=str,
choices=Purpose.__members__.keys(),
help="The intended script purpose. Determines the number of parameters.",
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we make the default purpose spending or always force a choice? What is the current assumption of purpose? Can we display the number of parameters / which ones are necessary in the help text?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The default purpose currently is "any". I think forcing a choice is necessary otherwise people will just default to not specifying anything and bump into this issue later.

good idea to display the number of parameters for each purpose in the help text!

@nielstron
Copy link
Contributor Author

This depends on Python-Cardano/pycardano#194 and a solution to the hashing problem of #117

@nielstron nielstron marked this pull request as ready for review April 24, 2023 17:45
@nielstron nielstron merged commit b9926e6 into dev Apr 24, 2023
@nielstron nielstron added the breaking This update introduces a breaking change label Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking This update introduces a breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants