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

@@ -161,7 +161,9 @@ impl<'a> Deserialize<'a> for Program<DeBruijn> {
impl Program<DeBruijn> {
pub fn address(&self, network: Network, delegation: ShelleyDelegationPart) -> ShelleyAddress {
let cbor = self.to_cbor().unwrap();
let validator_hash = babbage::PlutusV2Script(cbor.into()).compute_hash();
ShelleyAddress::new(
network,
ShelleyPaymentPart::Script(validator_hash),