Header version cleanup (#2809)

* introduce HeaderVersion (was u16) for type safety
cleanup pow ser/deser (version unused)

* fixup tests for HeaderVersion

* validate header version during header deserialization
This commit is contained in:
Antioch Peverell
2019-05-08 21:10:42 +01:00
committed by GitHub
parent 8d5f73e8f1
commit fabff51dd3
11 changed files with 122 additions and 40 deletions
+1 -1
View File
@@ -548,7 +548,7 @@ impl BlockHeaderPrintable {
pub fn from_header(header: &core::BlockHeader) -> BlockHeaderPrintable {
BlockHeaderPrintable {
hash: util::to_hex(header.hash().to_vec()),
version: header.version,
version: header.version.into(),
height: header.height,
previous: util::to_hex(header.prev_hash.to_vec()),
prev_root: util::to_hex(header.prev_root.to_vec()),