From 1de12bfb56e87c374f39ae622f90d07ce2fa1604 Mon Sep 17 00:00:00 2001 From: Adrian Sutton Date: Thu, 27 Aug 2020 10:46:01 +1000 Subject: [PATCH] Use deterministic validator keys by default in ChainBuilder so tests are more predictable. (#2666) --- .../java/tech/pegasys/teku/core/ChainBuilder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ethereum/core/src/testFixtures/java/tech/pegasys/teku/core/ChainBuilder.java b/ethereum/core/src/testFixtures/java/tech/pegasys/teku/core/ChainBuilder.java index 891ff635a70..cd95d253c9f 100644 --- a/ethereum/core/src/testFixtures/java/tech/pegasys/teku/core/ChainBuilder.java +++ b/ethereum/core/src/testFixtures/java/tech/pegasys/teku/core/ChainBuilder.java @@ -31,7 +31,6 @@ import java.util.stream.LongStream; import java.util.stream.Stream; import org.apache.tuweni.bytes.Bytes32; -import tech.pegasys.teku.bls.BLSKeyGenerator; import tech.pegasys.teku.bls.BLSKeyPair; import tech.pegasys.teku.bls.BLSSignature; import tech.pegasys.teku.core.lookup.BlockProvider; @@ -50,6 +49,7 @@ import tech.pegasys.teku.datastructures.util.DepositGenerator; import tech.pegasys.teku.datastructures.util.MockStartBeaconStateGenerator; import tech.pegasys.teku.datastructures.util.MockStartDepositGenerator; +import tech.pegasys.teku.datastructures.util.MockStartValidatorKeyPairFactory; import tech.pegasys.teku.infrastructure.async.SafeFuture; import tech.pegasys.teku.infrastructure.unsigned.UInt64; import tech.pegasys.teku.ssz.SSZTypes.SSZList; @@ -59,7 +59,7 @@ /** A utility for building small, valid chains of blocks with states for testing */ public class ChainBuilder { private static final List DEFAULT_VALIDATOR_KEYS = - BLSKeyGenerator.generateKeyPairs(3); + new MockStartValidatorKeyPairFactory().generateKeyPairs(0, 3); private final List validatorKeys; private final AttestationGenerator attestationGenerator;