-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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: displaying pure EIP-6963 wallets #2777
base: main
Are you sure you want to change the base?
fix: displaying pure EIP-6963 wallets #2777
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@bulgakovk is attempting to deploy a commit to the WalletConnect Team on Vercel. A member of the Team first needs to authorize it. |
@glitch-txs Hey could you review this one? |
Hey there 👋 Is there anything I can do to help get it rolling? |
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.
@bulgakovk can you pls add a Unit Test to make sure there are no regressions?
@@ -54,7 +54,7 @@ export class W3mConnectInjectedWidget extends LitElement { | |||
return null | |||
} | |||
|
|||
if (!ConnectionController.checkInstalled(undefined, connector.chain)) { | |||
if (!connector.info && !ConnectionController.checkInstalled(undefined, connector.chain)) { |
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.
re:unit tests requests.
We don't have snapshot testing for UI components, we have E2E and unit tests. What we can do for this test something related with ConnectorController
;
Not every connector have info
field, only the injected ones. So we could add a test to the ConnectorController.test.ts
like the following:
// Example
it('should throw error when adding injected connector without info field', () => {
expect(() => ConnectorController.addConnector({
...injectedConnector,
info: undefined
})
).toThrow('Connector info is required for injected connectors')
})
And we could update the .addConnector
and setConnectors
logics to check if the type is INJECTED
and don't have info
field, it should throw error.
Description
This PR stops checking if a wallet is installed for EIP-6963 connectors.
checkInstalled
relies onwindow.ethereum
internally, which shouldn't necessarily be defined according to the EIP-6963 spec. This causes a bug when a pure EIP-6963 (nowindow.ethereum
injection) wallet is not displayed in the list.Type of change
Associated Issues
For Linear issues: Closes APKT-xxx
For GH issues: closes #2769
Showcase (Optional)
Tested with the repro steps in my minimal reproducible example: https://github.com/ExodusMovement/web3modal-eip6963-bug/tree/master?tab=readme-ov-file#steps-to-reproduce. I can finally see the Example Wallet (pure EIP-6963) in the list with no enabled ethereum extensions.
Checklist