-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Conversation
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.
Looks great!
opshin/__main__.py
Outdated
a.add_argument( | ||
"purpose", | ||
type=str, | ||
choices=Purpose.__members__.keys(), | ||
help="The intended script purpose. Determines the number of parameters.", | ||
) |
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.
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?
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.
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!
3811636
to
839ad0d
Compare
This depends on Python-Cardano/pycardano#194 and a solution to the hashing problem of #117 |
839ad0d
to
9a2a737
Compare
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.