@ -21,7 +21,6 @@ import tech.pegasys.pantheon.consensus.ibft.blockcreation.ProposerSelector;
import tech.pegasys.pantheon.ethereum.BlockValidator ;
import tech.pegasys.pantheon.ethereum.BlockValidator ;
import tech.pegasys.pantheon.ethereum.ProtocolContext ;
import tech.pegasys.pantheon.ethereum.ProtocolContext ;
import tech.pegasys.pantheon.ethereum.core.Address ;
import tech.pegasys.pantheon.ethereum.core.Address ;
import tech.pegasys.pantheon.ethereum.core.BlockHeader ;
import tech.pegasys.pantheon.ethereum.mainnet.ProtocolSchedule ;
import tech.pegasys.pantheon.ethereum.mainnet.ProtocolSchedule ;
import java.util.Collection ;
import java.util.Collection ;
@ -58,20 +57,20 @@ public class MessageValidatorFactory {
return new MessageValidator ( createSignedDataValidator ( roundIdentifier ) ) ;
return new MessageValidator ( createSignedDataValidator ( roundIdentifier ) ) ;
}
}
public RoundChangeMessageValidator createRoundChangeMessageValidator (
public RoundChangeMessageValidator createRoundChangeMessageValidator ( final long chainHeight ) {
final BlockHeader parentHeader ) {
final Collection < Address > validators =
final Collection < Address > validators =
protocolContext . getConsensusState ( ) . getVoteTally ( ) . getValidators ( ) ;
protocolContext . getConsensusState ( ) . getVoteTally ( ) . getValidators ( ) ;
return new RoundChangeMessageValidator (
return new RoundChangeMessageValidator (
new RoundChangePayloadValidator (
new RoundChangePayloadValidator (
this : : createSignedDataValidator ,
this : : createSignedDataValidator ,
validators ,
validators ,
prepareMessageCountForQuorum (
prepareMessageCountForQuorum (
IbftHelpers . calculateRequiredValidatorQuorum ( validators . size ( ) ) ) ,
IbftHelpers . calculateRequiredValidatorQuorum ( validators . size ( ) ) ) ,
parentHeader . getNumber ( ) + 1 ) ) ;
chainHeight ) ) ;
}
}
public NewRoundMessageValidator createNewRoundValidator ( final BlockHeader parentHeader ) {
public NewRoundMessageValidator createNewRoundValidator ( final long chainHeight ) {
final Collection < Address > validators =
final Collection < Address > validators =
protocolContext . getConsensusState ( ) . getVoteTally ( ) . getValidators ( ) ;
protocolContext . getConsensusState ( ) . getVoteTally ( ) . getValidators ( ) ;
return new NewRoundMessageValidator (
return new NewRoundMessageValidator (
@ -80,6 +79,6 @@ public class MessageValidatorFactory {
proposerSelector ,
proposerSelector ,
this : : createSignedDataValidator ,
this : : createSignedDataValidator ,
IbftHelpers . calculateRequiredValidatorQuorum ( validators . size ( ) ) ,
IbftHelpers . calculateRequiredValidatorQuorum ( validators . size ( ) ) ,
parentHeader . getNumber ( ) + 1 ) ) ;
chainHeight ) ) ;
}
}
}
}