-
Notifications
You must be signed in to change notification settings - Fork 159
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(rpc) Implement WalletSignMessage #4514
Conversation
src/rpc/methods/wallet.rs
Outdated
let sig = crate::key_management::sign( | ||
*key.key_info.key_type(), | ||
key.key_info.private_key(), | ||
message.cid().unwrap().to_bytes().as_slice(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised that you're ok with panicking in this handler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copy-pasted the signing code, and I didn't have the mental fortitude to fix the root cause. Hashing a message should be infallible but untangling that spaghetti will be rough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd prefer an expect("<here's why this is impossible>")
or a ticket link instead :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we lack any infrastructure code to add identity tests? I mean, we already have tests for signing blocks, so everything should be in place, no?
Nice! Our testing framework is even better than I thought. :) |
Summary of changes
Changes introduced in this pull request:
WalletSignMessage
- this signs the CID of a message and returns aSignedMessage
.Reference issue to close (if applicable)
Closes #4510
Other information and links
Change checklist