Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

vikiival
Copy link
Contributor

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

@@ -69,7 +69,7 @@ pub mod rmrk_contract {
#[ink(event)]
pub struct ChildAdded {
Copy link
Member

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,
Copy link
Member

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,
Copy link
Member

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)]
Copy link
Member

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
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