diff --git a/beacon_node/store/src/iter.rs b/beacon_node/store/src/iter.rs index 55c525b11..11969e2a9 100644 --- a/beacon_node/store/src/iter.rs +++ b/beacon_node/store/src/iter.rs @@ -305,7 +305,7 @@ mod test { state_a.slot = Slot::from(slots_per_historical_root); state_b.slot = Slot::from(slots_per_historical_root * 2); - let mut hashes = (0..).into_iter().map(|i| Hash256::from(i)); + let mut hashes = (0..).into_iter().map(|i| Hash256::from_low_u64_be(i)); for root in &mut state_a.block_roots[..] { *root = hashes.next().unwrap() @@ -333,7 +333,7 @@ mod test { assert_eq!(collected.len(), expected_len); for i in 0..expected_len { - assert_eq!(collected[i].0, Hash256::from(i as u64)); + assert_eq!(collected[i].0, Hash256::from_low_u64_be(i as u64)); } } @@ -348,7 +348,7 @@ mod test { state_a.slot = Slot::from(slots_per_historical_root); state_b.slot = Slot::from(slots_per_historical_root * 2); - let mut hashes = (0..).into_iter().map(|i| Hash256::from(i)); + let mut hashes = (0..).into_iter().map(|i| Hash256::from_low_u64_be(i)); for root in &mut state_a.block_roots[..] { *root = hashes.next().unwrap() @@ -376,7 +376,7 @@ mod test { assert_eq!(collected.len(), expected_len); for i in 0..expected_len { - assert_eq!(collected[i].0, Hash256::from(i as u64)); + assert_eq!(collected[i].0, Hash256::from_low_u64_be(i as u64)); } } @@ -391,7 +391,7 @@ mod test { state_a.slot = Slot::from(slots_per_historical_root); state_b.slot = Slot::from(slots_per_historical_root * 2); - let mut hashes = (0..).into_iter().map(|i| Hash256::from(i)); + let mut hashes = (0..).into_iter().map(|i| Hash256::from_low_u64_be(i)); for slot in 0..slots_per_historical_root { state_a @@ -404,8 +404,8 @@ mod test { .expect(&format!("should set state_b slot {}", slot)); } - let state_a_root = Hash256::from(slots_per_historical_root as u64); - let state_b_root = Hash256::from(slots_per_historical_root as u64 * 2); + let state_a_root = Hash256::from_low_u64_be(slots_per_historical_root as u64); + let state_b_root = Hash256::from_low_u64_be(slots_per_historical_root as u64 * 2); store.put(&state_a_root, &state_a).unwrap(); store.put(&state_b_root, &state_b).unwrap(); @@ -429,7 +429,12 @@ mod test { assert_eq!(slot, i as u64, "slot mismatch at {}: {} vs {}", i, slot, i); - assert_eq!(hash, Hash256::from(i as u64), "hash mismatch at {}", i); + assert_eq!( + hash, + Hash256::from_low_u64_be(i as u64), + "hash mismatch at {}", + i + ); } } } diff --git a/eth2/types/Cargo.toml b/eth2/types/Cargo.toml index ae707bc2c..2e4474499 100644 --- a/eth2/types/Cargo.toml +++ b/eth2/types/Cargo.toml @@ -12,7 +12,7 @@ compare_fields_derive = { path = "../utils/compare_fields_derive" } dirs = "1.0" derivative = "1.0" eth2_interop_keypairs = { path = "../utils/eth2_interop_keypairs" } -ethereum-types = "0.5" +ethereum-types = "0.6" hashing = { path = "../utils/hashing" } hex = "0.3" int_to_bytes = { path = "../utils/int_to_bytes" } diff --git a/eth2/types/src/beacon_state/committee_cache/tests.rs b/eth2/types/src/beacon_state/committee_cache/tests.rs index 0fe2fb8a4..28e9d92f8 100644 --- a/eth2/types/src/beacon_state/committee_cache/tests.rs +++ b/eth2/types/src/beacon_state/committee_cache/tests.rs @@ -74,7 +74,7 @@ fn shuffles_for_the_right_epoch() { let distinct_hashes: Vec = (0..MinimalEthSpec::epochs_per_historical_vector()) .into_iter() - .map(|i| Hash256::from(i as u64)) + .map(|i| Hash256::from_low_u64_be(i as u64)) .collect(); state.randao_mixes = FixedVector::from(distinct_hashes); diff --git a/eth2/types/src/beacon_state/tests.rs b/eth2/types/src/beacon_state/tests.rs index cff034e56..e4c493f92 100644 --- a/eth2/types/src/beacon_state/tests.rs +++ b/eth2/types/src/beacon_state/tests.rs @@ -308,7 +308,7 @@ mod committees { let distinct_hashes: Vec = (0..T::epochs_per_historical_vector()) .into_iter() - .map(|i| Hash256::from(i as u64)) + .map(|i| Hash256::from_low_u64_be(i as u64)) .collect(); state.randao_mixes = FixedVector::from(distinct_hashes); diff --git a/eth2/utils/cached_tree_hash/Cargo.toml b/eth2/utils/cached_tree_hash/Cargo.toml index c8881eb0f..ce26ee94f 100644 --- a/eth2/utils/cached_tree_hash/Cargo.toml +++ b/eth2/utils/cached_tree_hash/Cargo.toml @@ -9,6 +9,6 @@ tree_hash_derive = { path = "../tree_hash_derive" } [dependencies] tree_hash = { path = "../tree_hash" } -ethereum-types = "0.5" +ethereum-types = "0.6" hashing = { path = "../hashing" } int_to_bytes = { path = "../int_to_bytes" } diff --git a/eth2/utils/merkle_proof/Cargo.toml b/eth2/utils/merkle_proof/Cargo.toml index b7cd81216..7464773a5 100644 --- a/eth2/utils/merkle_proof/Cargo.toml +++ b/eth2/utils/merkle_proof/Cargo.toml @@ -5,5 +5,5 @@ authors = ["Michael Sproul "] edition = "2018" [dependencies] -ethereum-types = "0.5" +ethereum-types = "0.6" hashing = { path = "../hashing" } diff --git a/eth2/utils/ssz/Cargo.toml b/eth2/utils/ssz/Cargo.toml index 78e65a977..ff5df162d 100644 --- a/eth2/utils/ssz/Cargo.toml +++ b/eth2/utils/ssz/Cargo.toml @@ -13,4 +13,4 @@ name = "ssz" eth2_ssz_derive = "0.1.0" [dependencies] -ethereum-types = "0.5" +ethereum-types = "0.6" diff --git a/eth2/utils/ssz/fuzz/Cargo.toml b/eth2/utils/ssz/fuzz/Cargo.toml index 71628e858..3c922bac9 100644 --- a/eth2/utils/ssz/fuzz/Cargo.toml +++ b/eth2/utils/ssz/fuzz/Cargo.toml @@ -9,7 +9,7 @@ publish = false cargo-fuzz = true [dependencies] -ethereum-types = "0.5" +ethereum-types = "0.6" [dependencies.ssz] path = ".." diff --git a/eth2/utils/swap_or_not_shuffle/Cargo.toml b/eth2/utils/swap_or_not_shuffle/Cargo.toml index 19d5444fb..764dbf409 100644 --- a/eth2/utils/swap_or_not_shuffle/Cargo.toml +++ b/eth2/utils/swap_or_not_shuffle/Cargo.toml @@ -12,7 +12,7 @@ harness = false criterion = "0.2" yaml-rust = "0.4.2" hex = "0.3" -ethereum-types = "0.5" +ethereum-types = "0.6" [dependencies] hashing = { path = "../hashing" } diff --git a/eth2/utils/tree_hash/Cargo.toml b/eth2/utils/tree_hash/Cargo.toml index 3019c2ad0..d69a75faa 100644 --- a/eth2/utils/tree_hash/Cargo.toml +++ b/eth2/utils/tree_hash/Cargo.toml @@ -15,7 +15,7 @@ tree_hash_derive = { path = "../tree_hash_derive" } types = { path = "../../types" } [dependencies] -ethereum-types = "0.5" +ethereum-types = "0.6" hashing = { path = "../hashing" } int_to_bytes = { path = "../int_to_bytes" } lazy_static = "0.1" diff --git a/tests/ef_tests/Cargo.toml b/tests/ef_tests/Cargo.toml index 90f66f355..507e0f7c3 100644 --- a/tests/ef_tests/Cargo.toml +++ b/tests/ef_tests/Cargo.toml @@ -10,7 +10,7 @@ fake_crypto = ["bls/fake_crypto"] [dependencies] bls = { path = "../../eth2/utils/bls" } compare_fields = { path = "../../eth2/utils/compare_fields" } -ethereum-types = "0.5" +ethereum-types = "0.6" hex = "0.3" rayon = "1.0" serde = "1.0"