Skip to content

fix!(keyring-eth-trezor): change addAccounts to return new accounts only - #64

Merged
mikesposito merged 3 commits into
mainfrom
mikesposito/add-accounts-trezor
Oct 2, 2024
Merged

mikesposito merged 3 commits into
mainfrom
mikesposito/add-accounts-trezor

Conversation

@mikesposito

@mikesposito mikesposito commented Sep 30, 2024 •

Copy link
Copy Markdown
Member

The addAccounts method should return newly create accounts, instead of all the accounts present in the keyring.

Related: https://github.com/MetaMask/accounts-planning/issues/615

Examples

@mikesposito
mikesposito requested a review from a team as a code owner September 30, 2024 11:55
@ccharly ccharly changed the title fix: Trezor addAccounts returns new accounts only fix!(keyring-eth-trezor): make addAccounts return new accounts only Oct 1, 2024
@ccharly ccharly changed the title fix!(keyring-eth-trezor): make addAccounts return new accounts only fix!(keyring-eth-trezor): change addAccounts to return new accounts only Oct 1, 2024
Comment thread packages/keyring-eth-trezor/src/trezor-keyring.test.ts Outdated
@mikesposito
mikesposito added this pull request to the merge queue Oct 2, 2024
Merged via the queue into main with commit d57e312 Oct 2, 2024
@mikesposito
mikesposito deleted the mikesposito/add-accounts-trezor branch October 2, 2024 13:12
github-merge-queue Bot pushed a commit to MetaMask/metamask-extension that referenced this pull request Jan 9, 2025
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

This PR bumps `@metamask/eth-trezor-keyring` from `^3.1.3` to `^6.0.0`. 

```
## [6.0.0]

### Added

- **BREAKING:** Add ESM build ([#40](MetaMask/accounts#40))
  - It's no longer possible to import files from `./dist` directly.

## [5.0.0]

### Changed

- **BREAKING**: Bump `@metamask/eth-sig-util` dependency from `^7.0.3` to `^8.0.0` ([#79](MetaMask/accounts#79))
  - `signTypedData` no longer support `number` for addresses, see [here](https://github.com/MetaMask/eth-sig-util/blob/main/CHANGELOG.md#800).

## [4.0.0]

### Changed

- **BREAKING**: `addAccounts` will now only return newly created accounts ([#64](MetaMask/accounts#64))
  - This keyring was initially returning every accounts (previous and new ones), which is different from what is expected in the [`Keyring` interface].(https://github.com/MetaMask/utils/blob/v9.2.1/src/keyring.ts#L65)
```

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/27689?quickstart=1)

## **Related issues**

Fixes:

## **Manual testing steps**

These changes directly impact Trezor devices:
1. Add one or more Trezor accounts
2. Sign message
3. Sign typed data
4. Sign transaction
5. Remove Trezor accounts

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.
montelaidev pushed a commit that referenced this pull request Sep 21, 2026
… only (#64)

<!--
Thanks for your contribution! Take a moment to answer these questions so
that reviewers have the information they need to properly understand
your changes:

* What is the current state of things and why does it need to change?
* What is the solution your changes offer and how does it work?

Are there any issues or other links reviewers should consult to
understand this pull request better? For instance:

* Fixes #12345
* See: #67890
-->

The `addAccounts` method should return newly create accounts, instead of
all the accounts present in the keyring.

Related: MetaMask/accounts-planning#615

## Examples

<!--
Are there any examples of this change being used in another repository?

When considering changes to the MetaMask module template, it's strongly
preferred that the change be experimented with in another repository
first. This gives reviewers a better sense of how the change works,
making it less likely the change will need to be reverted or adjusted
later.
-->

---------

Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net>
Sign up for free to 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.

2 participants