Skip to content

Commit

Permalink
Remove tuweni junit (#8940)
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdi-aouadi authored Jan 10, 2025
1 parent 55c6f70 commit 89caf92
Show file tree
Hide file tree
Showing 14 changed files with 2 additions and 34 deletions.
2 changes: 2 additions & 0 deletions acceptance-tests/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
dependencies {
testImplementation 'io.tmio:tuweni-units'

acceptanceTestImplementation project(":infrastructure:bls")
acceptanceTestImplementation project(':infrastructure:time')
acceptanceTestImplementation project(':data:serializer')
Expand Down
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,6 @@ subprojects {
runtimeOnly 'org.apache.logging.log4j:log4j-core'
runtimeOnly 'org.apache.logging.log4j:log4j-slf4j-impl'

testImplementation 'io.tmio:tuweni-junit'
testImplementation 'org.assertj:assertj-core'
testImplementation 'org.mockito:mockito-core'
testImplementation 'org.junit.jupiter:junit-jupiter-api'
Expand Down
1 change: 0 additions & 1 deletion eth-reference-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ dependencies {
referenceTestImplementation 'com.fasterxml.jackson.core:jackson-databind'
referenceTestImplementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'
referenceTestImplementation 'io.tmio:tuweni-bytes'
referenceTestImplementation 'io.tmio:tuweni-junit'
referenceTestImplementation 'io.tmio:tuweni-ssz'
referenceTestImplementation 'org.xerial.snappy:snappy-java'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@
import static java.util.stream.Collectors.toList;
import static org.junit.jupiter.api.Assertions.assertEquals;

import java.security.Security;
import java.util.Arrays;
import java.util.List;
import org.apache.tuweni.bytes.Bytes;
import org.apache.tuweni.bytes.Bytes32;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.junit.jupiter.api.Test;
import tech.pegasys.teku.bls.BLSKeyPair;
import tech.pegasys.teku.bls.BLSSecretKey;
Expand Down Expand Up @@ -60,10 +58,6 @@ class MockStartDepositGeneratorTest {
private final Spec spec = TestSpecFactory.createDefault();
private final MockStartDepositGenerator generator = new MockStartDepositGenerator(spec);

static {
Security.addProvider(new BouncyCastleProvider());
}

@Test
public void shouldGenerateDepositData() {
final List<BLSKeyPair> keyPairs =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,12 @@
import java.util.Objects;
import org.apache.tuweni.bytes.Bytes;
import org.apache.tuweni.bytes.Bytes32;
import org.apache.tuweni.junit.BouncyCastleExtension;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import tech.pegasys.teku.infrastructure.ssz.SszTestUtils;
import tech.pegasys.teku.infrastructure.ssz.collections.SszBytes32Vector;
import tech.pegasys.teku.spec.TestSpecFactory;
import tech.pegasys.teku.spec.util.DataStructureUtil;

@ExtendWith(BouncyCastleExtension.class)
class DepositTest {
private final DataStructureUtil dataStructureUtil =
new DataStructureUtil(TestSpecFactory.createDefault());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,14 @@
import it.unimi.dsi.fastutil.ints.IntList;
import java.util.stream.IntStream;
import org.apache.tuweni.bytes.Bytes;
import org.apache.tuweni.junit.BouncyCastleExtension;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import tech.pegasys.teku.infrastructure.ssz.SszTestUtils;
import tech.pegasys.teku.infrastructure.ssz.collections.SszMutableBytes32Vector;
import tech.pegasys.teku.spec.Spec;
import tech.pegasys.teku.spec.TestSpecFactory;
import tech.pegasys.teku.spec.datastructures.state.HistoricalBatch.HistoricalBatchSchema;
import tech.pegasys.teku.spec.util.DataStructureUtil;

@ExtendWith(BouncyCastleExtension.class)
public class HistoricalBatchTest {

private static final Spec SPEC = TestSpecFactory.createMainnetPhase0();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
import it.unimi.dsi.fastutil.ints.IntList;
import java.util.List;
import org.apache.tuweni.bytes.Bytes;
import org.apache.tuweni.junit.BouncyCastleExtension;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import tech.pegasys.teku.infrastructure.ssz.SszTestUtils;
import tech.pegasys.teku.infrastructure.ssz.schema.SszPrimitiveSchemas;
import tech.pegasys.teku.infrastructure.ssz.schema.SszVectorSchema;
Expand All @@ -40,7 +38,6 @@
import tech.pegasys.teku.spec.datastructures.state.beaconstate.MutableBeaconState;
import tech.pegasys.teku.spec.util.DataStructureUtil;

@ExtendWith(BouncyCastleExtension.class)
public abstract class AbstractBeaconStateSchemaTest<
T extends BeaconState, TMutable extends MutableBeaconState> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@

import static org.assertj.core.api.Assertions.assertThat;

import org.apache.tuweni.junit.BouncyCastleExtension;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
import tech.pegasys.teku.spec.Spec;
import tech.pegasys.teku.spec.config.SpecConfig;
Expand All @@ -27,7 +25,6 @@
import tech.pegasys.teku.spec.schemas.registry.SchemaRegistry;
import tech.pegasys.teku.spec.util.DataStructureUtil;

@ExtendWith(BouncyCastleExtension.class)
public abstract class AbstractBeaconStateTest<
T extends BeaconState, TMutable extends MutableBeaconState> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
import org.apache.tuweni.bytes.Bytes;
import org.apache.tuweni.bytes.Bytes32;
import org.apache.tuweni.bytes.Bytes48;
import org.apache.tuweni.junit.BouncyCastleExtension;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import tech.pegasys.teku.bls.BLSPublicKey;
import tech.pegasys.teku.bls.BLSSignature;
import tech.pegasys.teku.infrastructure.ssz.SszList;
Expand All @@ -45,7 +43,6 @@
import tech.pegasys.teku.spec.logic.common.statetransition.exceptions.BlockProcessingException;
import tech.pegasys.teku.spec.util.DataStructureUtil;

@ExtendWith(BouncyCastleExtension.class)
public abstract class BlockProcessorTest {
protected final Spec spec = createSpec();
protected final DataStructureUtil dataStructureUtil = new DataStructureUtil(spec);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static tech.pegasys.teku.spec.config.SpecConfig.GENESIS_SLOT;

import org.apache.tuweni.junit.BouncyCastleExtension;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
import tech.pegasys.teku.spec.Spec;
import tech.pegasys.teku.spec.SpecVersion;
Expand All @@ -31,7 +29,6 @@
import tech.pegasys.teku.spec.datastructures.state.beaconstate.BeaconState;
import tech.pegasys.teku.spec.util.DataStructureUtil;

@ExtendWith(BouncyCastleExtension.class)
public class BeaconStateUtilTest {
private final Spec spec = TestSpecFactory.createMinimalPhase0();
private final DataStructureUtil dataStructureUtil = new DataStructureUtil(spec);
Expand Down
1 change: 0 additions & 1 deletion fork-choice-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@ dependencies {
integrationTestImplementation 'com.fasterxml.jackson.core:jackson-databind'
integrationTestImplementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'
integrationTestImplementation 'io.tmio:tuweni-bytes'
integrationTestImplementation 'io.tmio:tuweni-junit'
}
3 changes: 0 additions & 3 deletions fuzz/src/test/java/tech/pegasys/teku/fuzz/FuzzUtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
import java.util.List;
import java.util.Optional;
import org.apache.tuweni.bytes.Bytes;
import org.apache.tuweni.junit.BouncyCastleExtension;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.xerial.snappy.Snappy;
import tech.pegasys.teku.fuzz.input.AttestationFuzzInput;
import tech.pegasys.teku.fuzz.input.AttesterSlashingFuzzInput;
Expand Down Expand Up @@ -69,7 +67,6 @@
import tech.pegasys.teku.spec.datastructures.state.beaconstate.versions.electra.BeaconStateSchemaElectra;
import tech.pegasys.teku.spec.schemas.SchemaDefinitionsElectra;

@ExtendWith(BouncyCastleExtension.class)
class FuzzUtilTest {

private final Spec spec = TestSpecFactory.createMinimalElectra();
Expand Down
1 change: 0 additions & 1 deletion gradle/versions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ dependencyManagement {
dependencySet(group: 'io.tmio', version: '2.4.2') {
entry 'tuweni-bytes'
entry 'tuweni-crypto'
entry 'tuweni-junit'
entry 'tuweni-ssz'
entry 'tuweni-units'
}
Expand Down
3 changes: 0 additions & 3 deletions teku/src/main/java/tech/pegasys/teku/Teku.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@

import java.io.PrintWriter;
import java.nio.charset.Charset;
import java.security.Security;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicReference;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import tech.pegasys.teku.bls.impl.blst.BlstLoader;
import tech.pegasys.teku.cli.BeaconNodeCommand;
import tech.pegasys.teku.cli.BeaconNodeCommand.StartAction;
Expand All @@ -31,7 +29,6 @@ public final class Teku {
static {
// Disable libsodium in tuweni Hash because the check for it's presence can be very slow.
System.setProperty("org.apache.tuweni.crypto.useSodium", "false");
Security.addProvider(new BouncyCastleProvider());
}

public static void main(final String[] args) {
Expand Down

0 comments on commit 89caf92

Please sign in to comment.