Skip to content

Conversation

@nikoferro
Copy link

This patches web3 import so it works both on the unit test environment, and the actual react native app environment

@nikoferro nikoferro requested a review from a team June 7, 2024 13:01
nikoferro added a commit to MetaMask/metamask-mobile that referenced this pull request Jun 10, 2024
## **Description**

- Upgrade `@metamask/swaps-controller` from v8 to v9
  - Remove redundant patches 

Resolves a bunch of outstanding legacy, including `web-provider-engine`.

Also enables Base Network for Swaps.

## **Related issues**

- #9286 `@metamask/swaps-controller`
  - v8 upgrade 
- #9612
  - reverted v8 upgrade 
- MetaMask/swaps-controller#241
  - fixed issue that motivated revert of v8 upgrade 

#### Blocked by
- [x] MetaMask/swaps-controller#245
  - [x] MetaMask/swaps-controller#219

This PR also patches `swaps-controller@9.0.0` to fix the `web3` import
that works differently between the test environment and the actual
mobile app / E2E test environment. This should be removed once a
`swaps-controller` version addressing this is published.
(MetaMask/swaps-controller#255)

## **Manual testing steps**

Regression over swaps functionality in the 4 different scenarios:

ETH -> WETH
WETH -> ETH
ETH -> ERC20
ERC20 -> ETH

## **Screenshots/Recordings**

### **Before**

### **After**

![1](https://github.com/MetaMask/metamask-mobile/assets/8658960/894a8d06-e23c-4da1-a081-dd711b37de04)

![2](https://github.com/MetaMask/metamask-mobile/assets/8658960/064d5615-b4a0-4f15-8063-9ca60062d28c)

![3](https://github.com/MetaMask/metamask-mobile/assets/8658960/9f459e50-2840-4168-b7e5-e3526df4d957)

![4](https://github.com/MetaMask/metamask-mobile/assets/8658960/cd770b39-4d35-4725-aa49-0e84e51e72ac)

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] 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-mobile/blob/main/.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).
- [x] 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: nikoferro <nicolaspatricioferro@gmail.com>
@infiniteflower infiniteflower merged commit 244a336 into main Jul 2, 2024
@infiniteflower infiniteflower deleted the web3-patch branch July 2, 2024 15:46
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.

3 participants