work-around a generics compilation issue

This commit is contained in:
Zahary Karadjov 2018-11-26 18:41:03 +02:00
parent da22f2065f
commit 2137b084b2
2 changed files with 2 additions and 7 deletions

View File

@ -31,12 +31,7 @@ func shuffle*[T](values: seq[T], seed: Blake2_256_Digest): seq[T] =
index = 0 index = 0
while index < values_count - 1: while index < values_count - 1:
# Re-hash the `source` to obtain a new pattern of bytes. # Re-hash the `source` to obtain a new pattern of bytes.
source = blake2_256.digest source.data
# XXX: attempting to call undeclared routine: 'init'
# https://github.com/nim-lang/Nim/issues/8677
#
# mixin init? doesn't seem to be enough
#source = blake2_256.digest source.data
# Iterate through the `source` bytes in 3-byte chunks. # Iterate through the `source` bytes in 3-byte chunks.
for pos in countup(0, 29, 3): for pos in countup(0, 29, 3):

View File

@ -8,7 +8,7 @@
import import
options, options,
eth_common, eth_common, nimcrypto/blake2,
./datatypes, ./private/helpers ./datatypes, ./private/helpers
func min_empty_validator(validators: seq[ValidatorRecord], current_slot: uint64): Option[int] = func min_empty_validator(validators: seq[ValidatorRecord], current_slot: uint64): Option[int] =