Fix: update isConnected method to exclude wallets without Identity contract#519
Open
Fix: update isConnected method to exclude wallets without Identity contract#519
Conversation
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Relying on
instanceof BaseAdminWalletinsideMultiWallettightly couples this class to a specific wallet implementation; consider adding a capability flag or interface method (e.g.supportsIdentity()or similar) on wallets and filtering based on that instead. - If all wallets are filtered out (e.g. only admin wallets are configured),
isConnectedwill always return false; consider explicitly handling/logging this scenario so it's easier to debug unexpected connectivity results.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Relying on `instanceof BaseAdminWallet` inside `MultiWallet` tightly couples this class to a specific wallet implementation; consider adding a capability flag or interface method (e.g. `supportsIdentity()` or similar) on wallets and filtering based on that instead.
- If all wallets are filtered out (e.g. only admin wallets are configured), `isConnected` will always return false; consider explicitly handling/logging this scenario so it's easier to debug unexpected connectivity results.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Base has no Identity contract, so MultiWallet.isConnected() was failing when it ran on BaseAdminWallet and broke /verify/topwallet. We now skip BaseAdminWallet in the isConnected check so only wallets with Identity (e.g. Celo) are used.
You can refer msgs on Slack
About # (link your issue here)
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist:
Summary by Sourcery
Bug Fixes: