-
-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add validation for
data
property (#1701)
## Explanation This PR aims to update the `TransactionController` to validate the `data` property from `TransationParams`. **Context** The extension `TransactionController` validates the data field if not empty by both ensuring it is a `string`, and using the `@ethersproject/abi` and `human-standard-token-abi` packages to ensure the contract data when parsed does not throw a `BUFFER_OVERRUN` error. The changes in this PR add equivalent validation to the core `TransactionController`. ## Changelog ### `@metamask/transaction-controller` - **BREAKING**: update `validateTxParams` to validate `data` from `TransactionParams` and throw when data is out-of-bounds.
- Loading branch information
1 parent
8fcb2e4
commit 93ac28e
Showing
5 changed files
with
322 additions
and
222 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
Oops, something went wrong.