-
Notifications
You must be signed in to change notification settings - Fork 5.2k
feat: account tag enhancement & uppercase for OneKey labels #29999
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
Conversation
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. |
No dependency changes detected. Learn more about Socket for GitHub ↗︎ 👍 No dependency changes detected in pull request |
@@ -50,7 +50,7 @@ class AccountList extends Component { | |||
<div className="hw-connect__hdPath"> | |||
<Dropdown | |||
className="hw-connect__hdPath__select" | |||
options={hdPaths[device.toLowerCase()]} | |||
options={hdPaths[device]} |
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.
Setting device name to lowercase would fail checking hdPaths for device with camel case naming. So far, there's apparently no need to do so for other devices.
app/scripts/metamask-controller.js
Outdated
keyringBridge?.minorVersion === ONE_KEY_VIA_TREZOR_MINOR_VERSION | ||
? HardwareKeyringType.oneKey | ||
: HardwareKeyringType[keyringType], | ||
({ type }) => HardwareKeyringType[type], |
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.
No need anymore to rely on ONE_KEY_VIA_TREZOR_MINOR_VERSION
as OneKey gets its own keyring type.
This PR adds support for a dedicated OneKey keyring (until now it was sharing the same keyring instance than Trezor) so it's considered as a standalone device and could get its own tag inside account list. There are two others PRs: - metamask-extension: MetaMask/metamask-extension#29999 - core (accounts and keyring controllers): MetaMask/core#5216 Fixes: MetaMask/accounts-planning#793
## Explanation This PR adds support for a dedicated OneKey keyring (until now it was sharing the same keyring instance than Trezor) so it's considered as a standalone device and could get its own tag inside account list. There are two others PRs: - metamask-extension: MetaMask/metamask-extension#29999 - eth-trezor-keyring: MetaMask/accounts#175 ## References Fixes: MetaMask/accounts-planning#793 ## Changelog <!-- If you're making any consumer-facing changes, list those changes here as if you were updating a changelog, using the template below as a guide. (CATEGORY is one of BREAKING, ADDED, CHANGED, DEPRECATED, REMOVED, or FIXED. For security-related issues, follow the Security Advisory process.) Please take care to name the exact pieces of the API you've added or changed (e.g. types, interfaces, functions, or methods). If there are any breaking changes, make sure to offer a solution for consumers to follow once they upgrade to the changes. Finally, if you're only making changes to development scripts or tests, you may replace the template below with "None". --> ### `@metamask/accounts-controller` - **utils**: add OneKey keyring type - **tests**: update accounts controller unit test with OneKey keyring type ### `@metamask/keyring-controller` - **controller**: add OneKey keyring type ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've highlighted breaking changes using the "BREAKING" category above as appropriate - [x] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes
8989dc1
to
0c19260
Compare
@metamaskbot update-policies |
Policies updated. 🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff |
Builds ready [0519154]
Page Load Metrics (1677 ± 61 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [0a6bdec]
Page Load Metrics (1872 ± 88 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
0a6bdec
to
e6a980d
Compare
Builds ready [71aeb1c]
Page Load Metrics (2081 ± 136 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
e3791ae
to
3b41bf8
Compare
Builds ready [3b41bf8]
Page Load Metrics (1685 ± 53 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [64da565]
Page Load Metrics (1522 ± 64 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
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.
Since we use the same Keyring as Trezor (and even the same bridge), do you think we can take advantage of Trezor e2e tests as well?
@mikesposito Yep definitely, we need to plan it on a separate pull request 👍 |
Builds ready [48cae93]
Page Load Metrics (1667 ± 59 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
48cae93
to
3bdbc76
Compare
11194aa
to
a55dbcc
Compare
Builds ready [c828db9]
Page Load Metrics (2310 ± 252 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
af5b03c
to
9549f08
Compare
Builds ready [9549f08]
Page Load Metrics (6499 ± 3971 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
38feb39
to
9bc12b1
Compare
Builds ready [9bc12b1]
Page Load Metrics (6304 ± 3477 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
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.
Code LGTM, haven't tested since I don't have neither devices. Also, assuming the removal of .toLowerCase
won't have undesired side-effects 😄 (but I'd say no)
9bc12b1
to
1cb2ae5
Compare
Thanks! I just tested ledger, Trezor, OneKey and Lattice devices and could not see any regression. |
Builds ready [b599f0b]
Page Load Metrics (2409 ± 1280 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
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.
Looks good!
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.
LGTM after Gustova and Charly review
Description
This PR adds support for a dedicated OneKey keyring (until now it was sharing the same keyring instance than Trezor) so it's considered as a standalone device and could get its own tag inside account list.
There are two others PRs:
Related issues
Fixes: https://github.com/MetaMask/accounts-planning/issues/793
Manual testing steps
You need both OneKey and Trezor devices to test. Trezor device can be replaced by this simulator.
⚠️ Simulator takes over other devices, you need to disconnect first it if you import a OneKey account.
Screenshots/Recordings
Before
onekey-before.mp4
After
onekey-after.mp4
Pre-merge author checklist
Pre-merge reviewer checklist