-
Notifications
You must be signed in to change notification settings - Fork 920
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
Show test networks separately #19467
Conversation
} else if (WalletConstants.KNOWN_TEST_CHAIN_IDS.contains( | ||
networkInfo.chainId)) { | ||
test.add(networkInfo); | ||
} else if (!WalletConstants.SUPPORTED_TOP_LEVEL_CHAIN_IDS.contains( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can just do else { ...
without conditions check as they always pass on that stage because of 2 conditions above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just a matter of taste, but I would probably add a forth else
where we log an error (as it should never happen), or throw an exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replaced with else
d194853
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strings
++
@@ -65,6 +64,7 @@ public class NetworkModel implements JsonRpcServiceObserver { | |||
private final MediatorLiveData<List<NetworkInfo>> _mPrimaryNetworks; | |||
private final MediatorLiveData<List<NetworkInfo>> _mSecondaryNetworks; | |||
private Map<String, NetworkSelectorModel> mNetworkSelectorMap; | |||
private MutableLiveData<NetworkLists> _mNetworkLists; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be final
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated d194853
@@ -65,6 +64,7 @@ public class NetworkModel implements JsonRpcServiceObserver { | |||
private final MediatorLiveData<List<NetworkInfo>> _mPrimaryNetworks; | |||
private final MediatorLiveData<List<NetworkInfo>> _mSecondaryNetworks; | |||
private Map<String, NetworkSelectorModel> mNetworkSelectorMap; | |||
private MutableLiveData<NetworkLists> _mNetworkLists; | |||
private OriginInfo mOriginInfo; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mOriginInfo
is unused and can be safely removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated d194853
@@ -76,6 +76,7 @@ public class NetworkModel implements JsonRpcServiceObserver { | |||
public final LiveData<NetworkInfo> mDefaultNetwork; | |||
public final LiveData<List<NetworkInfo>> mPrimaryNetworks; | |||
public final LiveData<List<NetworkInfo>> mSecondaryNetworks; | |||
public LiveData<NetworkLists> mNetworkLists; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be final
as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated d194853
} else if (WalletConstants.KNOWN_TEST_CHAIN_IDS.contains( | ||
networkInfo.chainId)) { | ||
test.add(networkInfo); | ||
} else if (!WalletConstants.SUPPORTED_TOP_LEVEL_CHAIN_IDS.contains( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just a matter of taste, but I would probably add a forth else
where we log an error (as it should never happen), or throw an exception.
@@ -43,7 +43,6 @@ | |||
import java.util.HashMap; | |||
import java.util.List; | |||
import java.util.Map; | |||
import java.util.Set; | |||
import java.util.stream.Collectors; | |||
|
|||
public class NetworkModel implements JsonRpcServiceObserver { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getSubTestNetworks
method is unused and can be safely removed now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated d194853
Show test networks separately (#19467) * Implement test network in separate section * Collect networks as list * Show network icon and remove default icon * Fix eth icon flasing and add null check * Update blockie size and clean up * Minor review changes
Verification passed on Oppo Reno 5 with Android 13 running 1.58.77
19467.mp4 |
Resolves brave/brave-browser#31815
Resolves brave/brave-browser#31610
Resolves brave/brave-browser#24244
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run lint
,npm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
test-network-section.webm