Move eth_sendTransaction method handler to a separate module#5968
Merged
Move eth_sendTransaction method handler to a separate module#5968
eth_sendTransaction method handler to a separate module#5968Conversation
Gudahtt
commented
Mar 15, 2023
Gudahtt
commented
Mar 15, 2023
16fae8d to
fed001a
Compare
The method handler for `eth_sendTransaction` has been moved to a separate module to simplify unit testing. Unit tests have been added as well. This module was written in TypeScript, which asked for some additional validation of the method parameters. We now throw a more explicit message when the params are missing, and when the transaction parameters are not an object. Previously the method would still throw an error in these scenarios, just with a less helpful message. The change in error message should be the only functional change here. This refactor is intended to make testing PR #5619 easier.
fed001a to
0c17e7c
Compare
The Metro configuration has been updated to support `.cjs` file extensions. The `@metamask/utils` dependency relies upon the library `superstruct` which uses `.cjs` for its main exported module.
Gudahtt
commented
Mar 15, 2023
Cal-L
approved these changes
Mar 15, 2023
Contributor
Cal-L
left a comment
There was a problem hiding this comment.
Really clean implementation. LGTM
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Development & PR Process
release-xxlabel to identify the PR slated for a upcoming release (will be used in release discussion)needs-dev-reviewlabel when work is completedneeds-qalabel when dev review is completedQA Passedlabel when QA has signed offDescription
The method handler for
eth_sendTransactionhas been moved to a separate module to simplify unit testing. Unit tests have been added as well.This module was written in TypeScript, which asked for some additional validation of the method parameters. We now throw a more explicit message when the params are missing, and when the transaction parameters are not an object. Previously the method would still throw an error in these scenarios, just with a less helpful message. The change in error message should be the only functional change here.
Issue
This refactor is intended to make testing PR #5619 easier.
Checklist