Skip to content

Commit

Permalink
fix terence change requests
Browse files Browse the repository at this point in the history
  • Loading branch information
shayzluf committed Apr 29, 2019
1 parent af1ca23 commit 705bf37
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions beacon-chain/core/helpers/randao.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,16 @@ import (
//
// Spec pseudocode definition:
// def generate_seed(state: BeaconState,
// epoch: Epoch) -> Bytes32:
// epoch: Epoch) -> Bytes32:
// """
// Generate a seed for the given ``epoch``.
// """
// return hash(
// get_randao_mix(state, epoch - MIN_SEED_LOOKAHEAD) +
// get_active_index_root(state, epoch) +
// int_to_bytes32(epoch)
// get_randao_mix(state, epoch - MIN_SEED_LOOKAHEAD) +
// get_active_index_root(state, epoch) +
// int_to_bytes32(epoch)
// )
func GenerateSeed(state *pb.BeaconState, wantedEpoch uint64) ([32]byte, error) {
if wantedEpoch < params.BeaconConfig().MinSeedLookahead {
return [32]byte{}, fmt.Errorf("can't generate seed for epoch: %d that is smaller then MIN_SEED_LOOKAHEAD: %d", wantedEpoch, params.BeaconConfig().MinSeedLookahead)
}
randaoMix, err := RandaoMix(state, wantedEpoch-params.BeaconConfig().MinSeedLookahead)
if err != nil {
return [32]byte{}, err
Expand Down

0 comments on commit 705bf37

Please sign in to comment.