use crate::CliWallet;
#[derive(clap::Args, PartialEq, core::fmt::Debug, Clone, PartialOrd, Ord, Eq, Hash)]
pub struct JsonStringArg {
#[arg(long, help = "The JSON formatted transaction")]
pub json: String,
}
#[derive(clap::Args, PartialEq, core::fmt::Debug, Clone, PartialOrd, Ord, Eq, Hash)]
pub struct FileNameArg {
#[arg(long, help = "The JSON formatted transaction")]
pub path: String,
}
impl TryFrom<FileNameArg> for JsonStringArg {
type Error = std::io::Error;
fn try_from(arg: FileNameArg) -> Result<Self, Self::Error> {
let json = std::fs::read_to_string(arg.path)?;
Ok(JsonStringArg { json })
}
}
pub trait CliFrontEnd<RT>
where
RT: CliWallet,
{
type CliIntermediateRepr<U>;
}