Skip to content
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

Correct dApp info passed on eth_requestAccounts #3768

Merged
merged 2 commits into from
Jan 18, 2025
Merged

Conversation

hyphenized
Copy link
Collaborator

@hyphenized hyphenized commented Jan 17, 2025

This was making one of the e2e test fail as an empty array was passed as dApp connection info.

To test

  • Head to https://swap.cow.fi, connect and check title and logo displayed under connection info

Latest build: extension-builds-3768 (as of Fri, 17 Jan 2025 22:18:50 GMT).

Invalid params resulted in an empty array passed as dapp connection info
@hyphenized hyphenized self-assigned this Jan 17, 2025
@@ -234,7 +234,6 @@ export default class ProviderBridgeService extends BaseService<Events> {
// methods).
const [title, faviconUrl] = (event.request.params as unknown[]).slice(
-2,
0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 -2,0 and -2 alone should be synonymous. What's the difference in outcome?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that too but -2 means start from (array length + -2). So setting the end as 0 makes it return an empty array because the ending position is before the starting position

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well that's embarrassing 😬

@Shadowfiend Shadowfiend merged commit a9f37c8 into main Jan 18, 2025
4 of 6 checks passed
@Shadowfiend Shadowfiend deleted the fix-sent-dapp-info branch January 18, 2025 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants