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

@@ -359,6 +359,7 @@ where
&self,
title: Option<&String>,
stake_address: Option<&String>,
mainnet: bool,
) -> Result<ShelleyAddress, Error> {
// Parse stake address
let stake_address = stake_address
@@ -398,9 +399,15 @@ where
if n > 0 {
Err(blueprint::error::Error::ParameterizedValidator { n }.into())
} else {
let network = if mainnet {
Network::Mainnet
} else {
Network::Testnet
};
Ok(validator
.program
.address(Network::Testnet, delegation_part.to_owned()))
.address(network, delegation_part.to_owned()))
}
})
}