From 701cc00d08029343dd6b298e1f42f84d56934316 Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Wed, 17 Apr 2019 11:29:06 +1000 Subject: [PATCH] questionable patch for TreeHashVector --- eth2/state_processing/tests/tests.rs | 2 +- eth2/types/src/tree_hash_vector.rs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/eth2/state_processing/tests/tests.rs b/eth2/state_processing/tests/tests.rs index 6491e255a..ccad198bb 100644 --- a/eth2/state_processing/tests/tests.rs +++ b/eth2/state_processing/tests/tests.rs @@ -27,7 +27,7 @@ impl ExpectedState { ($field_name:ident) => { if self.$field_name.as_ref().map_or(true, |$field_name| { println!(" > Checking {}", stringify!($field_name)); - $field_name == &state.$field_name + &state.$field_name == $field_name }) { vec![] } else { diff --git a/eth2/types/src/tree_hash_vector.rs b/eth2/types/src/tree_hash_vector.rs index 1cc8e40a5..9b77e13dc 100644 --- a/eth2/types/src/tree_hash_vector.rs +++ b/eth2/types/src/tree_hash_vector.rs @@ -33,6 +33,12 @@ impl DerefMut for TreeHashVector { } } +impl PartialEq> for TreeHashVector { + fn eq(&self, other: &Vec) -> bool { + &self.0 == other + } +} + impl tree_hash::TreeHash for TreeHashVector where T: TreeHash,