MetaMask / MetaMask/metamask-mobile

Approval Refactor Plan

Open
#6,011 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

team-confirmations-planning type-refactor
Dominant language
TypeScript
Stars
3k
Forks
1.7k
Avg merge
1d 14h
Merged PRs (30d)
669

Description

### **Description**
The refactoring of the approval flow has been up for some time, reviewed and approved but all in one [PR](https://github.com/MetaMask/metamask-mobile/pull/5412). Given its complexity and lots of code changes, it'll take a lot of QA time to cover all use case without a plan. It also touches core parts of the app and has to be done right. It'll also be difficult to maintain with main when QA/dev issues are found. The approval flow covers the EIP1559 dapp transactions and legacy transactions. In the approval confirmation modal, we handle transaction review logic and the edit gas logic. This will be broken into multiple PRs so it's properly tested and understood.

Legacy Transaction has both transaction review and edit gas logic
EIP1559 Transaction has both transaction review and edit has logic

ToDo:
* [ ] Legacy Transaction - Transaction Review. This will cover files in `views/approval`, `ui/transactionEditor`, `ui/transactionReview`, and any related
* [ ] Legacy Transaction - EditGas. This will cover `ui/editGasFeeLegacy`
* [ ] EIP1559 Transaction - Transaction Review.
* [ ] EIP1559 Transaction - EditGas.

Test Case
1. Using MM testdapp, test the following shouldn't break and include screen recording. _should cover eip1559 and legacy_
* Create a token
* Transfer the token
* Deploy a contract
* Send transactions
2. Test using popular dapps as well

### **Technical Details**

- Include additional test case
- Where possible, rewrite in TypeScript.
- Etc.

### **Acceptance Criteria**

- Are metrics required?
- Are translations required?
- Cases to satisfy
- XYZ should work
- Etc.

Scenario: xxxx
- GIVEN a user is in x state
- WHEN a user does x
- AND a user does x
- THEN x should occur

### **References**

- References go here.
- Issue numbers. Links.
- Slack threads.
- Etc.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the approval flow areas in views/approval, ui/transactionEditor, ui/transactionReview, and ui/editGasFeeLegacy, then map the legacy and EIP1559 review and gas-edit paths. Use MM testdapp and popular dapps to exercise token creation, token transfers, contract deployment, and sends for both transaction types. Done means the work is split into tested PRs with screen recordings and no regressions in these cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
blockchain, mobile
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.