-
Notifications
You must be signed in to change notification settings - Fork 144
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
Wrap Signature into a struct #184
Conversation
crypto/src/signature.rs
Outdated
impl Deref for Signature { | ||
type Target = Vec<u8>; | ||
|
||
fn deref(&self) -> &Self::Target { | ||
&self.0 | ||
} | ||
} |
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.
This is what I would do as well, but just to give the other option:
impl Signature {
pub fn as_bytes(&self) -> &Vec<u8> {
&self.0
}
}
Which seperates the functions on Signature with Vec. But since there seems to be nothing specific to signature and nothing to hide from signature this is probably good.
@dutterbutter if you don't mind rereviewing (and @ec2) from 26165cc changes. Don't worry I have Eric's blessing to push to his branch the serialization was missing the signature type :) |
Before Signature was a type alias to
Vec<u8
. This doesnt allow us to write a custom Serialize and Derserialize on it. So we need to wrap it in a struct.