randao mixes

This commit is contained in:
rkapka
2020-10-08 12:53:23 +02:00
parent 2a5c9eec63
commit 2863f9c24d
2 changed files with 4 additions and 4 deletions

View File

@@ -289,7 +289,7 @@ func ProcessFinalUpdates(state *stateTrie.BeaconState) (*stateTrie.BeaconState,
// Set RANDAO mix.
randaoMixLength := params.BeaconConfig().EpochsPerHistoricalVector
if uint64(state.RandaoMixesLength()) != randaoMixLength {
if state.RandaoMixesLength() != randaoMixLength {
return nil, fmt.Errorf(
"state randao length %d different than EpochsPerHistoricalVector %d",
state.RandaoMixesLength(),

View File

@@ -845,7 +845,7 @@ func (b *BeaconState) randaoMixAtIndex(idx uint64) ([]byte, error) {
}
// RandaoMixesLength returns the length of the randao mixes slice.
func (b *BeaconState) RandaoMixesLength() int {
func (b *BeaconState) RandaoMixesLength() uint64 {
if !b.HasInnerState() {
return 0
}
@@ -861,7 +861,7 @@ func (b *BeaconState) RandaoMixesLength() int {
// randaoMixesLength returns the length of the randao mixes slice.
// This assumes that a lock is already held on BeaconState.
func (b *BeaconState) randaoMixesLength() int {
func (b *BeaconState) randaoMixesLength() uint64 {
if !b.HasInnerState() {
return 0
}
@@ -869,7 +869,7 @@ func (b *BeaconState) randaoMixesLength() int {
return 0
}
return len(b.state.RandaoMixes)
return uint64(len(b.state.RandaoMixes))
}
// Slashings of validators on the beacon chain.