Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor send transaction v2 #6060

Merged
merged 4 commits into from
Mar 29, 2023
Merged

Refactor send transaction v2 #6060

merged 4 commits into from
Mar 29, 2023

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Mar 28, 2023

Development & PR Process

  1. Follow MetaMask Mobile Coding Standards
  2. Add release-xx label to identify the PR slated for a upcoming release (will be used in release discussion)
  3. Add needs-dev-review label when work is completed
  4. Add needs-qa label when dev review is completed
  5. Add QA Passed label when QA has signed off

Description

This is a repeat of #5968, which was reverted in #6021 to fix a bug on Android. Investigation into that bug is ongoing, but it related to the @metamask/utils import. That dependency has been replaced in this PR in the most recent commit; all previous commits are identical to the previous PR (except that they have been rebased onto main).

Original description:

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.

Issue

This refactor is intended to make testing PR #5619 easier.

Checklist

  • There is a related GitHub issue
  • Tests are included if applicable
  • Any added code is fully documented

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.
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.
The two functions taken from `@metamask/utils` have been inlined as a
workaround to an error that gets thrown upon import on Android builds.

I'm still actively investigating that failure, so hopefully we can
replace these inlined functions soon.
@Gudahtt Gudahtt force-pushed the refactor-send-transaction-v2 branch from b8a5d09 to 3d6b6a0 Compare March 28, 2023 18:19
@Gudahtt Gudahtt marked this pull request as ready for review March 28, 2023 18:30
@Gudahtt Gudahtt requested a review from a team as a code owner March 28, 2023 18:30
@Gudahtt Gudahtt added the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Mar 28, 2023
Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Cal-L Cal-L added Spot Check on the Release Build If a ticket doesn't require feature QA, but does require some form of manual spot checking release-6.4.0 PR for release 6.4.0 and removed needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) labels Mar 28, 2023
@Gudahtt Gudahtt merged commit edfe239 into main Mar 29, 2023
13 checks passed
@Gudahtt Gudahtt deleted the refactor-send-transaction-v2 branch March 29, 2023 03:45
@github-actions github-actions bot locked and limited conversation to collaborators Mar 29, 2023
@chrisleewilcox chrisleewilcox added needs-qa Any New Features that needs a full manual QA prior to being added to a release. team-mobile-client team-confirmations-system DEPRECATED: please use "team-confirmations" label instead Spot Check on the Release Build If a ticket doesn't require feature QA, but does require some form of manual spot checking and removed Spot Check on the Release Build If a ticket doesn't require feature QA, but does require some form of manual spot checking needs-qa Any New Features that needs a full manual QA prior to being added to a release. labels Apr 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-6.4.0 PR for release 6.4.0 Spot Check on the Release Build If a ticket doesn't require feature QA, but does require some form of manual spot checking team-confirmations-system DEPRECATED: please use "team-confirmations" label instead team-mobile-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants