MetaMask / test-dapp

The sample dapp used for e2e testing and metamask-extension QA
https://metamask.github.io/test-dapp/
MIT License
597 stars 349 forks source link

Add Malformed Transactions #295

Closed seaona closed 7 months ago

seaona commented 8 months ago

Description

Similarly to the Add Malformed Signatures PR, in this PR we are adding Malformed Transactions. It consists on the following:

Screenshots

Screenshot from 2024-03-06 15-16-06

https://github.com/MetaMask/test-dapp/assets/54408225/521afb82-9162-49de-8bc4-b121cb840105

Manual QA

  1. Try Invalid Value Type --> you will see the error correctly displayed in the dapp
  2. Try Invalid Transaction Type --> warning: if you accept, you will encounter the issue mentioned in the description: having an unapproved tx on state, and unable to clean it
  3. Try Send with Odd Hex Data --> you will see data is still not normalized, since the issue is still not fixed in prod
  4. Try Approve with Odd Hex Data --> you will see that hex data is still not normalized and the fallback contract interaction screen appears (no Approve screen), since the issue is still not fixed in prod
  5. Try Invalid Recipient --> you will see the error correctly displayed in the dapp
  6. Try Invalid Gas Limit --> you will see a predefault gas limit set and MM does not break
  7. Try Invalid Max Gee per Gas --> you will see that MM breaks with the error mentioned in the description
seaona commented 7 months ago

thank you for the reviews :heart: @digiwand I've added the comments in the code as you suggested :pray: