Skip to content
Snippets Groups Projects

Resolve "Variants of BlockchainProtocol and V10Documents should use Box to limit size of the common data structure"

Files

+ 9
0
@@ -19,10 +19,12 @@
//!
//! [`KeyPairGenerator`]: struct.KeyPairGenerator.html
use std::collections::hash_map::DefaultHasher;
use std::fmt::Display;
use std::fmt::Error;
use std::fmt::Formatter;
use std::fmt::Debug;
use std::hash::{Hash, Hasher};
use base58::{FromBase58, FromBase58Error, ToBase58};
use base64;
@@ -35,6 +37,13 @@ use super::{BaseConvertionError, PrivateKey as PrivateKeyMethods, PublicKey as P
#[derive(Clone, Copy)]
pub struct Signature(pub [u8; 64]);
impl Hash for Signature {
fn hash<H: Hasher>(&self, _state: &mut H) {
let mut hasher = DefaultHasher::new();
Hash::hash_slice(&self.0, &mut hasher);
}
}
impl super::Signature for Signature {
fn from_base64(base64_data: &str) -> Result<Signature, BaseConvertionError> {
match base64::decode(base64_data) {
Loading