mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-16 01:27:01 +00:00
Fix validator not in registry
and $
bugs.
This commit is contained in:
parent
2d71b998c7
commit
20e7ca48b5
@ -123,10 +123,6 @@ template findIt(s: openarray, predicate: untyped): int =
|
|||||||
break
|
break
|
||||||
res
|
res
|
||||||
|
|
||||||
template isSameKey(lhs, rhs: ValidatorPubKey): bool =
|
|
||||||
# TODO: operator `==` for ValidatorPubKey doesn't work properly at the moment
|
|
||||||
$lhs == $rhs
|
|
||||||
|
|
||||||
proc addLocalValidators*(node: BeaconNode) =
|
proc addLocalValidators*(node: BeaconNode) =
|
||||||
for validator in node.config.validators:
|
for validator in node.config.validators:
|
||||||
let
|
let
|
||||||
@ -134,7 +130,7 @@ proc addLocalValidators*(node: BeaconNode) =
|
|||||||
pubKey = privKey.pubKey()
|
pubKey = privKey.pubKey()
|
||||||
randao = validator.randao
|
randao = validator.randao
|
||||||
|
|
||||||
let idx = node.beaconState.validator_registry.findIt(isSameKey(it.pubKey, pubKey))
|
let idx = node.beaconState.validator_registry.findIt(it.pubKey == pubKey)
|
||||||
if idx == -1:
|
if idx == -1:
|
||||||
warn "Validator not in registry", pubKey
|
warn "Validator not in registry", pubKey
|
||||||
else:
|
else:
|
||||||
|
@ -51,7 +51,7 @@ import
|
|||||||
export
|
export
|
||||||
json_serialization
|
json_serialization
|
||||||
|
|
||||||
export blscurve.init, blscurve.getBytes, blscurve.combine
|
export blscurve.init, blscurve.getBytes, blscurve.combine, blscurve.`$`, blscurve.`==`
|
||||||
|
|
||||||
type
|
type
|
||||||
ValidatorPubKey* = blscurve.VerKey
|
ValidatorPubKey* = blscurve.VerKey
|
||||||
|
Loading…
x
Reference in New Issue
Block a user