Proper fix for ValidatorIndex supported values.
This commit is contained in:
parent
af1a4d0c05
commit
9cd946a192
|
@ -606,7 +606,9 @@ proc toValidatorIndex*(value: RestValidatorIndex): Result[ValidatorIndex,
|
||||||
ValidatorIndexError] =
|
ValidatorIndexError] =
|
||||||
when sizeof(ValidatorIndex) == 4:
|
when sizeof(ValidatorIndex) == 4:
|
||||||
if uint64(value) < VALIDATOR_REGISTRY_LIMIT:
|
if uint64(value) < VALIDATOR_REGISTRY_LIMIT:
|
||||||
if uint64(value) <= uint64(high(uint32)):
|
# On x86 platform Nim allows only `int32` indexes, so all the indexes in
|
||||||
|
# range `2^31 <= x < 2^32` are not supported.
|
||||||
|
if uint64(value) <= uint64(high(int32)):
|
||||||
ok(ValidatorIndex(value))
|
ok(ValidatorIndex(value))
|
||||||
else:
|
else:
|
||||||
err(ValidatorIndexError.UnsupportedValue)
|
err(ValidatorIndexError.UnsupportedValue)
|
||||||
|
|
Loading…
Reference in New Issue