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

feat: update behavior to switch chains #3922

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Conversation

therealemjy
Copy link
Member

@therealemjy therealemjy commented Feb 20, 2025

Changes

  • refactor ConnectWallet container to remove logic handling chain switching
  • create SwitchChain container to prompt user to connect to the wanted chain if they aren't already
  • update AuthHandler container so that users don't get automatically disconnected when they are connected to the wrong chain
  • update transaction forms to prompt users to connect to the correct chain before submitting
  • create useAccountChainId hook

Copy link

changeset-bot bot commented Feb 20, 2025

🦋 Changeset detected

Latest commit: 9a3a12d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@venusprotocol/evm Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Feb 20, 2025

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

Name Status Preview Updated (UTC)
app-alt.venus.io ✅ Ready (Inspect) Visit Preview Feb 25, 2025 9:07am
dapp-preview ✅ Ready (Inspect) Visit Preview Feb 25, 2025 9:07am
dapp-testnet ✅ Ready (Inspect) Visit Preview Feb 25, 2025 9:07am
venus.io ✅ Ready (Inspect) Visit Preview Feb 25, 2025 9:07am

Copy link
Contributor

github-actions bot commented Feb 20, 2025

Coverage Report for ./apps/evm

Status Category Percentage Covered / Total
🔵 Lines 81.78% 41965 / 51313
🔵 Statements 81.78% 41965 / 51313
🔵 Functions 71.53% 950 / 1328
🔵 Branches 88.99% 6171 / 6934
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
apps/evm/src/clients/api/queries/useGetPools/__tests__/index.spec.ts 100% 100% 100% 100%
apps/evm/src/containers/ConnectWallet/index.tsx 100% 100% 100% 100%
apps/evm/src/containers/ConnectWallet/__tests__/index.spec.tsx 100% 100% 100% 100%
apps/evm/src/containers/Form/RhfSubmitButton/index.tsx 97.67% 84.61% 100% 97.67% 64
apps/evm/src/containers/SwitchChain/index.tsx 100% 100% 100% 100%
apps/evm/src/containers/SwitchChain/__tests__/index.spec.tsx 100% 100% 100% 100%
apps/evm/src/hooks/useUserChainSettings/__tests__/index.spec.tsx 100% 100% 100% 100%
apps/evm/src/libs/wallet/index.ts 0% 0% 0% 0% 1-16
apps/evm/src/libs/wallet/Web3Wrapper/config.ts 0% 0% 0% 0% 1-36
apps/evm/src/libs/wallet/Web3Wrapper/ConnectKitWrapper/AuthHandler/index.tsx 0% 0% 0% 0% 1-65
apps/evm/src/libs/wallet/hooks/useAccountChainId/index.tsx 0% 0% 0% 0% 1-6
apps/evm/src/pages/Bridge/index.tsx 91.97% 85.5% 81.81% 91.97% 166-167, 174-186, 212-213, 240-243, 249-252, 281-282, 339-342
apps/evm/src/pages/Bridge/__tests__/index.spec.tsx 100% 100% 100% 100%
apps/evm/src/pages/Governance/ProposalList/CreateProposalModal/ProposalWizard/index.tsx 87.69% 93.33% 85.71% 87.69% 65-78, 87, 117
apps/evm/src/pages/Governance/VotingWallet/index.tsx 99.47% 89.65% 50% 99.47% 153
apps/evm/src/pages/Governance/VotingWallet/DelegateModal/index.tsx 97.43% 71.42% 100% 97.43% 40-41
apps/evm/src/pages/Governance/VotingWallet/DelegateModal/SubmitSection/index.tsx 100% 66.66% 100% 100%
apps/evm/src/pages/Governance/__tests__/index.spec.tsx 100% 100% 100% 100%
apps/evm/src/pages/Market/Page/OperationForm/BorrowForm/index.tsx 97.34% 97.67% 71.42% 97.34% 66-70, 107
apps/evm/src/pages/Market/Page/OperationForm/BorrowForm/SubmitSection/index.tsx 100% 100% 100% 100%
apps/evm/src/pages/Market/Page/OperationForm/BorrowForm/__tests__/index.spec.tsx 100% 100% 100% 100%
apps/evm/src/pages/Market/Page/OperationForm/BorrowForm/__tests__/indexWrapUnwrapNative.spec.tsx 100% 100% 100% 100%
apps/evm/src/pages/Market/Page/OperationForm/RepayForm/index.tsx 99.32% 94.05% 100% 99.32% 180, 559-560
apps/evm/src/pages/Market/Page/OperationForm/RepayForm/SubmitSection/index.tsx 100% 100% 100% 100%
apps/evm/src/pages/Market/Page/OperationForm/RepayForm/__tests__/index.spec.tsx 100% 100% 100% 100%
apps/evm/src/pages/Market/Page/OperationForm/RepayForm/__tests__/indexIntegratedSwap.spec.tsx 100% 100% 100% 100%
apps/evm/src/pages/Market/Page/OperationForm/SupplyForm/index.tsx 95.93% 91.17% 100% 95.93% 154, 197-198, 232-245, 456, 594-595
apps/evm/src/pages/Market/Page/OperationForm/SupplyForm/SubmitSection/index.tsx 100% 100% 100% 100%
apps/evm/src/pages/Market/Page/OperationForm/SupplyForm/__tests__/index.spec.tsx 100% 100% 100% 100%
apps/evm/src/pages/Market/Page/OperationForm/SupplyForm/__tests__/indexIntegratedSwap.spec.tsx 100% 100% 100% 100%
apps/evm/src/pages/Market/Page/OperationForm/WithdrawForm/index.tsx 93.85% 91.48% 66.66% 93.85% 65-69, 97-98, 117, 146-147, 307-311
apps/evm/src/pages/Market/Page/OperationForm/WithdrawForm/SubmitSection/index.tsx 100% 100% 100% 100%
apps/evm/src/pages/Market/Page/OperationForm/WithdrawForm/__tests__/index.spec.tsx 100% 100% 100% 100%
apps/evm/src/pages/Market/Page/OperationForm/WithdrawForm/__tests__/indexWrapUnwrapNative.spec.tsx 100% 100% 100% 100%
apps/evm/src/pages/Proposal/index.tsx 96.45% 96% 87.5% 96.45% 57-62
apps/evm/src/pages/Proposal/Commands/BscCommand/ActionButton/index.tsx 93.02% 75% 100% 93.02% 56-57, 77-78, 93-94
apps/evm/src/pages/Proposal/Commands/NonBscCommand/index.tsx 100% 100% 100% 100%
apps/evm/src/pages/Proposal/Commands/NonBscCommand/ExecuteButton/index.tsx 92% 66.66% 100% 92% 29-30
apps/evm/src/pages/Proposal/__tests__/index.spec.tsx 99.81% 100% 100% 99.81% 568
apps/evm/src/pages/Swap/SubmitSection/index.tsx 100% 100% 100% 100%
apps/evm/src/pages/Vai/Repay/index.tsx 95.08% 78.12% 100% 95.08% 124-125, 158-159, 174-175, 183-184, 206
apps/evm/src/pages/Vault/TransactionForm/index.spec.tsx 100% 100% 100% 100%
apps/evm/src/pages/Vault/TransactionForm/index.tsx 98% 92% 80% 98% 83, 117-118
apps/evm/src/pages/Vault/TransactionForm/SubmitSection/index.tsx 100% 100% 100% 100%
apps/evm/src/pages/Vault/modals/WithdrawFromVestingVaultModal/RequestWithdrawal/__tests__/index.spec.tsx 100% 100% 100% 100%
apps/evm/src/pages/Vault/modals/WithdrawFromVestingVaultModal/Withdraw/index.spec.tsx 100% 100% 100% 100%
apps/evm/src/pages/Vault/modals/WithdrawFromVestingVaultModal/Withdraw/index.tsx 100% 100% 100% 100%
apps/evm/src/testUtils/render.tsx 100% 100% 85.71% 100%
Generated in workflow #10146 for commit 9a3a12d by the Vitest Coverage Report Action

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.

1 participant