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

refactor: Simplify isMainnet utility function #6664

Merged
merged 1 commit into from
Jun 21, 2023

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Jun 21, 2023

Development & PR Process

  1. Follow MetaMask Mobile Coding Standards
  2. Add release-xx label to identify the PR slated for a upcoming release (will be used in release discussion)
  3. Add needs-dev-review label when work is completed
  4. Add needs-qa label when dev review is completed
  5. Add QA Passed label when QA has signed off

Description

The isMainnet utility function used to accept either a network controller state object or a chain ID. Now it only accepts a chain ID. The one place where the network controller state was passed in has been updated to pass in a chain ID instead.

A JSDoc comment has been added for this utility function as well.

Issue

Relates to https://github.com/MetaMask/mobile-planning/issues/1016

Checklist

  • There is a related GitHub issue
  • Tests are included if applicable
  • Any added code is fully documented

@Gudahtt Gudahtt added the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Jun 21, 2023
@Gudahtt Gudahtt requested a review from a team as a code owner June 21, 2023 18:37
The `isMainnet` utility function used to accept either a network
controller state object or a chain ID. Now it only accepts a chain ID.
The one place where the network controller state was passed in has been
updated to pass in a chain ID instead.

A JSDoc comment has been added for this utility function as well.

Relates to MetaMask/mobile-planning#1016
@Gudahtt Gudahtt force-pushed the simplify-is-mainnet-utility-function branch from b85cb7d to 03c8482 Compare June 21, 2023 19:01
@sonarcloud
Copy link

sonarcloud bot commented Jun 21, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

50.0% 50.0% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@sethkfman sethkfman left a comment

Choose a reason for hiding this comment

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

LGTM

@Gudahtt Gudahtt added No QA Needed/E2E Only Apply this label when your PR does not need any QA effort. and removed needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) labels Jun 21, 2023
@Gudahtt Gudahtt merged commit af23c2b into main Jun 21, 2023
13 checks passed
@Gudahtt Gudahtt deleted the simplify-is-mainnet-utility-function branch June 21, 2023 22:07
@github-actions github-actions bot locked and limited conversation to collaborators Jun 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
No QA Needed/E2E Only Apply this label when your PR does not need any QA effort.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants