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 / Sign Message - Overwrite bug #1338

Open
wants to merge 2 commits into
base: v2
Choose a base branch
from

Conversation

jordan-enev
Copy link
Member

Closes https://github.com/AmbireTech/ambire-app/issues/3263.

  • Fix: The SignMessage controller was incorrectly overriding the original message string with a hex value, resulting in a non-human-readable message when signing fails.
  • Change: Simplified PlainTextMessage.message to accept only string values.
  • Change: Improved TypeScript parameter definitions for verifyMessage by making the main properties required. Enforced a strict requirement that either message or typedData must be provided, but not both.
  • Remove: Removed finalDigest parameter as it was never passed to verifyMessage. Refactored verifyMessage to ensure it only accepts either message or typedData, never both.

…al message string with a hex value, resulting in a non-human-readable message when signing fails.

Change: Simplified `PlainTextMessage.message` to accept only `string` values.
Change: Improved TypeScript parameter definitions for `verifyMessage` by making the main properties required. Enforced a strict requirement that either `message` or `typedData` must be provided, but not both.
Remove: Removed `finalDigest` as it was unused in the code. Refactored `verifyMessage` to ensure it only accepts either `message` or `typedData`, never both.
@jordan-enev
Copy link
Member Author

jordan-enev commented Feb 26, 2025

Update: It's not used in Relayer. Relayer uses https://github.com/AmbireTech/signature-validator/, so we are safe to drop support to finalDigest.

I couldn't find any finalDigest usages in @ambire-app and @ambire-common, but it's used in Relayer (credits to @JIOjosBG), so I'm going to restore the parameter.

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.

1 participant