-
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
⚡ Unify name for Child oriented events #36
Conversation
@@ -69,7 +69,7 @@ pub mod rmrk_contract { | |||
#[ink(event)] | |||
pub struct ChildAdded { |
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.
It was not changed here but seems a good opportunity to improve. We name this ChildProposed
on EVM, because it must be accepted. So "Added" might be confusing.
@@ -69,7 +69,7 @@ pub mod rmrk_contract { | |||
#[ink(event)] | |||
pub struct ChildAdded { | |||
#[ink(topic)] | |||
to: Id, | |||
parent: Id, |
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.
We call this tokenId
since the context is the current collection and event is named Child so this token being the parent can be implied. I'd prefer consistency but parent
also makes it more explicit so I'm fine with either.
I have mixed thoughts about whether to include "Id" in the names, in general. Here it seems obvious since type is Id, but when calling it, it might not be so obvious. Again, no strong position here, up for discussion.
@@ -104,9 +104,9 @@ pub mod rmrk_contract { | |||
#[ink(topic)] | |||
parent: Id, | |||
#[ink(topic)] | |||
child_collection: AccountId, | |||
collection: AccountId, |
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 would definitely keep child_collection
in the name, here you can't know if this collections is about the parent or the child, both present on the event.
@@ -93,9 +93,9 @@ pub mod rmrk_contract { | |||
#[ink(topic)] |
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.
This event is probably legacy. "Removing" a child became "Transferring" a child so event should be ChildTransferred
. Since it can happen from pending (rejecting) or active (removing). Maybe we need an issue for this change, I haven't checked nesting lego yet 😞
Continue as #38 |
For magical reasons there are four events and two of them has different name for collection.