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

fix: session approval accounts order #562

Merged
merged 6 commits into from
May 24, 2024
Merged

Conversation

KannuSingh
Copy link
Collaborator

reverting to previous solution as suggested.

 // we should append the smart accounts to the available eip155 accounts
 namespaces.eip155.accounts = namespaces.eip155.accounts.concat(reorderedEip155Accounts)

Copy link

vercel bot commented May 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
decentralized-relay-wallet ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2024 7:41pm
react-dapp-v2-with-ethers 🔄 Building (Inspect) Visit Preview 💬 Add feedback May 22, 2024 7:41pm
react-wallet-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2024 7:41pm
9 Ignored Deployments
Name Status Preview Comments Updated (UTC)
decentralized-relay-app ⬜️ Ignored (Inspect) Visit Preview May 22, 2024 7:41pm
malicious-dapp-verify-simulation ⬜️ Ignored (Inspect) Visit Preview May 22, 2024 7:41pm
react-auth-dapp ⬜️ Ignored (Inspect) Visit Preview May 22, 2024 7:41pm
react-auth-wallet ⬜️ Ignored (Inspect) Visit Preview May 22, 2024 7:41pm
react-dapp-v2 ⬜️ Ignored (Inspect) Visit Preview May 22, 2024 7:41pm
react-dapp-v2-cosmos-provider ⬜️ Ignored (Inspect) Visit Preview May 22, 2024 7:41pm
react-dapp-v2-with-web3js ⬜️ Ignored (Inspect) Visit Preview May 22, 2024 7:41pm
svelte-web3modal ⬜️ Ignored (Inspect) Visit Preview May 22, 2024 7:41pm
vue-dapp-auth ⬜️ Ignored (Inspect) Visit Preview May 22, 2024 7:41pm

1. expected order of accounts is smart accounts followed by EOA's
2. supportedAddressPriority will now only return the address of smart account.
Copy link
Member

@ganchoradkov ganchoradkov left a comment

Choose a reason for hiding this comment

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

Added suggestion to avoid duplicate accounts

// reorderedEip155Accounts includes Smart Accounts(if enabled) and EOA's
namespaces.eip155.accounts = reorderedEip155Accounts
// we should append the smart accounts to the available eip155 accounts
namespaces.eip155.accounts = reorderedEip155Accounts.concat(namespaces.eip155.accounts)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
namespaces.eip155.accounts = reorderedEip155Accounts.concat(namespaces.eip155.accounts)
namespaces.eip155.accounts = [...new Set(reorderedEip155Accounts.concat(namespaces.eip155.accounts))]

this will remove any duplicates from the array

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed this by modifying the supportedAddressPriority method to return only the smart account address on supported chain for enabled SA. Will not need this as now no duplication will occur.

Copy link
Contributor

@arein arein left a comment

Choose a reason for hiding this comment

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

Please add a unit test or functional test - optionally if you like but not necessary an e2e playwright test - to prevent future regressions

@KannuSingh
Copy link
Collaborator Author

issue #557 fix included

@KannuSingh KannuSingh merged commit 1725963 into main May 24, 2024
19 checks passed
@KannuSingh KannuSingh deleted the session-approval-account-order branch May 24, 2024 18:17
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.

3 participants