-
Notifications
You must be signed in to change notification settings - Fork 138
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
add event emissions to provider and consumer #427
Conversation
44fa19e
to
8ebb7bc
Compare
4ec552a
to
5cd18e7
Compare
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.
Nice work @MSalopek. See my comments below. It could be useful to ask some front-end devs for feedback.
2af0044
to
40f122b
Compare
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.
Nice work! I don't see a reason not to approve as this clearly cannot introduce bugs. Improvements and more events can be added later if necessary.
x/ccv/types/events.go
Outdated
EventTypeFeeTransferChannelOpened = "fee_channel_opened" | ||
EventTypeConsumerClientCreated = "consumer_client_created" | ||
|
||
EventExecuteConsumerChainSlash = "execute_consumer_chain_slash" |
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.
Should line 12 have EventType
as a prefix?
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.
Added.
x/ccv/types/events.go
Outdated
EventTypeTimeout = "timeout" | ||
EventTypePacket = "ccv_packet" | ||
EventTypeChannelClose = "channel_closed" | ||
EventTypeChannelEstablished = "channel_established" | ||
EventTypeFeeTransferChannelOpened = "fee_channel_opened" | ||
EventTypeConsumerClientCreated = "consumer_client_created" | ||
|
||
EventExecuteConsumerChainSlash = "execute_consumer_chain_slash" | ||
EventTypeFeeDistribution = "fee_distribution" | ||
EventTypeSendSlashPacket = "send_slash_packet" | ||
EventTypeSendMaturedVSCPacket = "send_matured_vsc_packet" |
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.
Some of these are in past tense and some are in present tense, could it be more consistent?
By the way there is a nice vscode extension change-case
which lets you easily change Camel to snake ect. Some of these dont match (ChannelClose = "channel_closed")
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.
Changed cases that did not match.
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 a couple small things but great stuff!
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.
LGTM
commit 5dc2bbf Author: MSalopek <[email protected]> Date: Fri Nov 11 20:03:22 2022 +0100 add event emissions to provider and consumer (#427) * add todos for event emissions * introduce ccv_consumer_added, ccv_fee_channel_opened events * add vsc_first_packet event in consumer * add fee distribution event; small refactor * add slash request events * add pending slash request clearing events * move all events to ccv; add CreateClient event on provi * remove event addition TODO tags * update after reviews * small refactors * address review comments and refactor Co-authored-by: Daniel T <[email protected]> commit 8d158d9 Author: Shawn Marshall-Spitzbart <[email protected]> Date: Fri Nov 11 01:27:22 2022 -0800 Update CODEOWNERS (#466)
commit 5dc2bbf Author: MSalopek <[email protected]> Date: Fri Nov 11 20:03:22 2022 +0100 add event emissions to provider and consumer (#427) * add todos for event emissions * introduce ccv_consumer_added, ccv_fee_channel_opened events * add vsc_first_packet event in consumer * add fee distribution event; small refactor * add slash request events * add pending slash request clearing events * move all events to ccv; add CreateClient event on provi * remove event addition TODO tags * update after reviews * small refactors * address review comments and refactor Co-authored-by: Daniel T <[email protected]> commit 8d158d9 Author: Shawn Marshall-Spitzbart <[email protected]> Date: Fri Nov 11 01:27:22 2022 -0800 Update CODEOWNERS (#466) Co-authored-by: Daniel <[email protected]>
Events added:
create_client
(provider -> during CreateConsumerClient call)consumer_added
(provider)execute_consumer_chain_slash
(provider)fee_channel_opened
(consumer)first_vsc_packet
(consumer -> mainly for debugging so we know that first vsc was received)fee_distribution
(consumer)send_slash_packet
(consumer)send_matured_vsc_packet
(consumer)