package meerkat.voting.output.outputcommands;

import com.google.protobuf.ByteString;
import meerkat.protobuf.Voting.*;
import meerkat.voting.controller.callbacks.ControllerCallback;

/**
 * This OutputCommand supplies the necessary details for outputting a commit to the ballot
 */
public class CommitOutputCommand extends OutputCommand<Void> {

    private final PlaintextBallot plaintextBallot;
    private final SignedEncryptedBallot signedEncryptedBallot;

    public CommitOutputCommand(PlaintextBallot plaintextBallot,
                               SignedEncryptedBallot signedEncryptedBallot,
                               ControllerCallback<Void> callback) {
        super(callback);
        this.plaintextBallot = plaintextBallot;
        this.signedEncryptedBallot = signedEncryptedBallot;
    }

    public ByteString getChannelIdentifierByteString() {
        return plaintextBallot.getChannelIdentifier();
    }

    public PlaintextBallot getPlaintext() {
        return plaintextBallot;
    }

    public SignedEncryptedBallot getSignedEncryptedBallot() {
        return signedEncryptedBallot;
    }
}
