This commit is contained in:
TristanDebrunner
2019-07-15 13:17:17 -06:00
committed by GitHub
parent 04649de6a6
commit 6b86f85916
12 changed files with 777 additions and 18 deletions

View File

@@ -19,6 +19,7 @@ use std::str::FromStr;
pub type Keypair = ed25519_dalek::Keypair;
#[repr(transparent)]
#[derive(Serialize, Deserialize, Clone, Copy, Default, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct Signature(GenericArray<u8, U64>);
@@ -74,6 +75,12 @@ impl fmt::Display for Signature {
}
}
impl Into<[u8; 64]> for Signature {
fn into(self) -> [u8; 64] {
<GenericArray<u8, U64> as Into<[u8; 64]>>::into(self.0)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ParseSignatureError {
WrongSize,