From c573b51a31408db90b1d96d9a193a2cd59e020fd Mon Sep 17 00:00:00 2001 From: debris Date: Mon, 14 Dec 2015 15:22:41 +0100 Subject: [PATCH] seal todo done --- src/blockheader.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/blockheader.rs b/src/blockheader.rs index 6ef7764d5..b79b57815 100644 --- a/src/blockheader.rs +++ b/src/blockheader.rs @@ -58,7 +58,7 @@ impl Decodable for Header { fn decode(decoder: &D) -> Result where D: Decoder { let d = try!(decoder.as_list()); - let blockheader = Header { + let mut blockheader = Header { parent_hash: try!(Decodable::decode(&d[0])), uncles_hash: try!(Decodable::decode(&d[1])), author: try!(Decodable::decode(&d[2])), @@ -74,7 +74,11 @@ impl Decodable for Header { extra_data: try!(Decodable::decode(&d[12])), seal: vec![], }; - // TODO: fill blockheader.seal with (raw) list items index 12..) + + for i in 13..d.len() { + blockheader.seal.push(try!(Decodable::decode(&d[i]))); + } + Ok(blockheader) } } @@ -95,7 +99,10 @@ impl Encodable for Header { self.gas_used.encode(e); self.timestamp.encode(e); self.extra_data.encode(e); - // TODO: emit raw seal items. + + for b in self.seal.iter() { + b.encode(e); + } }) } }