-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Throw an error on duplicate registration #7729
Conversation
// we panic). | ||
foundImplType, found := imap[typeURL] | ||
if found && foundImplType != implType { | ||
panic( |
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.
sorry Robert, it's hard not to panic here. I think we need to change the signature of RegisterInterfaces
everywhere on AppModuleBasic, if we don't want to panic.
Codecov Report
@@ Coverage Diff @@
## master #7729 +/- ##
==========================================
+ Coverage 54.17% 54.21% +0.03%
==========================================
Files 611 611
Lines 38624 38654 +30
==========================================
+ Hits 20926 20956 +30
Misses 15564 15564
Partials 2134 2134 |
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.
Let's also have a comment for RegisterCustomTypeURL
and maybe explain why it's an error to register services twice (that means conflicting modules usually)
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.
Splendid - ACKd!
I added clearer messages in the panics, feel free to suggest some better wording. |
* Panic on registering a service twice * Panic if we register twice * Fix test * Fix test * Add clearer panic message * Add comment * Fix test
Description
closes: #7679
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.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes