/// Constructs a header given pre_pow string, nonce, and proof
Constructs a header given pre_pow string, nonce, and proof
Constructs a header given pre_pow string nonce and proof
pub fn from_pre_pow_and_proof(
		pre_pow: String,
		nonce: u64,
		proof: Proof,
	) -> Result<Self, Error> {
		// Convert hex pre pow string
		let mut header_bytes = from_hex(&pre_pow).map_err(|e| {
			Error::Serialization(ser::Error::HexError(format!(
				"Unable to process {}, {}",
				pre_pow, e
			)))
		})?;
		// Serialize and append serialized nonce and proof
		serialize_default(&mut header_bytes, &nonce)?;
		serialize_default(&mut header_bytes, &proof)?;
		// Deserialize header from constructed bytes
		Ok(deserialize_default(&mut &header_bytes[..])?)
	}
pub fn from_pre_pow_and_proof ( pre_pow : String , nonce : u64 , proof : Proof , ) -> Result < Self , Error > { // Convert hex pre pow string let mut header_bytes = from_hex ( & pre_pow ) . map_err ( | e | { Error :: Serialization ( ser :: Error :: HexError ( format ! ( " " pre_pow e ) ) ) } ) ? ; // Serialize and append serialized nonce and proof serialize_default ( & mut header_bytes , & nonce ) ? ; serialize_default ( & mut header_bytes , & proof ) ? ; // Deserialize header from constructed bytes Ok ( deserialize_default ( & mut & header_bytes [ .. ] ) ? ) }
Constructs a header given pre_pow string, nonce, and proof
Constructs a header given pre_pow string nonce and proof
pre_pow
String
nonce
u64
proof
Proof