class PhasingAppendix extends AbstractAppendix {

    public void validateFinishHeightAndTime(Integer height, Integer time) throws AplException.NotCurrentlyValidException {

        if ((this.finishHeight != -1 && time != -1) || (this.finishHeight == -1 && time == -1)) {
            throw new AplException.NotCurrentlyValidException("Only one parameter should be filled 'phasingFinishHeight or phasingFinishTime'");
        }

        Block lastBlock = lookupBlockchain().getLastBlock();
        int lastBlockHeight = lastBlock.getHeight();
        int currentTime = lookupTimeService().getEpochTime();

        if (time == -1 &&
            (this.finishHeight <= lastBlockHeight + (params.getVoteWeighting().acceptsVotes() ? 2 : 1) ||
                this.finishHeight >= lastBlockHeight + Constants.MAX_PHASING_DURATION)) {
            throw new AplException.NotCurrentlyValidException("Invalid finish height " + height);
        }


        if (this.finishHeight == -1 && time >= currentTime + Constants.MAX_PHASING_TIME_DURATION_SEC) {
            throw new AplException.NotCurrentlyValidException("Invalid finish time " + time);
        }

    }

    public  PhasingAppendix(ByteBuffer buffer);
    public  PhasingAppendix(JSONObject attachmentData);
    public  PhasingAppendix(int finishHeight, PhasingParams phasingParams, byte[][] linkedFullHashes, byte[] hashedSecret, byte algorithm);

}