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

fix bytes encoding #271

Merged
merged 3 commits into from
Sep 28, 2022
Merged

fix bytes encoding #271

merged 3 commits into from
Sep 28, 2022

Conversation

ZumZoom
Copy link
Contributor

@ZumZoom ZumZoom commented Sep 20, 2022

fixes #270

@ZumZoom ZumZoom requested a review from a team as a code owner September 20, 2022 16:27
@@ -174,7 +174,7 @@ function encodeField(
if (typeof value === 'number') {
value = numberToBuffer(value);
} else if (isHexString(value)) {
value = numberToBuffer(parseInt(value, 16));
Copy link

Choose a reason for hiding this comment

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

I believe (based on the comment in the PR that changed this) the change from Buffer.from to numberToBuffer was intentional, but I'm not sure why. @adonesky1 Would you be willing to elaborate on this?

Copy link
Contributor

Choose a reason for hiding this comment

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

@mcmire this change was intentional. And apparently our testing was not sufficient to expose the regression here. This change was made in response to feedback provided here to a much larger set of changes in this suite of related functions. This change does seem to get us back on track. I am a bit concerned now however that there may be other regressions from this PR still lurking, since our test suite didn't catch this one...

Copy link
Contributor

Choose a reason for hiding this comment

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

@adonesky1 adonesky1 merged commit 68aac96 into MetaMask:main Sep 28, 2022
@ZumZoom ZumZoom deleted the fix/bytes-encoding branch September 28, 2022 16:17
@adonesky1 adonesky1 mentioned this pull request Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

signTypedData() return value changed in 5.0.0
3 participants