Remove duplicated randao mix copy (#6420)

* remove duplicated randao mix copy
* Merge refs/heads/master into rm-dup-copy
* Merge refs/heads/master into rm-dup-copy
* Merge refs/heads/master into rm-dup-copy
This commit is contained in:
Preston Van Loon 2020-06-26 11:27:48 -07:00 committed by GitHub
parent 98757e759c
commit 886afb054c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,12 +45,5 @@ func Seed(state *stateTrie.BeaconState, epoch uint64, domain [bls.DomainByteLeng
// """
// return state.randao_mixes[epoch % EPOCHS_PER_HISTORICAL_VECTOR]
func RandaoMix(state *stateTrie.BeaconState, epoch uint64) ([]byte, error) {
currMix, err := state.RandaoMixAtIndex(epoch % params.BeaconConfig().EpochsPerHistoricalVector)
if err != nil {
return nil, err
}
newMixLength := len(currMix)
newMix := make([]byte, newMixLength)
copy(newMix, currMix)
return newMix, nil
return state.RandaoMixAtIndex(epoch % params.BeaconConfig().EpochsPerHistoricalVector)
}