Skip to content

Remove isCustomNetwork - #1199

Merged
Gudahtt merged 2 commits into
mainfrom
remove-is-custom-network
Apr 18, 2023
Merged

Remove isCustomNetwork#1199
Gudahtt merged 2 commits into
mainfrom
remove-is-custom-network

Conversation

@Gudahtt

Copy link
Copy Markdown
Member

Description

The network controller state isCustomNetwork has been removed. This state was redundant; you can determine whether the current selected network is custom or not by checking the providerConfig state.

The one usage of this state in other packages was the transaction controller. It has been updated to use the provider configuration state instead.

Changes

  • BREAKING: Remove isCustomNetwork state
    • To check whether the current selected network is a custom network or not, check the providerConfig.type property. If it's set to NetworkType.rpc then it's a custom network, otherwise it's a built-in network.

References

Closes#1020

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation for new or updated code as appropriate (note: this will usually be JSDoc)
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

@Gudahtt

This comment was marked as resolved.

Base automatically changed from replace-network-with-network-status to mainApril 18, 2023 19:23
@Gudahtt
Gudahttforce-pushed the remove-is-custom-network branch from 96f4fec to 465879cCompareApril 18, 2023 19:24
@Gudahtt
Gudahtt marked this pull request as ready for review April 18, 2023 19:26
@Gudahtt
Gudahtt requested a review from a team as a code ownerApril 18, 2023 19:26
The network controller state `isCustomNetwork` has been removed. This
state was redundant; you can determine whether the current selected
network is custom or not by checking the `providerConfig` state.
The one usage of this state in other packages was the transaction
controller. It has been updated to use the provider configuration state
instead.
Closes#1020
@Gudahtt
Gudahttforce-pushed the remove-is-custom-network branch from 465879c to 6acbeb0CompareApril 18, 2023 19:29

@mcmiremcmire left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Just one thing but otherwise looks good.

Comment threadpackages/network-controller/src/NetworkController.ts
@Gudahtt
Gudahtt merged commit c8c9f38 into mainApr 18, 2023
@Gudahtt
Gudahtt deleted the remove-is-custom-network branch April 18, 2023 19:46
@legobeatlegobeat mentioned this pull request Apr 25, 2023
Sign up for freeto 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.

NetworkController API normalization: Replace network state with networkStatus state and delete isCustomNetwork state

2 participants

@Gudahtt@mcmire