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 raw bytes #1332

Merged
merged 6 commits into from
Oct 6, 2022
Merged

fix: sign raw bytes #1332

merged 6 commits into from
Oct 6, 2022

Conversation

prybalko
Copy link
Contributor

@prybalko prybalko commented Oct 3, 2022

Purpose

Fixing #1014, #997

Scope

Expect messages to be wraped in <Bytes>...</Bytes>. It works like that in polkadotjs extension and Stylo

Screenshots

Signing up to https://polkadot.polkassembly.io/
IMG_0020

Comment on lines +71 to +75
SignContent::Message(_) => match signature {
MultiSignature::Sr25519(a) => hex::encode(a),
MultiSignature::Ed25519(a) => hex::encode(a),
MultiSignature::Ecdsa(a) => hex::encode(a),
},
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think that this is right

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it conceptually wrong, or is there a better way to write it? I struggle to find another solution.

Copy link
Contributor

Choose a reason for hiding this comment

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

  • I think that it is not a good pattern to turn a return type from MultiSignature to String
  • Are you sure that this should be just the bare signature that is returned, not MultiSignature? How the users are going to tell the difference between different signature schemes? In case of a transaction MultiSignature is returned

@prybalko prybalko marked this pull request as ready for review October 4, 2022 07:15
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