-
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
error returning epoch hooks #2526
error returning epoch hooks #2526
Conversation
c5e4efe
to
8cca90c
Compare
x/epochs/keeper/hooks.go
Outdated
func (k Keeper) AfterEpochEnd(ctx sdk.Context, identifier string, epochNumber int64) { | ||
k.hooks.AfterEpochEnd(ctx, identifier, epochNumber) | ||
func (k Keeper) AfterEpochEnd(ctx sdk.Context, identifier string, epochNumber int64) error { | ||
return k.hooks.AfterEpochEnd(ctx, identifier, epochNumber) | ||
} | ||
|
||
// BeforeEpochStart new epoch is next block of epoch end block | ||
func (k Keeper) BeforeEpochStart(ctx sdk.Context, identifier string, epochNumber int64) { | ||
k.hooks.BeforeEpochStart(ctx, identifier, epochNumber) |
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 we ignore the error in here, instead of in abci.go?
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.
done!
x/mint/keeper/hooks_test.go
Outdated
@@ -395,7 +395,10 @@ func (suite *KeeperTestSuite) TestAfterEpochEnd() { | |||
|
|||
osmoassert.ConditionalPanic(suite.T(), tc.expectedPanic, func() { |
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 should change the variable here to expectedError
, and then just do an if statement for checking if error vs checking no 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.
done!
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 LGTM, thanks for doing this!
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.
All suggestions have been applied. Should be ready for merge. Thanks @puneet2019
Closes: #XXX
A part of #2520 only implemented for epochs module.
If it looks good, can go ahead and implement for other modules as well.
would wait for #2519 to be merged before. (rebase, etc. then open up)
What is the purpose of the change
ApplyFuncIfNoError
hooks interface
functions to return an error.EpochHooks interface
Brief Changelog
Testing and Verifying
Documentation and Release Note
Unreleased
section inCHANGELOG.md
? (yes / no) yes