class ProposalBlockConsistencyValidator {

  public boolean validateProposalMatchesBlock(
      final SignedData<ProposalPayload> signedPayload, final Block proposedBlock) {

    if (!signedPayload.getPayload().getDigest().equals(proposedBlock.getHash())) {
      LOG.info("Invalid Proposal, embedded digest does not match block's hash.");
      return false;
    }

    if (proposedBlock.getHeader().getNumber()
        != signedPayload.getPayload().getRoundIdentifier().getSequenceNumber()) {
      LOG.info("Invalid proposal/block - message sequence does not align with block number.");
      return false;
    }

    if (!validateBlockMatchesProposalRound(signedPayload.getPayload(), proposedBlock)) {
      return false;
    }

    return true;
  }

}