Skip to content

Commit

Permalink
Injecting BftExtraDataCodec into SubsequentMessageValidator (hyperled…
Browse files Browse the repository at this point in the history
…ger#2640)

Signed-off-by: Lucas Saldanha <lucascrsaldanha@gmail.com>
  • Loading branch information
lucassaldanha authored Aug 16, 2021
1 parent d844a37 commit eff15cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

import org.hyperledger.besu.consensus.common.bft.BftBlockHeaderFunctions;
import org.hyperledger.besu.consensus.common.bft.BftBlockInterface;
import org.hyperledger.besu.consensus.common.bft.BftExtraDataCodec;
import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier;
import org.hyperledger.besu.consensus.qbft.QbftExtraDataCodec;
import org.hyperledger.besu.consensus.qbft.messagewrappers.Commit;
import org.hyperledger.besu.consensus.qbft.messagewrappers.Prepare;
import org.hyperledger.besu.consensus.qbft.messagewrappers.Proposal;
Expand All @@ -43,12 +43,13 @@ public SubsequentMessageValidator(
final Collection<Address> validators,
final ConsensusRoundIdentifier targetRound,
final Block proposalBlock,
final BftBlockInterface blockInterface) {
final BftBlockInterface blockInterface,
final BftExtraDataCodec bftExtraDataCodec) {
final Block commitBlock =
blockInterface.replaceRoundInBlock(
proposalBlock,
targetRound.getRoundNumber(),
BftBlockHeaderFunctions.forCommittedSeal(new QbftExtraDataCodec()));
BftBlockHeaderFunctions.forCommittedSeal(bftExtraDataCodec));
prepareValidator = new PrepareValidator(validators, targetRound, proposalBlock.getHash());
commitValidator =
new CommitValidator(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public MessageValidator createMessageValidator(
return new MessageValidator(
block ->
new SubsequentMessageValidator(
validatorsForHeight, roundIdentifier, block, blockInterface),
validatorsForHeight, roundIdentifier, block, blockInterface, bftExtraDataCodec),
proposalValidator);
}

Expand Down

0 comments on commit eff15cc

Please sign in to comment.