mod cast;
mod tally;
mod tx;
use crate::controller::{Error, UserInteractionController};
use cast::CastVote;
use clap::Parser;
use tally::VoteTally;
use tx::SendTransaction;
#[derive(Parser, Debug)]
pub enum Send {
Tx(SendTransaction),
Tally(VoteTally),
Vote(CastVote),
}
impl Send {
pub fn exec(&self, controller: &mut UserInteractionController) -> Result<(), Error> {
match self {
Send::Tx(transaction) => transaction.exec(controller),
Send::Tally(vote_tally) => vote_tally.exec(controller),
Send::Vote(cast_vote) => cast_vote.exec(controller),
}
}
}