`noCancel` in `test_gossip_validation` (#5907)
To avoid spurious warnings, mark futures that are not cancelled by test as such when waiting for them. Variable rename is for max line length.
This commit is contained in:
parent
e7d2ee7cb6
commit
bf882887bd
|
@ -5,6 +5,7 @@
|
||||||
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
||||||
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
||||||
|
|
||||||
|
{.push raises: [].}
|
||||||
{.used.}
|
{.used.}
|
||||||
|
|
||||||
import
|
import
|
||||||
|
@ -332,7 +333,7 @@ suite "Gossip validation - Altair":
|
||||||
(validator, _, msg) = dag.getSyncCommitteeMessage(
|
(validator, _, msg) = dag.getSyncCommitteeMessage(
|
||||||
slot, subcommitteeIdx, indexInSubcommittee,
|
slot, subcommitteeIdx, indexInSubcommittee,
|
||||||
signatureSlot = Opt.some(signatureSlot))
|
signatureSlot = Opt.some(signatureSlot))
|
||||||
msgVerdict = waitFor dag.validateSyncCommitteeMessage(
|
msgVerdict = waitFor noCancel dag.validateSyncCommitteeMessage(
|
||||||
quarantine, batchCrypto, syncCommitteePool,
|
quarantine, batchCrypto, syncCommitteePool,
|
||||||
msg, subcommitteeIdx, slot.start_beacon_time(),
|
msg, subcommitteeIdx, slot.start_beacon_time(),
|
||||||
checkSignature = true)
|
checkSignature = true)
|
||||||
|
@ -372,15 +373,15 @@ suite "Gossip validation - Altair":
|
||||||
contrib.message.contribution)
|
contrib.message.contribution)
|
||||||
syncCommitteePool[].addContribution(
|
syncCommitteePool[].addContribution(
|
||||||
contrib[], bid, contrib.message.contribution.signature.load.get)
|
contrib[], bid, contrib.message.contribution.signature.load.get)
|
||||||
let signRes = waitFor validator.getContributionAndProofSignature(
|
let res = waitFor noCancel validator.getContributionAndProofSignature(
|
||||||
getStateField(dag.headState, fork),
|
getStateField(dag.headState, fork),
|
||||||
getStateField(dag.headState, genesis_validators_root),
|
getStateField(dag.headState, genesis_validators_root),
|
||||||
contrib[].message)
|
contrib[].message)
|
||||||
doAssert(signRes.isOk())
|
doAssert(res.isOk())
|
||||||
contrib[].signature = signRes.get()
|
contrib[].signature = res.get()
|
||||||
contrib
|
contrib
|
||||||
syncCommitteePool[] = SyncCommitteeMsgPool.init(rng, cfg)
|
syncCommitteePool[] = SyncCommitteeMsgPool.init(rng, cfg)
|
||||||
let contribVerdict = waitFor dag.validateContribution(
|
let contribVerdict = waitFor noCancel dag.validateContribution(
|
||||||
quarantine, batchCrypto, syncCommitteePool,
|
quarantine, batchCrypto, syncCommitteePool,
|
||||||
contrib[], slot.start_beacon_time(),
|
contrib[], slot.start_beacon_time(),
|
||||||
checkSignature = true)
|
checkSignature = true)
|
||||||
|
|
Loading…
Reference in New Issue