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

feat: rename and test verify_message_signature() #92

Merged
merged 4 commits into from
Dec 5, 2023

Conversation

rvanasa
Copy link
Collaborator

@rvanasa rvanasa commented Dec 4, 2023

  • Renames verify_signature() to verify_message_signature()
  • Uses hex-encoded address and signature in place of blob values (for consistency with the rest of the canister)
  • Includes Motoko E2E tests to confirm that this function can be called with reasonable convenience.

See this Google Docs comment thread for context.

e2e/motoko/Main.mo Outdated Show resolved Hide resolved
Comment on lines +4 to +5
if !hex.starts_with("0x") {
return None;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this preferable to simply cutting off 0x if it occurs at the beginning?

Copy link
Collaborator Author

@rvanasa rvanasa Dec 5, 2023

Choose a reason for hiding this comment

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

I've tried both, and this approach is more consistent with the wider Ethereum ecosystem (since JSON-RPC providers generally require the 0x prefix).

Allowing hex strings without the prefix led to confusion in the ic-eth-starter project, so I'd rather start this way and then relax the constraints (rather than the other way around).

Co-authored-by: Thomas Locher <[email protected]>
@rvanasa rvanasa merged commit 203f2f6 into main Dec 5, 2023
@rvanasa rvanasa deleted the verify-message-signature branch December 5, 2023 16:13
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.

2 participants