Update ethereum-types to 0.5

This commit is contained in:
Michael Sproul
2019-03-04 17:19:25 +11:00
parent af8b8d519c
commit 6253167cac
19 changed files with 80 additions and 79 deletions

View File

@@ -134,9 +134,10 @@ fn per_block_processing_signature_optional(
let new_mix = {
let mut mix = state.latest_randao_mixes
[state.slot.as_usize() % spec.latest_randao_mixes_length]
.as_bytes()
.to_vec();
mix.append(&mut ssz_encode(&block.randao_reveal));
Hash256::from(&hash(&mix)[..])
Hash256::from_slice(&hash(&mix)[..])
};
state.latest_randao_mixes[state.slot.as_usize() % spec.latest_randao_mixes_length] = new_mix;

View File

@@ -626,7 +626,7 @@ impl EpochProcessable for BeaconState {
}
fn hash_tree_root<T: TreeHash>(input: Vec<T>) -> Hash256 {
Hash256::from(&input.hash_tree_root()[..])
Hash256::from_slice(&input.hash_tree_root()[..])
}
fn winning_root(