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

Add missing setProvider call #3048

Merged
merged 10 commits into from
Oct 9, 2024
Merged

Conversation

KannuSingh
Copy link
Collaborator

@KannuSingh KannuSingh commented Oct 9, 2024

Description

For Embedded wallet, on successful connection, provider returns undefined for below code.
ProviderUtil.getProvider(CommonConstantsUtil.CHAIN.EVM)
This PR is to fix this issue.

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Associated Issues

For Linear issues: Closes APKT-xxx
For GH issues: closes #...

Showcase (Optional)

If there is a UI change include the screenshots with before and after state.
If new feature is being introduced, include the link to demo recording.

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections
  • I have tested my changes on the preview link
  • Approver of this PR confirms that the changes are tested on the preview link

Copy link

changeset-bot bot commented Oct 9, 2024

🦋 Changeset detected

Latest commit: fb79dcd

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

This PR includes changesets to release 19 packages
Name Type
@reown/appkit-adapter-ethers Patch
@reown/appkit-adapter-wagmi Patch
@reown/appkit-utils Patch
@apps/laboratory Patch
@reown/appkit Patch
@apps/demo Patch
@apps/gallery Patch
@reown/appkit-adapter-ethers5 Patch
@reown/appkit-adapter-polkadot Patch
@reown/appkit-adapter-solana Patch
@reown/appkit-cdn Patch
@reown/appkit-common Patch
@reown/appkit-core Patch
@reown/appkit-experimental Patch
@reown/appkit-polyfills Patch
@reown/appkit-scaffold-ui Patch
@reown/appkit-siwe Patch
@reown/appkit-ui Patch
@reown/appkit-wallet Patch

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 Oct 9, 2024

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

Name Status Preview Updated (UTC)
appkit-laboratory ✅ Ready (Inspect) Visit Preview Oct 9, 2024 8:22pm
web3modal-gallery ✅ Ready (Inspect) Visit Preview Oct 9, 2024 8:22pm

Copy link
Contributor

github-actions bot commented Oct 9, 2024

Coverage Report for Coverage

Status Category Percentage Covered / Total
🔵 Lines 321.83000000000004% 4410 / 19228
🔵 Statements 321.83000000000004% 4410 / 19228
🔵 Functions 343.16% 346 / 1030
🔵 Branches 379.87% 636 / 1327
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
packages/appkit/src/store/ProviderUtil.ts 64.1% 100% 25% 64.1% 31-32, 35-36, 45-46, 55-56, 59-61, 64-66
packages/appkit/src/store/index.ts 100% 100% 100% 100%
packages/appkit-utils/src/ethers/EthersTypesUtil.ts 100% 100% 100% 100%
Generated in workflow #6725 for commit 0e04a71 by the Vitest Coverage Report Action

Copy link
Contributor

github-actions bot commented Oct 9, 2024

♻️ Vite-Size ♻️

Size Difference

Size (kb) Gzip (kb)
Total Diff. 0 0

Current Size

Name Size (kb) Gzip (kb)
assets/index-BrBE177U.js 1890.938 539.641
assets/index.js 9.642 3.151
assets/index2.js 11.588 3.209
assets/w3m-modal.js 7.504 2.656
assets/noble-curves.js 31.941 12.778
assets/2.21.4_bufferutil.js 2.789 1.327
assets/index3.js 102.251 29.116
assets/index4.js 304.393 87.285
assets/hooks.module.js 74.286 25.525
index.html 0.329 0.237
Total Size 2435.661 704.925

Base Size

Name Size (kb) Gzip (kb)
assets/index-BrBE177U.js 1890.938 539.641
assets/index.js 9.642 3.151
assets/index2.js 11.588 3.209
assets/w3m-modal.js 7.504 2.656
assets/noble-curves.js 31.941 12.778
assets/2.21.4_bufferutil.js 2.789 1.327
assets/index3.js 102.251 29.116
assets/index4.js 304.393 87.285
assets/hooks.module.js 74.286 25.525
index.html 0.329 0.237
Total Size 2435.661 704.925

@enesozturk
Copy link
Contributor

@KannuSingh can you add changeset file please?

const mockConnector = {
id: 'mockConnector',
name: 'Mock Connector',
getProvider: vi.fn().mockResolvedValue({})
Copy link
Contributor

Choose a reason for hiding this comment

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

What this does test? shouldn't the connector be returning undefined?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is an existing test for syncAccount, just added getProvider on mockConnector bc I added connector.getProvider call in the syncAccount

.changeset/spotty-buses-think.md Outdated Show resolved Hide resolved
packages/adapters/wagmi/src/client.ts Outdated Show resolved Hide resolved
@KannuSingh KannuSingh merged commit 2751feb into main Oct 9, 2024
17 checks passed
@KannuSingh KannuSingh deleted the fix/missing-setProvider-on-wagmi-adapter branch October 9, 2024 20:38
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