use of org.hyperledger.besu.ethereum.blockcreation.BlockCreator in project besu by hyperledger.
the class PkiQbftBlockCreatorTest method before.
@Before
public void before() {
blockCreator = mock(BlockCreator.class);
cmsCreator = mock(CmsCreator.class);
pkiQbftBlockCreator = new PkiQbftBlockCreator(blockCreator, cmsCreator, extraDataCodec);
blockHeaderBuilder = new BlockHeaderTestFixture();
}
use of org.hyperledger.besu.ethereum.blockcreation.BlockCreator in project besu by hyperledger.
the class QbftRoundFactory method createNewRoundWithState.
public QbftRound createNewRoundWithState(final BlockHeader parentHeader, final RoundState roundState) {
final ConsensusRoundIdentifier roundIdentifier = roundState.getRoundIdentifier();
final BlockCreator blockCreator = blockCreatorFactory.create(parentHeader, 0);
// TODO(tmm): Why is this created everytime?!
final QbftMessageTransmitter messageTransmitter = new QbftMessageTransmitter(messageFactory, finalState.getValidatorMulticaster());
return new QbftRound(roundState, blockCreator, protocolContext, protocolSchedule.getByBlockNumber(roundIdentifier.getSequenceNumber()).getBlockImporter(), minedBlockObservers, finalState.getNodeKey(), messageFactory, messageTransmitter, finalState.getRoundTimer(), bftExtraDataCodec);
}
use of org.hyperledger.besu.ethereum.blockcreation.BlockCreator in project besu by hyperledger.
the class IbftRoundFactory method createNewRoundWithState.
public IbftRound createNewRoundWithState(final BlockHeader parentHeader, final RoundState roundState) {
final ConsensusRoundIdentifier roundIdentifier = roundState.getRoundIdentifier();
final BlockCreator blockCreator = blockCreatorFactory.create(parentHeader, roundIdentifier.getRoundNumber());
final IbftMessageTransmitter messageTransmitter = new IbftMessageTransmitter(messageFactory, finalState.getValidatorMulticaster());
return new IbftRound(roundState, blockCreator, protocolContext, protocolSchedule.getByBlockNumber(roundIdentifier.getSequenceNumber()).getBlockImporter(), minedBlockObservers, finalState.getNodeKey(), messageFactory, messageTransmitter, finalState.getRoundTimer(), bftExtraDataCodec);
}
use of org.hyperledger.besu.ethereum.blockcreation.BlockCreator in project besu by hyperledger.
the class QbftBlockCreatorFactory method create.
@Override
public BlockCreator create(final BlockHeader parentHeader, final int round) {
final BlockCreator blockCreator = super.create(parentHeader, round);
final QbftContext qbftContext = protocolContext.getConsensusContext(QbftContext.class);
if (qbftContext.getPkiBlockCreationConfiguration().isEmpty()) {
return blockCreator;
} else {
return new PkiQbftBlockCreator(blockCreator, qbftContext.getPkiBlockCreationConfiguration().get(), bftExtraDataCodec);
}
}
Aggregations