From e7ae4b9abae78f605f2edc9c2d5b7061baa50d71 Mon Sep 17 00:00:00 2001 From: Hellblazer Date: Tue, 6 Feb 2024 17:14:06 -0800 Subject: [PATCH] remove unused --- .../apollo/choam/ViewAssemblyTest.java | 4 +--- .../salesforce/apollo/ethereal/Config.java | 16 ++------------ .../apollo/ethereal/EtherealTest.java | 8 +++---- .../apollo/ethereal/RbcAdderTest.java | 22 ++++++++++--------- 4 files changed, 18 insertions(+), 32 deletions(-) diff --git a/choam/src/test/java/com/salesforce/apollo/choam/ViewAssemblyTest.java b/choam/src/test/java/com/salesforce/apollo/choam/ViewAssemblyTest.java index a4926251f..7819d166b 100644 --- a/choam/src/test/java/com/salesforce/apollo/choam/ViewAssemblyTest.java +++ b/choam/src/test/java/com/salesforce/apollo/choam/ViewAssemblyTest.java @@ -182,9 +182,7 @@ public void complete() { } private void initEthereals() { - var builder = Config.newBuilder() - .setnProc(CARDINALITY) - .setVerifiers(members.toArray(new Verifier[members.size()])); + var builder = Config.newBuilder().setnProc(CARDINALITY); for (short i = 0; i < CARDINALITY; i++) { final short pid = i; diff --git a/ethereal/src/main/java/com/salesforce/apollo/ethereal/Config.java b/ethereal/src/main/java/com/salesforce/apollo/ethereal/Config.java index 5b87acd21..86b7f0074 100644 --- a/ethereal/src/main/java/com/salesforce/apollo/ethereal/Config.java +++ b/ethereal/src/main/java/com/salesforce/apollo/ethereal/Config.java @@ -10,7 +10,6 @@ import com.salesforce.apollo.cryptography.SignatureAlgorithm; import com.salesforce.apollo.cryptography.Signer; import com.salesforce.apollo.cryptography.Signer.MockSigner; -import com.salesforce.apollo.cryptography.Verifier; import com.salesforce.apollo.ethereal.WeakThresholdKey.NoOpWeakThresholdKey; import com.salesforce.apollo.membership.Context; import org.joou.ULong; @@ -24,7 +23,7 @@ */ public record Config(String label, short nProc, int epochLength, short pid, Signer signer, DigestAlgorithm digestAlgorithm, int numberOfEpochs, WeakThresholdKey WTKey, double bias, - Verifier[] verifiers, double fpr) { + double fpr) { public static Builder newBuilder() { return new Builder(); @@ -50,7 +49,6 @@ public static class Builder implements Cloneable { private double pByz = -1; private short pid; private Signer signer = new MockSigner(SignatureAlgorithm.DEFAULT, ULong.MIN); - private Verifier[] verifiers; private WeakThresholdKey wtk; public Builder() { @@ -66,8 +64,7 @@ public Config build() { } Objects.requireNonNull(signer, "Signer cannot be null"); Objects.requireNonNull(digestAlgorithm, "Digest Algorithm cannot be null"); - return new Config(label, nProc, epochLength, pid, signer, digestAlgorithm, numberOfEpochs, wtk, bias, - verifiers, fpr); + return new Config(label, nProc, epochLength, pid, signer, digestAlgorithm, numberOfEpochs, wtk, bias, fpr); } @Override @@ -151,15 +148,6 @@ public Builder setSigner(Signer signer) { return this; } - public Verifier[] getVerifiers() { - return verifiers; - } - - public Builder setVerifiers(Verifier[] verifiers) { - this.verifiers = verifiers; - return this; - } - public WeakThresholdKey getWtk() { return wtk; } diff --git a/ethereal/src/test/java/com/salesforce/apollo/ethereal/EtherealTest.java b/ethereal/src/test/java/com/salesforce/apollo/ethereal/EtherealTest.java index c8ca8482d..a8dab9c9e 100644 --- a/ethereal/src/test/java/com/salesforce/apollo/ethereal/EtherealTest.java +++ b/ethereal/src/test/java/com/salesforce/apollo/ethereal/EtherealTest.java @@ -10,12 +10,10 @@ import com.codahale.metrics.MetricRegistry; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.salesforce.apollo.messaging.proto.ByteMessage; import com.salesforce.apollo.archipelago.LocalServer; import com.salesforce.apollo.archipelago.Router; import com.salesforce.apollo.archipelago.ServerConnectionCache; import com.salesforce.apollo.cryptography.DigestAlgorithm; -import com.salesforce.apollo.cryptography.Verifier; import com.salesforce.apollo.ethereal.memberships.ChRbcGossip; import com.salesforce.apollo.ethereal.memberships.comm.EtherealMetricsImpl; import com.salesforce.apollo.membership.Context; @@ -23,6 +21,7 @@ import com.salesforce.apollo.membership.Member; import com.salesforce.apollo.membership.SigningMember; import com.salesforce.apollo.membership.stereotomy.ControlledIdentifierMember; +import com.salesforce.apollo.messaging.proto.ByteMessage; import com.salesforce.apollo.stereotomy.StereotomyImpl; import com.salesforce.apollo.stereotomy.mem.MemKERL; import com.salesforce.apollo.stereotomy.mem.MemKeyStore; @@ -55,7 +54,7 @@ public class EtherealTest { static { LARGE_TESTS = Boolean.getBoolean("large_tests"); - DELAY_MS = LARGE_TESTS ? 5 : 5; + DELAY_MS = 5; NPROC = LARGE_TESTS ? 7 : 4; } @@ -107,8 +106,7 @@ private void one(int iteration) var builder = Config.newBuilder() .setnProc((short) NPROC) .setNumberOfEpochs(NUM_EPOCHS) - .setEpochLength(EPOCH_LENGTH) - .setVerifiers(members.toArray(new Verifier[members.size()])); + .setEpochLength(EPOCH_LENGTH); List>> produced = new ArrayList<>(); for (int i = 0; i < (short) NPROC; i++) { diff --git a/ethereal/src/test/java/com/salesforce/apollo/ethereal/RbcAdderTest.java b/ethereal/src/test/java/com/salesforce/apollo/ethereal/RbcAdderTest.java index be78d1e3c..12a7ac0de 100644 --- a/ethereal/src/test/java/com/salesforce/apollo/ethereal/RbcAdderTest.java +++ b/ethereal/src/test/java/com/salesforce/apollo/ethereal/RbcAdderTest.java @@ -7,7 +7,6 @@ package com.salesforce.apollo.ethereal; import com.salesforce.apollo.cryptography.DigestAlgorithm; -import com.salesforce.apollo.cryptography.Verifier; import com.salesforce.apollo.ethereal.Adder.State; import com.salesforce.apollo.ethereal.Dag.DagImpl; import com.salesforce.apollo.membership.Context; @@ -35,8 +34,8 @@ */ public class RbcAdderTest { - private Config config; - private List members; + private Config config; + private List members; private HashMap>> units; @BeforeEach @@ -48,17 +47,20 @@ public void before() throws Exception { units = DagTest.collectUnits(d); var context = Context.newBuilder().setCardinality(10).build(); var entropy = SecureRandom.getInstance("SHA1PRNG"); - entropy.setSeed(new byte[]{6, 6, 6}); + entropy.setSeed(new byte[] { 6, 6, 6 }); var stereotomy = new StereotomyImpl(new MemKeyStore(), new MemKERL(DigestAlgorithm.DEFAULT), entropy); - members = IntStream.range(0, 4).mapToObj(i -> stereotomy.newIdentifier()).map(cpk -> new ControlledIdentifierMember(cpk)).map(e -> (SigningMember) e).toList(); + members = IntStream.range(0, 4) + .mapToObj(i -> stereotomy.newIdentifier()) + .map(cpk -> new ControlledIdentifierMember(cpk)) + .map(e -> (SigningMember) e) + .toList(); members.forEach(m -> context.activate(m)); config = Config.newBuilder() - .setnProc((short) members.size()) - .setVerifiers(members.toArray(new Verifier[members.size()])) - .setSigner(members.get(0)) - .setPid((short) 0) - .build(); + .setnProc((short) members.size()) + .setSigner(members.get(0)) + .setPid((short) 0) + .build(); } @Test