feat(cli): support mainnet address output

closes #832
This commit is contained in:
rvcas
2024-02-27 21:55:13 -05:00
parent 50c37c7a14
commit d18caaeecb
4 changed files with 17 additions and 3 deletions

View File

@@ -23,6 +23,10 @@ pub struct Args {
/// Force the project to be rebuilt, otherwise relies on existing artifacts (i.e. plutus.json)
#[clap(long)]
rebuild: bool,
/// Output the address for mainnet (this command defaults to testnet)
#[clap(long)]
mainnet: bool,
}
pub fn exec(
@@ -32,6 +36,7 @@ pub fn exec(
validator,
delegated_to,
rebuild,
mainnet,
}: Args,
) -> miette::Result<()> {
with_project(directory.as_deref(), false, |p| {
@@ -51,7 +56,7 @@ pub fn exec(
let title = title.as_ref().or(validator.as_ref());
let address = p.address(title, delegated_to.as_ref())?;
let address = p.address(title, delegated_to.as_ref(), mainnet)?;
println!("{}", address.to_bech32().unwrap());

View File

@@ -46,7 +46,7 @@ pub fn exec(
let title = title.as_ref().or(validator.as_ref());
let address = p.address(title, None)?;
let address = p.address(title, None, false)?;
println!("{}", address.payment().to_hex());