-
Notifications
You must be signed in to change notification settings - Fork 624
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
imp: make event emission functions unexported #3205
Conversation
I think I could also make |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3205 +/- ##
=======================================
Coverage 78.60% 78.60%
=======================================
Files 177 177
Lines 12420 12420
=======================================
Hits 9763 9763
Misses 2231 2231
Partials 426 426
|
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.
Great idea!
// EmitCreateClientEvent emits a create client event | ||
func EmitCreateClientEvent(ctx sdk.Context, clientID string, clientState exported.ClientState) { | ||
// EmitUpgradeChainEvent emits an upgrade chain event. | ||
func EmitUpgradeChainEvent(ctx sdk.Context, height int64) { |
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 there a reason this is still public?
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.
This one I couldn't change because is used here. But maybe there's also a way around, if we can move the event emission inside SetUpgradedConsensusState
?
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.
I think it might be a good idea to move all our begin blocker actions to the keeper directory (within abci.go).
func (k Keeper) BeginBlocker(ctx sdk.Context) {
// functionality
}
// within ibc module.go
func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) {
am.keeper.ClientKeeper.BeginBlocker(ctx)
}
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.
We can handle EmitUpgradeChainEvent
in a followup if we decide to make changes. I would prefer it to be moved back to the bottom of the file in that case. Otherwise, the changes look great to me!
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
Description
Most of the event emission functions can be unexported.
closes: #XXXX
Commit Message / Changelog Entry
see the guidelines for commit messages. (view raw markdown for examples)
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
).godoc
comments.Files changed
in the Github PR explorer.Codecov Report
in the comment section below once CI passes.