fix Nim 1.6 deprecation and unused import warnings (#3834)

This commit is contained in:
tersec 2022-07-01 21:52:23 +00:00 committed by GitHub
parent 6a3bd89d09
commit ba4d4c14db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 19 deletions

View File

@ -47,9 +47,10 @@ OK: 16/16 Fail: 0/16 Skip: 0/16
+ dependent_root OK
+ get_beacon_proposer_index OK
+ latest_block_root OK
+ merklizer state roundtrip OK
+ process_slots OK
```
OK: 5/5 Fail: 0/5 Skip: 0/5
OK: 6/6 Fail: 0/6 Skip: 0/6
## Beacon time
```diff
+ basics OK
@ -568,4 +569,4 @@ OK: 1/1 Fail: 0/1 Skip: 0/1
OK: 9/9 Fail: 0/9 Skip: 0/9
---TOTAL---
OK: 313/318 Fail: 0/318 Skip: 5/318
OK: 314/319 Fail: 0/319 Skip: 5/319

View File

@ -11,8 +11,6 @@
# protocol. See https://github.com/ethereum/consensus-specs/pull/2802
import
# Status libraries
stew/bitops2,
# Beacon chain internals
../spec/datatypes/altair,
../light_client_data_db,

View File

@ -198,18 +198,18 @@ proc installKeymanagerHandlers*(router: var RestRouter, node: BeaconNode) =
if res.isOk:
case res.value()
of RemoveValidatorStatus.deleted:
keysAndDeleteStatus.add(
pubkey, RequestItemStatus(status: $KeystoreStatus.deleted))
keysAndDeleteStatus[pubkey] =
RequestItemStatus(status: $KeystoreStatus.deleted)
# At first all keys with status missing directory after removal receive
# status 'not_found'
of RemoveValidatorStatus.notFound:
keysAndDeleteStatus.add(
pubkey, RequestItemStatus(status: $KeystoreStatus.notFound))
keysAndDeleteStatus[pubkey] =
RequestItemStatus(status: $KeystoreStatus.notFound)
else:
keysAndDeleteStatus.add(pubkey,
RequestItemStatus(status: $KeystoreStatus.error,
message: $res.error()))
keysAndDeleteStatus[pubkey] =
RequestItemStatus(status: $KeystoreStatus.error,
message: $res.error())
# If we discover slashing protection data for a validator that was not
# found, this means the validator was active in the past, so we must

View File

@ -151,13 +151,13 @@ proc addValidators*(node: BeaconNode) =
node.addLocalValidators(localValidators)
node.addRemoteValidators(remoteValidators)
proc getAttachedValidator*(node: BeaconNode,
pubkey: ValidatorPubKey): AttachedValidator =
proc getAttachedValidator(node: BeaconNode,
pubkey: ValidatorPubKey): AttachedValidator =
node.attachedValidators[].getValidator(pubkey)
proc getAttachedValidator*(node: BeaconNode,
state_validators: auto,
idx: ValidatorIndex): AttachedValidator =
proc getAttachedValidator(node: BeaconNode,
state_validators: auto,
idx: ValidatorIndex): AttachedValidator =
if uint64(idx) < state_validators.lenu64:
let validator = node.getAttachedValidator(state_validators[idx].pubkey)
if validator != nil and validator.index != some(idx):
@ -170,9 +170,9 @@ proc getAttachedValidator*(node: BeaconNode,
idx, validators = state_validators.len
nil
proc getAttachedValidator*(node: BeaconNode,
epochRef: EpochRef,
idx: ValidatorIndex): AttachedValidator =
proc getAttachedValidator(node: BeaconNode,
epochRef: EpochRef,
idx: ValidatorIndex): AttachedValidator =
let key = epochRef.validatorKey(idx)
if key.isSome():
let validator = node.getAttachedValidator(key.get().toPubKey())