Rename canonical_hash to `hash

This commit is contained in:
Paul Hauner
2019-01-25 17:40:22 +11:00
parent 73d86bcc3b
commit f9acc42aca
11 changed files with 22 additions and 27 deletions

View File

@@ -1,6 +1,7 @@
use super::{BeaconChain, ClientDB, DBError, SlotClock};
use bls::{AggregatePublicKey, AggregateSignature, PublicKey, Signature};
use boolean_bitfield::BooleanBitfield;
use hashing::hash;
use slot_clock::{SystemTimeSlotClockError, TestingSlotClockError};
use ssz::ssz_encode;
use types::{
@@ -127,12 +128,13 @@ where
Error::BadRandaoSignature
);
// TODO: check this is correct.
let new_mix = {
let mut mix = state.latest_randao_mixes
[(state.slot % self.spec.latest_randao_mixes_length) as usize]
.to_vec();
mix.append(&mut ssz_encode(&block.randao_reveal));
hash(&mix)
Hash256::from(&hash(&mix)[..])
};
state.latest_randao_mixes[(state.slot % self.spec.latest_randao_mixes_length) as usize] =
@@ -396,11 +398,6 @@ fn penalize_validator(_state: &BeaconState, _proposer_index: usize) {
// TODO: stubbed out.
}
fn hash<T>(_input: &T) -> Hash256 {
// TODO: stubbed out.
Hash256::zero()
}
fn get_domain(_fork: &Fork, _slot: u64, _domain_type: u64) -> u64 {
// TODO: stubbed out.
0