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

Merge master to v12.6.0 after the merge of 12.5.1 to master #28217

Merged
merged 9 commits into from
Oct 31, 2024

Conversation

danjm
Copy link
Contributor

@danjm danjm commented Oct 31, 2024

This PR syncs 12.6.0 with master following the merge of 12.5.1 to master

metamaskbot and others added 7 commits October 24, 2024 23:00
Cherry-picks #28136
(1fd9510). Original PR description:

## **Description**

Fixes an issue where token balance showed as 0 during send flow. This
occurred when clicking the token in the token list, then clicking the
send button from the token details page.

When going send first and then picking a token, picking `decimals` was a
number:



![image](https://github.com/user-attachments/assets/95d32a68-1076-4050-b129-187672694794)

But when going token first and then clicking send , `decimals` was a
string and skipped calculating the balance.



![image](https://github.com/user-attachments/assets/99a8fcd4-bd29-4969-b98d-6639d50553ff)


`calcTokenAmount` seems to work with either string or number, so
changing logic from
#27083 which
introduced the number check


[![Open in GitHub

Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/28136?quickstart=1)

## **Related issues**

Fixes: #28112

## **Manual testing steps**

1. Click on an erc20 token on the token list
2. Click the send button on the token details page
3. Choose a destination account
4. The balance under the asset picker should be accurate

## **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.


<!--
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**

<!--
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/28151?quickstart=1)

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **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.

Co-authored-by: Brian Bergeron <brian.e.bergeron@gmail.com>
Cherry-picks #28145
to v12.5.1, and brings
#28177 into v12.5.1
as well. The latter originally targeted v12.6.0, but we need it for a
hotfix ahead of that. The PR description for that was:

## **Description**

Forcing resolutions to fix `yarn audit` warnings and more specifically
this issue:
- GHSA-584q-6j8j-r5pm

I decided to be very explicit about the resolution itself based on the
output of:
```console
$ yarn why secp256k1
├─ ethereum-cryptography@npm:0.1.3
│  └─ secp256k1@npm:4.0.4 (via npm:^4.0.1)
│
├─ ganache@npm:7.9.2
│  └─ secp256k1@npm:4.0.3 (via npm:4.0.3)
│
├─ ganache@patch:ganache@npm%3A7.9.2#~/.yarn/patches/ganache-npm-7.9.2-a70dc8da34.patch::version=7.9.2&hash=7d7c66
│  └─ secp256k1@npm:4.0.3 (via npm:4.0.3)
│
├─ gridplus-sdk@npm:2.5.1
│  └─ secp256k1@npm:4.0.2 (via npm:4.0.2)
│
└─ hdkey@npm:2.1.0
   └─ secp256k1@npm:4.0.4 (via npm:^4.0.0)
```

We could also have a more straightforward resolution like:
```json
  ...
  "resolutions": {
    ...
    "secp256k1": "4.0.4"
  }
  ...
```

But that could also catch version with different major.

Let me know what would be the preferred solution here.

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

## **Related issues**

Fixes: GHSA-584q-6j8j-r5pm

## **Manual testing steps**

N/A

## **Screenshots/Recordings**

### **Before**

### **After**

## **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.

---------

Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net>
Co-authored-by: sahar-fehri <sahar.fehri@consensys.net>
This PR cherry-picks
2c86162#diff-63ab7391d870a62d8bcd3cc5d5371432068538deb98e5effcb899434ed8649bb

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
Co-authored-by: Matthew Walsh <matthew.walsh@consensys.net>
@danjm danjm requested review from a team as code owners October 31, 2024 14:02
Copy link
Contributor

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.

@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Oct 31, 2024
Copy link

socket-security bot commented Oct 31, 2024

Removed dependencies detected. Learn more about Socket for GitHub ↗︎

🚮 Removed packages: npm/secp256k1@4.0.3

View full report↗︎

@danjm
Copy link
Contributor Author

danjm commented Oct 31, 2024

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Policies updated.
👀 Please review the diff for suspicious new powers.

🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff

@metamaskbot metamaskbot requested a review from a team as a code owner October 31, 2024 14:38
Copy link
Contributor

@hjetpoluru hjetpoluru left a comment

Choose a reason for hiding this comment

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

LGTM, we could fix the data-deletion with separate cherry-pick PR.

@danjm danjm merged commit e7e049a into Version-v12.6.0 Oct 31, 2024
69 of 70 checks passed
@danjm danjm deleted the v12.6.0-merge-master-12.5.1 branch October 31, 2024 17:54
@github-actions github-actions bot locked and limited conversation to collaborators Oct 31, 2024
@metamaskbot metamaskbot added the release-12.6.0 Issue or pull request that will be included in release 12.6.0 label Nov 1, 2024
@metamaskbot
Copy link
Collaborator

No release label on PR. Adding release label release-12.6.0 on PR, as PR was added to branch 12.6.0 when release was cut.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
INVALID-PR-TEMPLATE PR's body doesn't match template release-12.6.0 Issue or pull request that will be included in release 12.6.0 team-extension-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants