-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
chore(types): add MustAccAddressFromBech32 util func #12201
Conversation
Codecov Report
@@ Coverage Diff @@
## main #12201 +/- ##
==========================================
+ Coverage 66.07% 66.16% +0.08%
==========================================
Files 672 672
Lines 71046 70990 -56
==========================================
+ Hits 46946 46971 +25
+ Misses 21435 21382 -53
+ Partials 2665 2637 -28
|
(cherry picked from commit 82e13b1)
(cherry picked from commit 82e13b1) # Conflicts: # CHANGELOG.md # server/rosetta/converter.go # simapp/export.go # x/authz/keeper/genesis.go # x/feegrant/simulation/operations.go # x/gov/keeper/deposit.go # x/gov/keeper/msg_server.go # x/gov/keeper/tally.go # x/group/msgs.go # x/group/types.go # x/nft/keeper/genesis.go # x/staking/keeper/delegation.go # x/staking/keeper/genesis.go
In the past we were trying to remove / limit panics. I know it can reduce the code, but it hides the error in panic down stream. |
Well the code paths that call this new API panic'd anyway and in cases of BeginBlock/EndBlock, they need to panic. So I don't see a need to revert this. Those that want to handle the errors gracefully still can call the original error-returning API. |
IMO it encourages a wrong style. Panic, if needed, should happen when there is no way to recover. |
That's exactly what's happening here. This API provides a convenience method to avoid |
Probably i didn't express it correctly. I don't think it's good to add that method to a public API. Having it internal is OK. It's already a technical debt that we don't return errors and panic instead. |
It's the developer's responsibility to ensure they handle errors correctly IMO. |
Description
Closes: #XXXX
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change