From 55e0e7d05d8e5605f8f944155cfa1860a8055479 Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Tue, 25 Sep 2018 23:32:35 +1000 Subject: [PATCH] Add/fix message hashing in block validation tests --- lighthouse/state/block/validation/tests.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lighthouse/state/block/validation/tests.rs b/lighthouse/state/block/validation/tests.rs index 2d0b2d87c..627e10155 100644 --- a/lighthouse/state/block/validation/tests.rs +++ b/lighthouse/state/block/validation/tests.rs @@ -18,6 +18,7 @@ use super::db::stores::{ use super::db::{ MemoryDB, }; +use super::utils::hash::canonical_hash; use super::utils::types::{ Hash256, Bitfield, @@ -59,8 +60,8 @@ impl TestStore { fn test_block_validation() { let stores = TestStore::new(); - let cycle_length = 2; - let shard_count = 2; + let cycle_length: u8 = 2; + let shard_count: u16 = 2; let present_slot = u64::from(cycle_length) * 10000; let justified_slot = present_slot - u64::from(cycle_length); let justified_block_hash = Hash256::from("justified_hash".as_bytes()); @@ -103,7 +104,8 @@ fn test_block_validation() { stream.append(&shard); stream.append(&shard_block_hash); stream.append(&justified_slot); - stream.drain() + let bytes = stream.drain(); + canonical_hash(&bytes) }; for _ in 0..validators_per_shard {