-
Notifications
You must be signed in to change notification settings - Fork 71
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
Update events docs #297
Update events docs #297
Conversation
When an event is emitted, 0 or more topics can be associated with it. The event is then indexed | ||
together with other events with the same topic value. | ||
|
||
An event's fields can be annotated with `#[ink(topic)]` (see example), which will result in a |
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.
An event's fields can be annotated with `#[ink(topic)]` (see example), which will result in a | |
An event's field can be annotated with `#[ink(topic)]` (see example), which will result in a |
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 is meant to convey that multiple individual fields can be annotated with the topic
.
An event's fields can be annotated with `#[ink(topic)]` (see example), which will result in a | ||
topic derived from the value of that field being emitted together with the event. | ||
|
||
Topics are by default a 32 byte array (`[u8; 32]`), although this is configurable on the |
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.
Is it actually configurable? I thought ink is hardcoded to use blake 256 still
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 type of the resulting topic is configurable yes. So if it is shorter I guess it will be truncated and longer padded.
Our way of generating the topic value itself is hardcoded to blake2.
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.
Just some style remarks for consistency with existing docs.
For events 2.0 use-ink/ink#1827