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

chore: Refactor NetworkController #2949

Merged
merged 14 commits into from
Oct 4, 2024
Merged

Conversation

tomiir
Copy link
Collaborator

@tomiir tomiir commented Sep 26, 2024

Description

Please include a brief summary of the change.

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

vercel bot commented Sep 26, 2024

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

Name Status Preview Updated (UTC)
appkit-laboratory 🛑 Canceled (Inspect) Oct 4, 2024 6:15pm
web3modal-gallery ✅ Ready (Inspect) Visit Preview Oct 4, 2024 6:15pm

Copy link

changeset-bot bot commented Sep 26, 2024

⚠️ No Changeset found

Latest commit: 46b3421

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link
Contributor

github-actions bot commented Sep 26, 2024

Coverage Report for Coverage

Status Category Percentage Covered / Total
🔵 Lines 245.16% 4182 / 18773
🔵 Statements 245.16% 4182 / 18773
🔵 Functions 261.34% 326 / 996
🔵 Branches 312.22999999999996% 583 / 1249
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
packages/appkit/exports/index.ts 0% 0% 0% 0% 1, 3-4, 7, 10, 17-26
packages/appkit/exports/react.ts 0% 0% 0% 0% 1, 3-5, 8, 11, 14, 19, 23-34, 36-37, 43
packages/appkit/exports/vue.ts 0% 0% 0% 0% 1, 3-5, 8, 11, 14, 19, 23-34, 36-37, 43
packages/appkit/src/client.ts 82.33% 73.95% 87.17% 82.33% 85-86, 105-106, 109-110, 113-114, 117-120, 123-126, 129-130, 251, 259, 297-300, 306, 401, 403-405, 408-409, 411-413, 428, 430-431, 445-446, 461-462, 465-466, 469-470, 479-481, 490, 524-528, 532, 541-553
packages/appkit/src/universal-adapter/client.ts 57.2% 45.76% 53.12% 57.2% 97-98, 106-110, 128-129, 132, 137-138, 140-142, 151-155, 157-159, 161-163, 165-167, 169-174, 176, 178-187, 189, 191-194, 196-201, 203, 205, 207-210, 223-225, 234-236, 238-240, 242-245, 247-248, 290-295, 299-304, 314, 316-319, 325-330, 332-333, 336-337, 339-348, 350, 352-353, 370-371, 373-378, 406-407, 409, 414-415, 437-438, 450-453, 455, 457-459, 462-465, 469-470, 472-481, 483-484, 486-489, 527-531, 536-539, 556-557, 569-571, 573-588
packages/appkit/src/utils/TypesUtil.ts 100% 100% 100% 100%
packages/core/exports/index.ts 100% 100% 100% 100%
packages/core/src/controllers/ApiController.ts 91.84% 68.75% 80% 91.84% 56-57, 71-72, 129-130, 142, 180, 261-265, 281-286
packages/core/src/controllers/ChainController.ts 70.79% 59.67% 79.31% 70.79% 77-81, 84-88, 90-91, 93-101, 107-108, 135, 137-147, 151-159, 182-183, 225-232, 237-238, 258-259, 263, 265-267, 269, 271-278, 281-284, 295-297, 299-300, 303-304, 309-310, 313-314, 329-331, 333-334, 337-338, 343-344, 347-348, 364-365, 370-371, 383-384, 417, 419-422, 424-425, 464-465, 484-487, 510-511
packages/core/src/controllers/SwapController.ts 47.44% 62.5% 56.66% 47.44% 40-43, 166-167, 170-171, 180-181, 211-213, 215-216, 242, 250-252, 261-265, 269-271, 273-276, 278-279, 281-284, 287-300, 311-312, 315-316, 320-321, 329-332, 365, 372, 377, 379-381, 383-391, 393, 395-396, 405, 407, 420-421, 432-433, 443, 450-451, 455-458, 460-463, 491-492, 514-515, 529, 538-540, 542-544, 546-553, 555, 557-561, 563-564, 566-573, 575-577, 580, 582-584, 586-588, 590-601, 603-610, 612-613, 615-621, 623-625, 628-630, 632-634, 636-639, 641-648, 650, 652-653, 655-662, 664, 666-667, 669-675, 677-679, 683, 685-686, 688-698, 700-707, 709-719, 722-724, 726, 728, 730-735, 737-748, 750-759, 761-781, 783-802, 804-806, 821-822, 837-838
packages/core/src/utils/SwapApiUtil.ts 97.11% 79.16% 100% 97.11% 53-54, 107
packages/core/src/utils/TypeUtil.ts 100% 100% 100% 100%
packages/scaffold-ui/src/modal/w3m-account-button/index.ts 0% 0% 0% 0% 1, 8, 11-14, 16-17, 19, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 47-70, 72-74, 77-80, 82, 84, 86-95, 97-98, 102, 105-112
packages/scaffold-ui/src/modal/w3m-network-button/index.ts 0% 0% 0% 0% 1, 7, 9-13, 15-17, 20, 23, 25, 27, 29, 31, 33, 35, 38-60, 62-64, 67-70, 72, 75-78, 80, 84, 87-91, 93-94, 96-98, 100-102, 104-105, 107-113
packages/scaffold-ui/src/partials/w3m-account-wallet-features-widget/index.ts 0% 0% 0% 0% 1, 11-18, 20-22, 24-26, 29, 31, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52-74, 76-79, 81-83, 86-89, 91, 93, 95, 99-100, 102-104, 106-107, 110, 115, 119, 123, 131, 138-143, 145, 147, 150-151, 153-155, 157, 161, 167, 169-171, 173-182, 184-185, 187-190, 192-193, 195-196, 198-199, 201-207, 209-211, 214, 216-218, 220-222, 224-226, 228-246, 248-250, 252-264, 266-269
packages/scaffold-ui/src/partials/w3m-header/index.ts 0% 0% 0% 0% 1, 11-17, 20, 23-29, 31-88, 90-92, 95, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116-130, 132-134, 137-140, 143, 148-151, 153-157, 159-167, 169-170, 172-174, 176, 178, 180, 184, 186-187, 189, 191, 196-197, 200, 202-208, 210, 212-213, 216-218, 220, 222-223, 226-227, 229, 231-232, 235, 237, 239-244, 246-249, 251-252, 254-257, 259-260, 262-263, 265-271, 273-274, 276-302, 304-307
packages/scaffold-ui/src/partials/w3m-onramp-provider-item/index.ts 0% 0% 0% 0% 1-6, 8-10, 13, 15, 17, 19, 21, 23, 25, 28-31, 33, 37, 43, 46-48, 51, 54-56, 58, 60-61, 63, 66, 69-70
packages/scaffold-ui/src/views/w3m-account-settings-view/index.ts 0% 0% 0% 0% 1, 15-20, 22-23, 25, 27, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48-73, 75-77, 80-83, 85, 87, 92, 95-97, 103-108, 114, 120-121, 124, 127-129, 133, 136, 141-143, 151, 154-160, 162, 168-169, 175, 177-183, 185, 187, 194, 196-199, 201-202, 204-213, 215-218, 220-222, 224-229, 231, 237-239, 242, 245, 247-249, 251-258, 260-262, 264-265, 267-271, 273-276, 278-282, 284-296, 298-302
packages/scaffold-ui/src/views/w3m-email-verify-otp-view/index.ts 0% 0% 0% 0% 1-2, 12-13, 15-16, 18, 21, 23-24, 26-31, 34-39, 41-48, 50-67, 69-75
packages/scaffold-ui/src/views/w3m-network-switch-view/index.ts 0% 0% 0% 0% 1, 7-12, 14-16, 19, 21, 24, 26, 28-30, 32-34, 36-38, 41-44, 46-48, 50, 52, 55, 61, 64, 72, 78-79, 83, 86-87, 94, 97-102, 104-107, 109-114, 116-117, 119-128, 130-140
packages/scaffold-ui/src/views/w3m-networks-view/index.ts 0% 0% 0% 0% 1, 11-16, 18-20, 22, 25, 27, 29, 31, 34-39, 41-43, 46-48, 51, 55, 64, 70, 73-75, 77, 85, 87-89, 91-93, 95-98, 100-106, 108-114, 116-117, 119-120, 122-125, 128-129, 131-139, 141-143, 145-146, 148-150, 152-154, 156-162, 164-180
packages/scaffold-ui/src/views/w3m-swap-view/index.ts 0% 0% 0% 0% 1-4, 15-17, 19-21, 23, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 59-97, 99-102, 104-107, 110-113, 116, 119-125, 127-128, 131-132, 134, 137, 139-142, 144-146, 148-150, 152-154, 156-157, 159-160, 162, 167, 169-170, 175, 177, 180, 182-188, 190-192, 194-203, 205, 207-210, 212-214, 216-217, 219-221, 223-224, 226-231, 233-234, 236-239, 241-242, 244-252, 254-258, 260, 267-270, 272, 275, 277-279, 281-283, 285-287, 289-307
packages/scaffold-ui/src/views/w3m-switch-active-chain-view/index.ts 0% 0% 0% 0% 1-6, 8-10, 13, 15, 17, 19, 21, 24, 27-31, 33-35, 38-41, 43-45, 47, 49, 53, 58, 61, 65, 68, 71, 75, 78-81, 83-87, 89-94
packages/scaffold-ui/src/views/w3m-unsupported-chain-view/index.ts 0% 0% 0% 0% 1, 12, 14-18, 20-22, 25, 28, 31-32, 37, 41, 45, 54-56, 64, 67-69, 75, 77, 82, 84-86, 88-91, 93-95, 97-98, 100-102, 106-107, 109-124, 126-134, 136-147
packages/scaffold-ui/src/views/w3m-wallet-compatible-networks-view/index.ts 0% 0% 0% 0% 1-7, 9-11, 14, 17, 19-26, 28-30, 33-34, 36, 43, 45, 48-52, 54-57, 60-68, 70-71, 73-75, 79-81
packages/scaffold-ui/src/views/w3m-wallet-receive-view/index.ts 0% 0% 0% 0% 1, 9-14, 16-18, 21, 24, 26, 28, 30, 32-52, 54-56, 59-62, 64, 66, 68, 73-79, 82, 87, 92-95, 102, 104, 107-110, 112-118, 120-121, 123, 125-129, 131-132, 134, 136, 138-140, 142-152
Generated in workflow #6599 for commit 46b3421 by the Vitest Coverage Report Action

Copy link
Contributor

github-actions bot commented Sep 26, 2024

♻️ Vite-Size ♻️

Size Difference

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

Current Size

Name Size (kb) Gzip (kb)
assets/index-BMDoMERw.js 1888.52 539.661
assets/index.js 9.63 3.161
assets/index2.js 11.589 3.212
assets/w3m-modal.js 7.452 2.628
assets/noble-curves.js 31.941 12.779
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.524
index.html 0.329 0.237
Total Size 2433.18 704.93

Base Size

Name Size (kb) Gzip (kb)
assets/index-BMDoMERw.js 1888.52 539.661
assets/index.js 9.63 3.161
assets/index2.js 11.589 3.212
assets/w3m-modal.js 7.452 2.628
assets/noble-curves.js 31.941 12.779
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.524
index.html 0.329 0.237
Total Size 2433.18 704.93

@lukaisailovic
Copy link
Collaborator

@tomiir Should we merge this?

@tomiir tomiir merged commit 335e745 into main Oct 4, 2024
17 checks passed
@tomiir tomiir deleted the chore/refactor-network-controller branch October 4, 2024 18:33
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