Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Fix signTypedMessage parameter types #250

Merged
merged 1 commit into from
Jul 17, 2023

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Jul 17, 2023

Description

The signTypedMessage parameter types accepted the data to sign as an array. This works with signTypedData_v1, but is incompatible with later versions.

The signature has been updated to accept data as either an array or an object. Additionally, tests have been added to cover all three supported versions of signTypedData.

Changes

  • Fixed: signTypedMessage now accepts data either as an array or an object
    • This was a mistake in the original type definition - it always supported both in practice.

References

Helps to unblock MetaMask/core#1441

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation for new or updated code as appropriate (note: this will usually be JSDoc)
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

@Gudahtt Gudahtt requested a review from a team as a code owner July 17, 2023 22:08
Copy link
Member

@mikesposito mikesposito left a comment

Choose a reason for hiding this comment

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

LGTM!

@Gudahtt Gudahtt force-pushed the fix-sign-typed-data-parameter-types branch from 1917724 to 7086099 Compare July 17, 2023 22:36
The `signTypedMessage` parameter types accepted the data to sign as an
array. This works with `signTypedData_v1`, but is incompatible with
later versions.

The signature has been updated to accept data as either an array or an
object. Additionally, tests have been added to cover all three
supported versions of `signTypedData`.
@Gudahtt Gudahtt force-pushed the fix-sign-typed-data-parameter-types branch from 7086099 to e5a0f56 Compare July 17, 2023 22:44
@Gudahtt Gudahtt merged commit ec8b5da into main Jul 17, 2023
@Gudahtt Gudahtt deleted the fix-sign-typed-data-parameter-types branch July 17, 2023 22:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants