-
Notifications
You must be signed in to change notification settings - Fork 6
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
Common token prefix utility func #299
Conversation
minLengthESDTPrefix = 1 | ||
) | ||
|
||
func IsValidPrefixedToken(token string) (string, bool) { |
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.
missing comment
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.
+1
// minLengthESDTPrefix represents the minimum number of characters a token's prefix can have | ||
minLengthESDTPrefix = 1 | ||
) | ||
|
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 have IsValidToken (as it was before) to understand prefixed tokens as well, not only non-prefixed ones ?
I think it should and it is possible.
It can be done with len of tokenSplit.
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.
In mx-chain-go we don't have any function which only does the validation for a simple token, we only have this func(which also does some validations):
ExtractTokenIDAndNonceFromTokenStorageKey
.
However, that type of function is not being used in other places, so there was no need to create one and move it to core only to be used in the binary node.
No description provided.