Skip to content

Commit

Permalink
cleanup warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Frame <[email protected]>
  • Loading branch information
jframe committed Jan 22, 2025
1 parent 0fa7e5a commit 01ff583
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ public boolean isLocalNodeProposerForRound(final ConsensusRoundIdentifier roundI
* @return true if the local node is a validator, false otherwise
*/
public boolean isLocalNodeValidator() {
final boolean isValidator = getValidators().contains(localAddress);
return isValidator;
return getValidators().contains(localAddress);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@

import static java.util.Collections.emptyList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hyperledger.besu.consensus.common.bft.BftContextBuilder.setupContextWithBftExtraDataEncoder;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;

import org.hyperledger.besu.consensus.common.bft.BftContext;
import org.hyperledger.besu.consensus.common.bft.BftExtraDataCodec;
import org.hyperledger.besu.consensus.common.bft.ConsensusRoundHelpers;
import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier;
Expand All @@ -34,8 +32,6 @@
import org.hyperledger.besu.cryptoservices.NodeKey;
import org.hyperledger.besu.cryptoservices.NodeKeyUtils;
import org.hyperledger.besu.datatypes.Address;
import org.hyperledger.besu.ethereum.ProtocolContext;
import org.hyperledger.besu.ethereum.chain.BadBlockManager;
import org.hyperledger.besu.ethereum.chain.MutableBlockchain;
import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.BlockHeaderTestFixture;
Expand All @@ -58,7 +54,6 @@ public class ProposalPayloadValidatorTest {
@Mock private WorldStateArchive worldStateArchive;
@Mock private BftExtraDataCodec bftExtraDataCodec;
@Mock private QbftBlockCodec blockEncoder;
private ProtocolContext protocolContext;

private static final int CHAIN_HEIGHT = 3;
private final ConsensusRoundIdentifier targetRound =
Expand All @@ -72,12 +67,6 @@ public class ProposalPayloadValidatorTest {

@BeforeEach
public void setup() {
protocolContext =
new ProtocolContext(
blockChain,
worldStateArchive,
setupContextWithBftExtraDataEncoder(BftContext.class, emptyList(), bftExtraDataCodec),
new BadBlockManager());
messageFactory = new MessageFactory(nodeKey, blockEncoder);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@
import static com.google.common.collect.Iterables.toArray;
import static java.util.Collections.emptyList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hyperledger.besu.consensus.common.bft.BftContextBuilder.setupContextWithBftExtraDataEncoder;
import static org.hyperledger.besu.consensus.qbft.core.validation.ValidationTestHelpers.createPreparePayloads;
import static org.hyperledger.besu.consensus.qbft.core.validation.ValidationTestHelpers.createPreparedCertificate;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.when;

import org.hyperledger.besu.consensus.common.bft.BftContext;
import org.hyperledger.besu.consensus.common.bft.BftExtraDataCodec;
import org.hyperledger.besu.consensus.common.bft.BftHelpers;
import org.hyperledger.besu.consensus.common.bft.ConsensusRoundHelpers;
Expand All @@ -43,8 +41,6 @@
import org.hyperledger.besu.consensus.qbft.core.types.QbftProtocolSpec;
import org.hyperledger.besu.crypto.SECPSignature;
import org.hyperledger.besu.datatypes.Hash;
import org.hyperledger.besu.ethereum.ProtocolContext;
import org.hyperledger.besu.ethereum.chain.BadBlockManager;
import org.hyperledger.besu.ethereum.chain.MutableBlockchain;
import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.BlockHeaderTestFixture;
Expand All @@ -70,7 +66,6 @@ public class RoundChangeMessageValidatorTest {
@Mock private QbftProtocolSpec protocolSpec;
@Mock private BftExtraDataCodec bftExtraDataCodec;
@Mock private QbftBlockCodec blockEncoder;
private ProtocolContext protocolContext;

private RoundChangeMessageValidator messageValidator;
private QbftNodeList validators;
Expand All @@ -83,12 +78,6 @@ public class RoundChangeMessageValidatorTest {

@BeforeEach
public void setup() {
protocolContext =
new ProtocolContext(
blockChain,
worldStateArchive,
setupContextWithBftExtraDataEncoder(BftContext.class, emptyList(), bftExtraDataCodec),
new BadBlockManager());
validators = QbftNodeList.createNodes(VALIDATOR_COUNT, blockEncoder);

lenient().when(protocolSchedule.getByBlockHeader(any())).thenReturn(protocolSpec);
Expand Down

0 comments on commit 01ff583

Please sign in to comment.