-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat(its)!: add chain name to token id derivation #236
base: main
Are you sure you want to change the base?
Conversation
Code Coverage SummaryClick to see the summary
Click to see the extended report
|
@@ -42,6 +43,7 @@ public fun from_info<T>( | |||
): TokenId { | |||
let mut vec = address::from_u256(PREFIX_SUI_TOKEN_ID).to_bytes(); | |||
vec.append(bcs::to_bytes(&type_name::get<T>())); | |||
vec.append(bcs::to_bytes(chain_name)); |
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.
add chain name before type name for consistent pattern
@@ -42,6 +43,7 @@ public fun from_info<T>( | |||
): TokenId { | |||
let mut vec = address::from_u256(PREFIX_SUI_TOKEN_ID).to_bytes(); | |||
vec.append(bcs::to_bytes(&type_name::get<T>())); | |||
vec.append(bcs::to_bytes(chain_name)); |
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.
I think for consistency, we should save chain_name_hash on setup and use that instead
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.
Since Sui packages are compiled at deployment-time, another option is to specify the chain name hash as an address during deployment. Seems like a bad pattern for this use case though haha
[AXE-7210)]