-
Notifications
You must be signed in to change notification settings - Fork 31
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
fix: return error instead of panic for behaviors triggered by client #1395
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1395 +/- ##
=======================================
Coverage 69.68% 69.69%
=======================================
Files 668 668
Lines 56242 56242
=======================================
+ Hits 39194 39198 +4
+ Misses 14775 14773 -2
+ Partials 2273 2271 -2
|
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 could be nice to address other panics on x/fbridge. I found 2 points:
- critical
- keeper/abci.go#L36: In theory,
updateRole()
can return error by registering two identical role suggestions. So we have to update the error handling or the chain halts.
- keeper/abci.go#L36: In theory,
- good-to-have
- keeper/genesis.go#L22 and L28:
setRole()
andsetBridgeSwitch()
may return error because of its argument verification. It that case,InitGenesis()
panics, instead of returning errors. However, ifInitGenesis()
returns any errors, eventually it will panic by the module. Hence, it would be good to return errors or modify the signature ofInitGenesis()
so it won't return any errors.
- keeper/genesis.go#L22 and L28:
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1395 +/- ##
==========================================
+ Coverage 69.68% 70.02% +0.33%
==========================================
Files 668 672 +4
Lines 56242 56866 +624
==========================================
+ Hits 39194 39818 +624
Misses 14775 14775
Partials 2273 2273
|
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.
And please mind keeper/genesis.go#L22.
Description
closes: #XXXX
Motivation and context
How has this been tested?
Screenshots (if appropriate):
Checklist:
CHANGELOG.md
client/docs/swagger-ui/swagger.yaml