Skip to content

⚡ Unify name for Child oriented events - #36

Closed
vikiival wants to merge 3 commits into
rmrk-team:mainfrom
vikiival:name-the-child
Closed

⚡ Unify name for Child oriented events#36
vikiival wants to merge 3 commits into
rmrk-team:mainfrom
vikiival:name-the-child

Conversation

@vikiival

Copy link
Copy Markdown
Contributor

For magical reasons there are four events and two of them has different name for collection.

Comment thread contracts/rmrk/lib.rs
@@ -69,7 +69,7 @@ pub mod rmrk_contract {
#[ink(event)]
pub struct ChildAdded {

Copy link
Copy Markdown

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.

Comment thread contracts/rmrk/lib.rs
pub struct ChildAdded {
#[ink(topic)]
to: Id,
parent: Id,

Copy link
Copy Markdown

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.

Comment thread contracts/rmrk/lib.rs
parent: Id,
#[ink(topic)]
child_collection: AccountId,
collection: AccountId,

Copy link
Copy Markdown

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.

Comment thread contracts/rmrk/lib.rs
@@ -93,9 +93,9 @@ pub mod rmrk_contract {
#[ink(topic)]

Copy link
Copy Markdown

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 😞

@vikiival

Copy link
Copy Markdown
Contributor Author

Continue as #38

@vikiival vikiival closed this Jan 18, 2023
@vikiival
vikiival deleted the name-the-child branch January 23, 2023 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants