mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-15 17:15:37 +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
|
||||
res
|
||||
|
||||
template isSameKey(lhs, rhs: ValidatorPubKey): bool =
|
||||
# TODO: operator `==` for ValidatorPubKey doesn't work properly at the moment
|
||||
$lhs == $rhs
|
||||
|
||||
proc addLocalValidators*(node: BeaconNode) =
|
||||
for validator in node.config.validators:
|
||||
let
|
||||
@ -134,7 +130,7 @@ proc addLocalValidators*(node: BeaconNode) =
|
||||
pubKey = privKey.pubKey()
|
||||
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:
|
||||
warn "Validator not in registry", pubKey
|
||||
else:
|
||||
|
@ -51,7 +51,7 @@ import
|
||||
export
|
||||
json_serialization
|
||||
|
||||
export blscurve.init, blscurve.getBytes, blscurve.combine
|
||||
export blscurve.init, blscurve.getBytes, blscurve.combine, blscurve.`$`, blscurve.`==`
|
||||
|
||||
type
|
||||
ValidatorPubKey* = blscurve.VerKey
|
||||
|
Loading…
x
Reference in New Issue
Block a user