fix chronos done -> completed deprecation warnings (#5016)

This commit is contained in:
tersec 2023-06-01 08:04:30 +00:00 committed by GitHub
parent 1086909e0b
commit 7a7573d7d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 16 additions and 16 deletions

View File

@ -41,7 +41,7 @@ proc initGenesis(vc: ValidatorClientRef): Future[RestGenesis] {.async.} =
var bres: seq[BeaconNodeServerRef] var bres: seq[BeaconNodeServerRef]
for i in 0 ..< len(pendingRequests): for i in 0 ..< len(pendingRequests):
let fut = pendingRequests[i] let fut = pendingRequests[i]
if fut.done(): if fut.completed():
let resp = fut.read() let resp = fut.read()
if resp.status == 200: if resp.status == 200:
debug "Received genesis information", endpoint = nodes[i], debug "Received genesis information", endpoint = nodes[i],

View File

@ -1091,7 +1091,7 @@ proc installBeaconApiHandlers*(router: var RestRouter, node: BeaconNode) =
var res: seq[RestIndexedErrorMessageItem] var res: seq[RestIndexedErrorMessageItem]
await allFutures(pending) await allFutures(pending)
for index, future in pending: for index, future in pending:
if future.done(): if future.completed():
let fres = future.read() let fres = future.read()
if fres.isErr(): if fres.isErr():
let failure = RestIndexedErrorMessageItem(index: index, let failure = RestIndexedErrorMessageItem(index: index,

View File

@ -655,7 +655,7 @@ proc installValidatorApiHandlers*(router: var RestRouter, node: BeaconNode) =
res res
await allFutures(pending) await allFutures(pending)
for future in pending: for future in pending:
if future.done(): if future.completed():
let res = future.read() let res = future.read()
if res.isErr(): if res.isErr():
return RestApiResponse.jsonError(Http400, return RestApiResponse.jsonError(Http400,
@ -878,7 +878,7 @@ proc installValidatorApiHandlers*(router: var RestRouter, node: BeaconNode) =
var res: seq[RestIndexedErrorMessageItem] var res: seq[RestIndexedErrorMessageItem]
await allFutures(pending) await allFutures(pending)
for index, future in pending: for index, future in pending:
if future.done(): if future.completed():
let fres = future.read() let fres = future.read()
if fres.isErr(): if fres.isErr():
let failure = RestIndexedErrorMessageItem(index: index, let failure = RestIndexedErrorMessageItem(index: index,

View File

@ -212,7 +212,7 @@ proc produceAndPublishAttestations*(service: AttestationServiceRef,
raise exc raise exc
for future in pendingAttestations: for future in pendingAttestations:
if future.done(): if future.completed():
if future.read(): if future.read():
inc(succeed) inc(succeed)
else: else:
@ -307,7 +307,7 @@ proc produceAndPublishAggregates(service: AttestationServiceRef,
raise exc raise exc
for future in pendingAggregates: for future in pendingAggregates:
if future.done(): if future.completed():
if future.read(): if future.read():
inc(succeed) inc(succeed)
else: else:

View File

@ -894,7 +894,7 @@ proc getValidatorRegistration(
let sigfut = validator.getBuilderSignature(fork, registration.message) let sigfut = validator.getBuilderSignature(fork, registration.message)
if sigfut.finished(): if sigfut.finished():
# This is short-path if we able to create signature locally. # This is short-path if we able to create signature locally.
if not(sigfut.done()): if not(sigfut.completed()):
let exc = sigfut.readError() let exc = sigfut.readError()
debug "Got unexpected exception while signing validator registration", debug "Got unexpected exception while signing validator registration",
validator = shortLog(validator), error_name = $exc.name, validator = shortLog(validator), error_name = $exc.name,
@ -962,7 +962,7 @@ proc prepareRegistrationList*(
await allFutures(futures) await allFutures(futures)
for index, future in futures.pairs(): for index, future in futures.pairs():
if future.done(): if future.completed():
let sres = future.read() let sres = future.read()
if sres.isOk(): if sres.isOk():
var reg = messages[index] var reg = messages[index]

View File

@ -220,7 +220,7 @@ proc pollForAttesterDuties*(service: DutiesServiceRef,
for index, fut in pendingRequests: for index, fut in pendingRequests:
let item = addOrReplaceItems[index] let item = addOrReplaceItems[index]
let dap = let dap =
if fut.done(): if fut.completed():
let sigRes = fut.read() let sigRes = fut.read()
if sigRes.isErr(): if sigRes.isErr():
warn "Unable to create slot signature using remote signer", warn "Unable to create slot signature using remote signer",

View File

@ -122,7 +122,7 @@ proc produceAndPublishSyncCommitteeMessages(service: SyncCommitteeServiceRef,
raise exc raise exc
for future in pendingSyncCommitteeMessages: for future in pendingSyncCommitteeMessages:
if future.done(): if future.completed():
if future.read(): if future.read():
inc(succeed) inc(succeed)
else: else:
@ -246,7 +246,7 @@ proc produceAndPublishContributions(service: SyncCommitteeServiceRef,
let validatorContributions = block: let validatorContributions = block:
var res: seq[ContributionItem] var res: seq[ContributionItem]
for idx, fut in slotSignatureReqs: for idx, fut in slotSignatureReqs:
if fut.done: if fut.completed:
let let
sigRes = fut.read sigRes = fut.read
validator = validators[idx][0] validator = validators[idx][0]
@ -316,7 +316,7 @@ proc produceAndPublishContributions(service: SyncCommitteeServiceRef,
raise err raise err
for future in pendingAggregates: for future in pendingAggregates:
if future.done(): if future.completed():
if future.read(): if future.read():
inc(succeed) inc(succeed)
else: else:

View File

@ -336,7 +336,7 @@ proc routeSyncCommitteeMessages*(
await allFutures(pending) await allFutures(pending)
for index, future in pending: for index, future in pending:
if future.done(): if future.completed():
let fres = future.read() let fres = future.read()
if fres.isErr(): if fres.isErr():
statuses[indices[index]] = Opt.some(SendResult.err(fres.error())) statuses[indices[index]] = Opt.some(SendResult.err(fres.error()))

View File

@ -396,7 +396,7 @@ proc signWithDistributedKey(v: AttachedValidator,
for i, req in signatureReqs: for i, req in signatureReqs:
template shareInfo: untyped = v.clients[i][1] template shareInfo: untyped = v.clients[i][1]
if req.done and req.read.isOk: if req.completed and req.read.isOk:
shares.add req.read.get.toSignatureShare(shareInfo.id) shares.add req.read.get.toSignatureShare(shareInfo.id)
neededShares = neededShares - 1 neededShares = neededShares - 1
else: else:

View File

@ -963,7 +963,7 @@ suite "Nimbus remote signer/signing test (web3signer)":
GenesisValidatorsRoot, Epoch(i))) GenesisValidatorsRoot, Epoch(i)))
await allFutures(futures1) await allFutures(futures1)
for fut in futures1: for fut in futures1:
check fut.done() check fut.completed()
await sleepAsync(seconds(SigningRequestTimeoutSeconds) + 100.milliseconds) await sleepAsync(seconds(SigningRequestTimeoutSeconds) + 100.milliseconds)
@ -974,7 +974,7 @@ suite "Nimbus remote signer/signing test (web3signer)":
await allFutures(futures2) await allFutures(futures2)
for fut in futures2: for fut in futures2:
check fut.done() check fut.completed()
for i in 0 ..< TestsCount: for i in 0 ..< TestsCount:
let let