-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. We call this 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. |
||
#[ink(topic)] | ||
collection: AccountId, | ||
#[ink(topic)] | ||
|
@@ -93,9 +93,9 @@ pub mod rmrk_contract { | |
#[ink(topic)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
parent: Id, | ||
#[ink(topic)] | ||
child_collection: AccountId, | ||
collection: AccountId, | ||
#[ink(topic)] | ||
child_token_id: Id, | ||
child: Id, | ||
} | ||
|
||
/// Event emitted when a child is rejected. | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. I would definitely keep |
||
#[ink(topic)] | ||
child_token_id: Id, | ||
child: Id, | ||
} | ||
|
||
/// Event emitted when new asset is set for the collection. | ||
|
@@ -302,7 +302,7 @@ pub mod rmrk_contract { | |
/// Emit ChildAdded event | ||
fn _emit_added_child_event(&self, to: &Id, collection: &AccountId, child: &Id) { | ||
self.env().emit_event(ChildAdded { | ||
to: to.clone(), | ||
parent: to.clone(), | ||
collection: *collection, | ||
child: child.clone(), | ||
}); | ||
|
@@ -326,8 +326,8 @@ pub mod rmrk_contract { | |
) { | ||
self.env().emit_event(ChildRemoved { | ||
parent: parent.clone(), | ||
child_collection: *child_collection, | ||
child_token_id: child_token_id.clone(), | ||
collection: *child_collection, | ||
child: child_token_id.clone(), | ||
}); | ||
} | ||
|
||
|
@@ -340,8 +340,8 @@ pub mod rmrk_contract { | |
) { | ||
self.env().emit_event(ChildRejected { | ||
parent: parent.clone(), | ||
child_collection: *child_collection, | ||
child_token_id: child_token_id.clone(), | ||
collection: *child_collection, | ||
child: child_token_id.clone(), | ||
}); | ||
} | ||
} | ||
|
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.