Skip to content

Commit

Permalink
fix: Fix race condition validating ERC20 transfer (blockaid) (#28487)
Browse files Browse the repository at this point in the history
<!--
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**
Fixed race condition when validating ERC20 transfer and enabled ERC20
transfer blockaid e2e.

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

## **Related issues**

Fixes: #28434

## **Manual testing steps**

1. Go to this the test dapp
2. Click and reject (fast ) all types of requests in the section: PPOM -
Malicious Transactions and Signatures
3. Should not get stuck in the loader

## **Screenshots/Recordings**

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

### **Before**

[all PPOM
signatures.webm](https://github.com/user-attachments/assets/b59a965a-f5e9-44e6-93a5-9058cd164933)

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

### **After**

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

## **Pre-merge author checklist**

- [x] 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).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] 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.
  • Loading branch information
vinistevam authored and danjm committed Nov 15, 2024
1 parent d3846fb commit 7eaeff7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/scripts/lib/ppom/security-alerts-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async function request(endpoint: string, options?: RequestInit) {
);
}

return response.json();
return await response.json();
}

function getUrl(endpoint: string) {
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -5133,7 +5133,7 @@ export default class MetamaskController extends EventEmitter {
securityAlertId,
securityAlertResponse,
) {
updateSecurityAlertResponse({
await updateSecurityAlertResponse({
appStateController: this.appStateController,
method,
securityAlertId,
Expand Down

0 comments on commit 7eaeff7

Please sign in to comment.