diff --git a/consensus/clique/src/main/java/tech/pegasys/pantheon/consensus/clique/jsonrpc/CliqueRpcApis.java b/consensus/clique/src/main/java/tech/pegasys/pantheon/consensus/clique/jsonrpc/CliqueRpcApis.java index 909c95a657..f448af997f 100644 --- a/consensus/clique/src/main/java/tech/pegasys/pantheon/consensus/clique/jsonrpc/CliqueRpcApis.java +++ b/consensus/clique/src/main/java/tech/pegasys/pantheon/consensus/clique/jsonrpc/CliqueRpcApis.java @@ -26,8 +26,4 @@ public class CliqueRpcApis { return Optional.empty(); } } - - public static final String getName(final RpcApi rpcapi) { - return rpcapi.getCliValue(); - } } diff --git a/consensus/clique/src/test/java/tech/pegasys/pantheon/consensus/clique/CliqueBlockHashingTest.java b/consensus/clique/src/test/java/tech/pegasys/pantheon/consensus/clique/CliqueBlockHashingTest.java index ff565f83c3..d52b6e1a43 100644 --- a/consensus/clique/src/test/java/tech/pegasys/pantheon/consensus/clique/CliqueBlockHashingTest.java +++ b/consensus/clique/src/test/java/tech/pegasys/pantheon/consensus/clique/CliqueBlockHashingTest.java @@ -31,25 +31,7 @@ import org.junit.Test; public class CliqueBlockHashingTest { - public static class LoadedBlockHeader { - private final BlockHeader header; - private final Hash parsedBlockHash; - - public LoadedBlockHeader(final BlockHeader header, final Hash parsedBlockHash) { - this.header = header; - this.parsedBlockHash = parsedBlockHash; - } - - public BlockHeader getHeader() { - return header; - } - - public Hash getParsedBlockHash() { - return parsedBlockHash; - } - } - - private LoadedBlockHeader expectedHeader = null; + private BlockHeader expectedHeader = null; // clique.getSignersAtHash("0x8b27a29300811af926039b90288d3d384dcb55931049c17c4f762e45c116776e") private static final List
VALIDATORS_IN_HEADER = @@ -67,27 +49,25 @@ public class CliqueBlockHashingTest { @Test public void recoverProposerAddressFromSeal() { - final CliqueExtraData cliqueExtraData = - CliqueExtraData.decode(expectedHeader.getHeader().getExtraData()); + final CliqueExtraData cliqueExtraData = CliqueExtraData.decode(expectedHeader.getExtraData()); final Address proposerAddress = - CliqueBlockHashing.recoverProposerAddress(expectedHeader.getHeader(), cliqueExtraData); + CliqueBlockHashing.recoverProposerAddress(expectedHeader, cliqueExtraData); assertThat(VALIDATORS_IN_HEADER.contains(proposerAddress)).isTrue(); } @Test public void readValidatorListFromExtraData() { - final CliqueExtraData cliqueExtraData = - CliqueExtraData.decode(expectedHeader.getHeader().getExtraData()); + final CliqueExtraData cliqueExtraData = CliqueExtraData.decode(expectedHeader.getExtraData()); assertThat(cliqueExtraData.getValidators()).isEqualTo(VALIDATORS_IN_HEADER); } @Test public void calculateBlockHash() { - assertThat(expectedHeader.getHeader().getHash()).isEqualTo(KNOWN_BLOCK_HASH); + assertThat(expectedHeader.getHash()).isEqualTo(KNOWN_BLOCK_HASH); } - private LoadedBlockHeader createKnownHeaderFromCapturedData() { + private BlockHeader createKnownHeaderFromCapturedData() { // The following text was a dump from the geth console of the 30_000 block on Rinkeby. // eth.getBlock(30000) final BlockHeaderBuilder builder = new BlockHeaderBuilder(); @@ -118,11 +98,8 @@ public class CliqueBlockHashingTest { builder.transactionsRoot( Hash.fromHexString("0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421")); - final Hash parsedHash = - Hash.fromHexString("0x8b27a29300811af926039b90288d3d384dcb55931049c17c4f762e45c116776e"); - builder.blockHashFunction(MainnetBlockHashFunction::createHash); - return new LoadedBlockHeader(builder.buildBlockHeader(), parsedHash); + return builder.buildBlockHeader(); } } diff --git a/consensus/clique/src/test/java/tech/pegasys/pantheon/consensus/clique/headervalidationrules/SignerRateLimitValidationRuleTest.java b/consensus/clique/src/test/java/tech/pegasys/pantheon/consensus/clique/headervalidationrules/SignerRateLimitValidationRuleTest.java deleted file mode 100644 index 3af898e92c..0000000000 --- a/consensus/clique/src/test/java/tech/pegasys/pantheon/consensus/clique/headervalidationrules/SignerRateLimitValidationRuleTest.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2018 ConsenSys AG. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package tech.pegasys.pantheon.consensus.clique.headervalidationrules; - -public class SignerRateLimitValidationRuleTest { - - // Implicitly conducted by NodeCanProduceNextBlockTest. -} diff --git a/consensus/clique/src/test/java/tech/pegasys/pantheon/consensus/clique/jsonrpc/methods/DiscardTest.java b/consensus/clique/src/test/java/tech/pegasys/pantheon/consensus/clique/jsonrpc/methods/DiscardTest.java index 78868b45ec..92de5d3990 100644 --- a/consensus/clique/src/test/java/tech/pegasys/pantheon/consensus/clique/jsonrpc/methods/DiscardTest.java +++ b/consensus/clique/src/test/java/tech/pegasys/pantheon/consensus/clique/jsonrpc/methods/DiscardTest.java @@ -102,7 +102,6 @@ public class DiscardTest { public void discardWithoutAddress() { final VoteProposer proposer = new VoteProposer(); final Discard discard = new Discard(proposer, new JsonRpcParameter()); - final Address a0 = Address.fromHexString("0"); assertThatThrownBy(() -> discard.response(requestWithParams())) .hasMessage("Missing required json rpc parameter at index 0") diff --git a/consensus/common/src/main/java/tech/pegasys/pantheon/consensus/common/VoteProposer.java b/consensus/common/src/main/java/tech/pegasys/pantheon/consensus/common/VoteProposer.java index b91963db95..ebea214aad 100644 --- a/consensus/common/src/main/java/tech/pegasys/pantheon/consensus/common/VoteProposer.java +++ b/consensus/common/src/main/java/tech/pegasys/pantheon/consensus/common/VoteProposer.java @@ -55,11 +55,6 @@ public class VoteProposer { proposals.remove(address); } - /** Discards all pending votes */ - public void clear() { - proposals.clear(); - } - public Map getProposals() { return proposals; } diff --git a/consensus/ibft/src/integration-test/java/tech/pegasys/pantheon/consensus/ibft/support/TestContext.java b/consensus/ibft/src/integration-test/java/tech/pegasys/pantheon/consensus/ibft/support/TestContext.java index 42f25be6c7..6c38508869 100644 --- a/consensus/ibft/src/integration-test/java/tech/pegasys/pantheon/consensus/ibft/support/TestContext.java +++ b/consensus/ibft/src/integration-test/java/tech/pegasys/pantheon/consensus/ibft/support/TestContext.java @@ -21,7 +21,6 @@ import tech.pegasys.pantheon.ethereum.core.Address; import tech.pegasys.pantheon.ethereum.core.Block; import java.util.ArrayList; -import java.util.Collection; import java.util.List; import java.util.Map; @@ -51,10 +50,6 @@ public class TestContext { this.finalState = finalState; } - public Collection getRemotePeers() { - return remotePeers.values(); - } - public MutableBlockchain getBlockchain() { return blockchain; } diff --git a/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/IbftMessages.java b/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/IbftMessages.java deleted file mode 100644 index f2a2e529c6..0000000000 --- a/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/IbftMessages.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2018 ConsenSys AG. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package tech.pegasys.pantheon.consensus.ibft; - -import tech.pegasys.pantheon.consensus.ibft.messagedata.CommitMessageData; -import tech.pegasys.pantheon.consensus.ibft.messagedata.IbftV2; -import tech.pegasys.pantheon.consensus.ibft.messagedata.NewRoundMessageData; -import tech.pegasys.pantheon.consensus.ibft.messagedata.PrepareMessageData; -import tech.pegasys.pantheon.consensus.ibft.messagedata.ProposalMessageData; -import tech.pegasys.pantheon.consensus.ibft.messagedata.RoundChangeMessageData; -import tech.pegasys.pantheon.consensus.ibft.payload.SignedData; -import tech.pegasys.pantheon.ethereum.p2p.api.Message; -import tech.pegasys.pantheon.ethereum.p2p.api.MessageData; - -public class IbftMessages { - - public static SignedData fromMessage(final Message message) { - final MessageData messageData = message.getData(); - - switch (messageData.getCode()) { - case IbftV2.PROPOSAL: - return ProposalMessageData.fromMessageData(messageData).decode(); - - case IbftV2.PREPARE: - return PrepareMessageData.fromMessageData(messageData).decode(); - - case IbftV2.COMMIT: - return CommitMessageData.fromMessageData(messageData).decode(); - - case IbftV2.ROUND_CHANGE: - return RoundChangeMessageData.fromMessageData(messageData).decode(); - - case IbftV2.NEW_ROUND: - return NewRoundMessageData.fromMessageData(messageData).decode(); - - default: - throw new IllegalArgumentException( - "Received message does not conform to any recognised IBFT message structure."); - } - } -} diff --git a/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/Vote.java b/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/Vote.java index 53a2ba9745..9c0fadd3d9 100644 --- a/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/Vote.java +++ b/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/Vote.java @@ -79,10 +79,6 @@ public class Vote { return Objects.hashCode(recipient, voteType); } - public VoteType getVoteType() { - return voteType; - } - public void writeTo(final RLPOutput rlpOutput) { rlpOutput.startList(); rlpOutput.writeBytesValue(recipient); diff --git a/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/blockcreation/IbftBlockMiner.java b/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/blockcreation/IbftBlockMiner.java deleted file mode 100644 index e32d5af33a..0000000000 --- a/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/blockcreation/IbftBlockMiner.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2018 ConsenSys AG. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package tech.pegasys.pantheon.consensus.ibft.blockcreation; - -import tech.pegasys.pantheon.consensus.ibft.IbftContext; -import tech.pegasys.pantheon.ethereum.ProtocolContext; -import tech.pegasys.pantheon.ethereum.blockcreation.AbstractBlockScheduler; -import tech.pegasys.pantheon.ethereum.blockcreation.BlockMiner; -import tech.pegasys.pantheon.ethereum.chain.MinedBlockObserver; -import tech.pegasys.pantheon.ethereum.core.BlockHeader; -import tech.pegasys.pantheon.ethereum.mainnet.ProtocolSchedule; -import tech.pegasys.pantheon.util.Subscribers; - -public class IbftBlockMiner extends BlockMiner { - - // TODO(tmm): Currently a place holder to allow infrastructure code to continue to operate - // with the advent of multiple consensus methods. - public IbftBlockMiner( - final IbftBlockCreator blockCreator, - final ProtocolSchedule protocolSchedule, - final ProtocolContext protocolContext, - final Subscribers observers, - final AbstractBlockScheduler scheduler, - final BlockHeader parentHeader) { - super(blockCreator, protocolSchedule, protocolContext, observers, scheduler, parentHeader); - } -} diff --git a/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/jsonrpc/IbftRpcApis.java b/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/jsonrpc/IbftRpcApis.java index bc25a0deb9..7da15a990d 100644 --- a/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/jsonrpc/IbftRpcApis.java +++ b/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/jsonrpc/IbftRpcApis.java @@ -26,8 +26,4 @@ public class IbftRpcApis { return Optional.empty(); } } - - public static final String getName(final RpcApi rpcapi) { - return rpcapi.getCliValue(); - } } diff --git a/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/messagedata/AbstractIbftMessageData.java b/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/messagedata/AbstractIbftMessageData.java index dcfb7d9d90..ad76835e3e 100644 --- a/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/messagedata/AbstractIbftMessageData.java +++ b/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/messagedata/AbstractIbftMessageData.java @@ -12,8 +12,6 @@ */ package tech.pegasys.pantheon.consensus.ibft.messagedata; -import tech.pegasys.pantheon.consensus.ibft.payload.Payload; -import tech.pegasys.pantheon.consensus.ibft.payload.SignedData; import tech.pegasys.pantheon.ethereum.p2p.api.MessageData; import tech.pegasys.pantheon.ethereum.p2p.wire.AbstractMessageData; import tech.pegasys.pantheon.util.bytes.BytesValue; @@ -25,8 +23,6 @@ public abstract class AbstractIbftMessageData extends AbstractMessageData { super(data); } - public abstract SignedData decode(); - protected static T fromMessageData( final MessageData messageData, final int messageCode, diff --git a/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/messagedata/CommitMessageData.java b/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/messagedata/CommitMessageData.java index 4418f88e7b..b6e52fbfa6 100644 --- a/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/messagedata/CommitMessageData.java +++ b/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/messagedata/CommitMessageData.java @@ -31,7 +31,6 @@ public class CommitMessageData extends AbstractIbftMessageData { messageData, MESSAGE_CODE, CommitMessageData.class, CommitMessageData::new); } - @Override public SignedData decode() { return SignedData.readSignedCommitPayloadFrom(RLP.input(data)); } diff --git a/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/messagedata/NewRoundMessageData.java b/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/messagedata/NewRoundMessageData.java index 6f6271c5cd..79289873f2 100644 --- a/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/messagedata/NewRoundMessageData.java +++ b/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/messagedata/NewRoundMessageData.java @@ -31,7 +31,6 @@ public class NewRoundMessageData extends AbstractIbftMessageData { messageData, MESSAGE_CODE, NewRoundMessageData.class, NewRoundMessageData::new); } - @Override public SignedData decode() { return SignedData.readSignedNewRoundPayloadFrom(RLP.input(data)); } diff --git a/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/messagedata/PrepareMessageData.java b/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/messagedata/PrepareMessageData.java index 32d8fd0f41..4ab92ec797 100644 --- a/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/messagedata/PrepareMessageData.java +++ b/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/messagedata/PrepareMessageData.java @@ -31,7 +31,6 @@ public class PrepareMessageData extends AbstractIbftMessageData { messageData, MESSAGE_CODE, PrepareMessageData.class, PrepareMessageData::new); } - @Override public SignedData decode() { return SignedData.readSignedPreparePayloadFrom(RLP.input(data)); } diff --git a/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/messagedata/ProposalMessageData.java b/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/messagedata/ProposalMessageData.java index fe2d46bfc0..e836da7a9a 100644 --- a/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/messagedata/ProposalMessageData.java +++ b/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/messagedata/ProposalMessageData.java @@ -31,7 +31,6 @@ public class ProposalMessageData extends AbstractIbftMessageData { messageData, MESSAGE_CODE, ProposalMessageData.class, ProposalMessageData::new); } - @Override public SignedData decode() { return SignedData.readSignedProposalPayloadFrom(RLP.input(data)); } diff --git a/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/messagedata/RoundChangeMessageData.java b/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/messagedata/RoundChangeMessageData.java index 1c3b631df5..ebbb0cf66a 100644 --- a/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/messagedata/RoundChangeMessageData.java +++ b/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/messagedata/RoundChangeMessageData.java @@ -31,7 +31,6 @@ public class RoundChangeMessageData extends AbstractIbftMessageData { messageData, MESSAGE_CODE, RoundChangeMessageData.class, RoundChangeMessageData::new); } - @Override public SignedData decode() { return SignedData.readSignedRoundChangePayloadFrom(RLP.input(data)); } diff --git a/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/payload/NewRoundPayload.java b/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/payload/NewRoundPayload.java index 9badbecd6a..e1281fbbe4 100644 --- a/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/payload/NewRoundPayload.java +++ b/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/payload/NewRoundPayload.java @@ -113,8 +113,6 @@ public class NewRoundPayload implements Payload { private SignedData proposalPayload = null; - public Builder() {} - public Builder( final ConsensusRoundIdentifier roundChangeIdentifier, final RoundChangeCertificate roundChangeCertificate, @@ -137,10 +135,6 @@ public class NewRoundPayload implements Payload { this.roundChangeCertificate = roundChangeCertificate; } - public void setProposalPayload(final SignedData proposalPayload) { - this.proposalPayload = proposalPayload; - } - public NewRoundPayload build() { return new NewRoundPayload(roundChangeIdentifier, roundChangeCertificate, proposalPayload); } diff --git a/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/statemachine/IbftFinalState.java b/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/statemachine/IbftFinalState.java index 41e6454210..b9c4be03cc 100644 --- a/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/statemachine/IbftFinalState.java +++ b/consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/statemachine/IbftFinalState.java @@ -88,10 +88,6 @@ public class IbftFinalState { return localAddress; } - public ProposerSelector getProposerSelector() { - return proposerSelector; - } - public boolean isLocalNodeProposerForRound(final ConsensusRoundIdentifier roundIdentifier) { return getProposerForRound(roundIdentifier).equals(localAddress); } diff --git a/consensus/ibft/src/test-support/java/tech/pegasys/pantheon/consensus/ibft/IbftProtocolContextFixture.java b/consensus/ibft/src/test-support/java/tech/pegasys/pantheon/consensus/ibft/IbftProtocolContextFixture.java index 7dd15bd313..c4dd2932f1 100644 --- a/consensus/ibft/src/test-support/java/tech/pegasys/pantheon/consensus/ibft/IbftProtocolContextFixture.java +++ b/consensus/ibft/src/test-support/java/tech/pegasys/pantheon/consensus/ibft/IbftProtocolContextFixture.java @@ -12,8 +12,6 @@ */ package tech.pegasys.pantheon.consensus.ibft; -import static java.util.Arrays.asList; - import tech.pegasys.pantheon.consensus.common.VoteProposer; import tech.pegasys.pantheon.consensus.common.VoteTally; import tech.pegasys.pantheon.ethereum.ProtocolContext; @@ -23,10 +21,6 @@ import java.util.List; public class IbftProtocolContextFixture { - public static ProtocolContext protocolContext(final Address... validators) { - return protocolContext(asList(validators)); - } - public static ProtocolContext protocolContext(final List
validators) { return new ProtocolContext<>( null, null, new IbftContext(new VoteTally(validators), new VoteProposer())); diff --git a/consensus/ibft/src/test/java/tech/pegasys/pantheon/consensus/ibft/network/MockPeerFactory.java b/consensus/ibft/src/test/java/tech/pegasys/pantheon/consensus/ibft/network/MockPeerFactory.java index 150e47b5a1..a27312587a 100644 --- a/consensus/ibft/src/test/java/tech/pegasys/pantheon/consensus/ibft/network/MockPeerFactory.java +++ b/consensus/ibft/src/test/java/tech/pegasys/pantheon/consensus/ibft/network/MockPeerFactory.java @@ -16,14 +16,10 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import tech.pegasys.pantheon.ethereum.core.Address; -import tech.pegasys.pantheon.ethereum.core.AddressHelpers; import tech.pegasys.pantheon.ethereum.p2p.api.PeerConnection; import tech.pegasys.pantheon.ethereum.p2p.wire.PeerInfo; public class MockPeerFactory { - public static PeerConnection create() { - return create(AddressHelpers.ofValue(9)); - } public static PeerConnection create(final Address address) { final PeerConnection peerConnection = mock(PeerConnection.class); diff --git a/consensus/ibftlegacy/src/main/java/tech/pegasys/pantheon/consensus/ibftlegacy/blockcreation/IbftBlockCreator.java b/consensus/ibftlegacy/src/main/java/tech/pegasys/pantheon/consensus/ibftlegacy/blockcreation/IbftBlockCreator.java index da8709bd37..514fa3853e 100644 --- a/consensus/ibftlegacy/src/main/java/tech/pegasys/pantheon/consensus/ibftlegacy/blockcreation/IbftBlockCreator.java +++ b/consensus/ibftlegacy/src/main/java/tech/pegasys/pantheon/consensus/ibftlegacy/blockcreation/IbftBlockCreator.java @@ -34,9 +34,6 @@ import tech.pegasys.pantheon.ethereum.mainnet.ScheduleBasedBlockHashFunction; import java.util.function.Function; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - /** * Responsible for producing a Block which conforms to IBFT validation rules (other than missing * commit seals). Transactions and associated Hashes (stateroot, receipts etc.) are loaded into the @@ -44,8 +41,6 @@ import org.apache.logging.log4j.Logger; */ public class IbftBlockCreator extends AbstractBlockCreator { - private static final Logger LOG = LogManager.getLogger(); - private final KeyPair nodeKeys; public IbftBlockCreator( diff --git a/consensus/ibftlegacy/src/main/java/tech/pegasys/pantheon/consensus/ibftlegacy/blockcreation/IbftExtraDataCalculator.java b/consensus/ibftlegacy/src/main/java/tech/pegasys/pantheon/consensus/ibftlegacy/blockcreation/IbftExtraDataCalculator.java deleted file mode 100644 index 030d4e3c9d..0000000000 --- a/consensus/ibftlegacy/src/main/java/tech/pegasys/pantheon/consensus/ibftlegacy/blockcreation/IbftExtraDataCalculator.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2018 ConsenSys AG. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package tech.pegasys.pantheon.consensus.ibftlegacy.blockcreation; - -import tech.pegasys.pantheon.consensus.common.ValidatorProvider; -import tech.pegasys.pantheon.consensus.ibftlegacy.IbftExtraData; -import tech.pegasys.pantheon.ethereum.blockcreation.AbstractBlockCreator.ExtraDataCalculator; -import tech.pegasys.pantheon.ethereum.core.BlockHeader; -import tech.pegasys.pantheon.util.bytes.BytesValue; - -import com.google.common.collect.Lists; - -public class IbftExtraDataCalculator implements ExtraDataCalculator { - - private final ValidatorProvider validatorProvider; - - public IbftExtraDataCalculator(final ValidatorProvider validatorProvider) { - this.validatorProvider = validatorProvider; - } - - @Override - public BytesValue get(final BlockHeader parent) { - final BytesValue vanityData = BytesValue.wrap(new byte[32]); - final IbftExtraData baseExtraData = - new IbftExtraData( - vanityData, - Lists.newArrayList(), - null, - Lists.newArrayList(validatorProvider.getValidators())); - return baseExtraData.encode(); - } -}