sui
sui copied to clipboard
[Move] relax restrictions on allowed types in entrypoints
There are a few recurring requests for allowing the following types as entrypoint arguments that I think we should consider granting:
-
object::ID
-
ASCII::String
-
string::String
(i.e., UTF8 strings)
Without these, it is hard for entrypoint type signatures to fully convey the intention of the entrypoint.
CC @kchalkias @oxade
ASCII::String would be a bit tricky since it would require deserializing the argument to do the verification, which isn't something we need today.
Could also be a bit expensive (depending on the size of the data), and then not captured in gas...
Good points @tnowacki, is there a way that we enforce deserialization and verification after signature verification? so it's included in gas if it fails?
Its about metering more than anything. I think you should just manually convert/verify the string once you are in Move
so you have a well metered environment, which clear semantics about the gas usage/metering.
Things like ID
or even Option
for that matter are much easier as they do not have the same concerns