-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Create CustomTransferPermission #15615
base: 09-09-add_perimission_checks_to_object
Are you sure you want to change the base?
Create CustomTransferPermission #15615
Conversation
⏱️ 8m total CI duration on this PR
🚨 1 job on the last run was significantly faster/slower than expected
|
} | ||
|
||
public(friend) fun set_custom_transfer_permission_internal(object_addr: address, permission_key: PermKey) { | ||
let permision_key = copyable_any::pack(permission_key); |
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 variable permision_key
contains a typo and should be spelled permission_key
to match the struct field name and maintain consistent spelling throughout the codebase.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
if (exists<CustomTransferPermission>(ref.self)) { | ||
assert!(borrow_global<CustomTransferPermission>(ref.self).permision_key == permision_key, error::invalid_state(ECUSTOM_TRANSFER_PERMISSION_ALREADY_SET)); | ||
} else { |
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 code is using ref.self
but ref
is not defined in this scope - object_addr
is the correct parameter to use here. This appears to be a copy/paste error from the public function above.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
object::set_custom_transfer_permission_internal(object::object_address(token), CollectionTransferPermission { | ||
collection: object::object_address(collection), | ||
}) |
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 struct field name collection
does not match the field name collection_addr
defined in the CollectionTransferPermission
struct. Please update the field name in this initialization to match the struct definition.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
6851ffb
to
d4a929c
Compare
d4a929c
to
6fd4575
Compare
Description
How Has This Been Tested?
Key Areas to Review
Type of Change
Which Components or Systems Does This Change Impact?
Checklist