use crate::NodeTarget;
use devault::Devault;
use std::path::PathBuf;
forc_util::cli_examples! {
super::Command {
[ Submit a transaction from a json file => "forc submit {path}/mint.json" ]
[ Submit a transaction from a json file and wait for confirmation => "forc submit {path}/mint.json --await true" ]
[ Submit a transaction from a json file and get output in json => "forc submit {path}/mint.json --tx-status-json true" ]
[ Submit a transaction from a json file to testnet => "forc submit {path}/mint.json --testnet" ]
[ Submit a transaction from a json file to a local net => "forc submit {path}/mint.json --target local" ]
}
}
#[derive(Debug, Default, clap::Parser)]
#[clap(about, version, after_help = help())]
pub struct Command {
#[clap(flatten)]
pub network: Network,
#[clap(flatten)]
pub tx_status: TxStatus,
pub tx_path: PathBuf,
}
#[derive(Debug, Devault, clap::Args)]
pub struct Network {
#[clap(flatten)]
pub node: NodeTarget,
#[clap(long = "await", default_value = "true", action(clap::ArgAction::Set))]
#[devault("true")]
pub await_: bool,
}
#[derive(Debug, Default, clap::Args)]
pub struct TxStatus {
#[clap(
long = "tx-status-json",
default_value = "false",
action(clap::ArgAction::Set)
)]
pub json: bool,
}