-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
[adapter][verifier] allow option and ID arguments in entry points #2149
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.
Nice. This works. But I wonder how does someone actually pass them in when making a Move call.
A future PR... But it should be doable in the current CLI/builder |
SignatureToken::StructInstantiation(idx, targs) => { | ||
let resolved_struct = sui_verifier::resolve_struct(view, *idx); | ||
// is option of a primitive | ||
resolved_struct == RESOLVED_STD_OPTION |
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.
Will an Option<ID>
work as well?
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.
Yes
Yes and when the other PR (that uses it in Move calls) is ready, we can change example contracts that previously did address casting to ID and were refactored not to use Option |
type_params: type_args, | ||
}) => { | ||
let resolved_struct = (address, module.as_ident_str(), name.as_ident_str()); | ||
// is id or.. |
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.
what is this comment about?
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.
is id or... is option of a primitive (down below)
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.
Thanks!
I do think passing an |
Interesting, I hadn't considered that. What's the thought/worry here? |
@sblackshear, landing, but let me know the thoughts here or elsewhere |
This seemed easy to fix so I gave it a shot, I think it fits in nicely but
[Move] relax restrictions on allowed types in entrypoints #2049
Allow options of "pure" values
Allow ID as a "pure" value
As discussed on the issue, I don't think string is a good fit right here due to the complexities around validation