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: improve add network fields checkers #10123

Merged
merged 7 commits into from
Aug 12, 2024

Conversation

salimtb
Copy link
Contributor

@salimtb salimtb commented Jun 26, 2024

Description

This PR complete the add custom network Flow

Chain Name and ChainID Match: The system should validate that the chain name provided by the user matches the corresponding network chainId. This can be done by comparing the input against a predefined list of known chain names and their associated chainIds.

Valid rpcURL: The rpcURL provided should be verified against a list of known providers. This ensures that the rpcURL is not only valid but also corresponds to a trusted source.

Unique rpcURL: The system must ensure that the rpcURL provided is not already associated with another added network within the system. This can be achieved by checking the new rpcURL against a database or list of rpcURLs already associated with existing networks.

Unique ChainID and rpcURL Combination: The combination of chainID and rpcURL should be unique and not duplicated in another existing network within the system. This requires a check against existing combinations to ensure no duplicates are allowed.

Suggest Correct Network Name and Symbol: If the network name or symbol provided does not match the expected values (based on the chainId or other validation logic), the system should suggest the correct network name and symbol. This could involve providing a dropdown list of valid names/symbols based on the chainId or implementing a correction suggestion mechanism.

Open in GitHub Codespaces

Related issues

Fixes: #10564

Manual testing steps

  1. add the line export MM_NETWORK_UI_REDESIGN_ENABLED="1" to your .js.env
  2. execute the command source .js.env
  3. Run the command yarn watch:clean
  4. run the command yarn start:ios
  5. Click on the network button
  6. click on add/edit network a check the acceptance criteria above

Screenshots/Recordings

Before

After

1 2 3 4 5 6

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@salimtb salimtb added team-assets INVALID-PR-TEMPLATE PR's body doesn't match template needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. labels Jun 26, 2024
@salimtb salimtb requested a review from a team as a code owner June 26, 2024 15:07
@salimtb salimtb marked this pull request as draft June 26, 2024 15:07
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot removed the INVALID-PR-TEMPLATE PR's body doesn't match template label Jun 26, 2024
@salimtb salimtb added the Run Smoke E2E Triggers smoke e2e on Bitrise label Jun 26, 2024
Copy link
Contributor

github-actions bot commented Jun 26, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 9f4befd
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/28057fd7-004c-420a-bfa2-66566c8af4dc

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@salimtb salimtb removed the Run Smoke E2E Triggers smoke e2e on Bitrise label Jul 9, 2024
@salimtb salimtb force-pushed the salim/add-custom-form-check-alerts branch 6 times, most recently from 5cb9419 to 89c2508 Compare July 10, 2024 09:56
@salimtb salimtb force-pushed the salim/add-custom-form-check-alerts branch 3 times, most recently from 077eeaa to 4b32b82 Compare August 8, 2024 11:05
@salimtb salimtb force-pushed the salim/add-custom-form-check-alerts branch 2 times, most recently from 48a6c58 to 9865eb6 Compare August 9, 2024 10:21
@salimtb salimtb force-pushed the salim/add-custom-form-check-alerts branch from 9865eb6 to 6af4857 Compare August 9, 2024 10:24
@salimtb salimtb added the Run Smoke E2E Triggers smoke e2e on Bitrise label Aug 9, 2024
@salimtb salimtb marked this pull request as ready for review August 9, 2024 15:07
@salimtb salimtb removed the Run Smoke E2E Triggers smoke e2e on Bitrise label Aug 12, 2024
@salimtb salimtb added the Run Smoke E2E Triggers smoke e2e on Bitrise label Aug 12, 2024
@salimtb salimtb added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Aug 12, 2024
Copy link
Contributor

github-actions bot commented Aug 12, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: b33b149
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/e3b59d0b-c510-44d9-9f8a-db19a2537d89

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Copy link

@salimtb salimtb added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Aug 12, 2024
@MetaMask MetaMask deleted a comment from github-actions bot Aug 12, 2024
@MetaMask MetaMask deleted a comment from github-actions bot Aug 12, 2024
Copy link
Contributor

github-actions bot commented Aug 12, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 1288ff7
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/2196aa1d-123e-46ba-a8e3-a494e7e1d128

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Copy link
Contributor

@tommasini tommasini left a comment

Choose a reason for hiding this comment

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

LGTM! Awesome!

@salimtb salimtb merged commit de5ca5f into main Aug 12, 2024
41 checks passed
@salimtb salimtb deleted the salim/add-custom-form-check-alerts branch August 12, 2024 12:51
@github-actions github-actions bot locked and limited conversation to collaborators Aug 12, 2024
@metamaskbot metamaskbot added the release-7.30.0 Issue or pull request that will be included in release 7.30.0 label Aug 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. release-7.30.0 Issue or pull request that will be included in release 7.30.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-assets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New Network informations checker
3 participants