-
Notifications
You must be signed in to change notification settings - Fork 602
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 cache_ctx wraps #2519
Unify cache_ctx wraps #2519
Conversation
x/epochs/types/hooks.go
Outdated
// TODO: Thread info for which hook this is, may be dependent on larger hook system refactoring | ||
err := osmoutils.ApplyFuncIfNoError(ctx, wrappedHookFn) | ||
if err != nil { | ||
ctx.Logger().Info("an epoch hook errored") |
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.
wdyt about logging the error itself here?
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.
good point
hookFn(cacheCtx, epochIdentifier, epochNumber) | ||
write() | ||
ctx.EventManager().EmitEvents(cacheCtx.EventManager().Events()) | ||
wrappedHookFn := func(ctx sdk.Context) error { |
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.
Can this function return err in any case?
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.
Not right now, it will after #2520
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.
Ah makes sense now
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.
have created draft #2526
waiting on this one, so it's cleaner
What is the purpose of the change
In #2515 @puneet2019 fixed that epochs isn't returning events, due to cosmos/cosmos-sdk#12912 .
This also showed that were actually duplicating panic wrapping logic. This PR adds that fix to the general osmosis helper, and makes epochs use the general osmosis helper
Brief Changelog
Testing and Verifying
This change is already covered by existing tests, that @puneet2019 added in #2515
Documentation and Release Note
Unreleased
section inCHANGELOG.md
? no