-
-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance transaction validation with standardized RPC errors (#1690)
## Explanation This PR aims to update the `TransactionController` to throw standardised `rpcErrors.invalidParams` errors using the `@metamask/rpc-errors` package that will ensure they are standardised and more easily parsed and recognised by the dApps. **Context** The extension `TransactionController` uses the `eth-rpc-errors` package to throw standardised errors when validation fails. This update is a part of the ongoing TransactionController unification effort. Note: As the colleagues pointed out in this PR `eth-rpc-errors` is deprecated so for equivalence the `@metamask/rpc-errors` package was added in the `TransactionController` and usages in the code was replaced accordingly. Bump `@metamask/rpc-errors` to v6 in `transaction-controller` and `assets-controller`. ### `@metamask/transaction-controller` - **CHANGED**: update `validateTxParams` to throw standardised errors using the `@metamask/rpc-errors` package. - add `@metamask/rpc-errors` package. - remove `eth-rpc-errors` and replace usage with the new package.
- Loading branch information
1 parent
ff9e2b3
commit 762882d
Showing
9 changed files
with
73 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters