parent
3bc3792aa3
commit
f306f1715a
|
@ -434,9 +434,11 @@ where
|
||||||
Network::Testnet
|
Network::Testnet
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(validator
|
Ok(validator.program.address(
|
||||||
.program
|
network,
|
||||||
.address(network, delegation_part.to_owned()))
|
delegation_part.to_owned(),
|
||||||
|
&self.config.plutus_version.into(),
|
||||||
|
))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -177,10 +177,19 @@ impl<'a> Deserialize<'a> for Program<DeBruijn> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Program<DeBruijn> {
|
impl Program<DeBruijn> {
|
||||||
pub fn address(&self, network: Network, delegation: ShelleyDelegationPart) -> ShelleyAddress {
|
pub fn address(
|
||||||
|
&self,
|
||||||
|
network: Network,
|
||||||
|
delegation: ShelleyDelegationPart,
|
||||||
|
plutus_version: &Language,
|
||||||
|
) -> ShelleyAddress {
|
||||||
let cbor = self.to_cbor().unwrap();
|
let cbor = self.to_cbor().unwrap();
|
||||||
|
|
||||||
let validator_hash = babbage::PlutusV2Script(cbor.into()).compute_hash();
|
let validator_hash = match plutus_version {
|
||||||
|
Language::PlutusV1 => conway::PlutusV1Script(cbor.into()).compute_hash(),
|
||||||
|
Language::PlutusV2 => conway::PlutusV2Script(cbor.into()).compute_hash(),
|
||||||
|
Language::PlutusV3 => conway::PlutusV3Script(cbor.into()).compute_hash(),
|
||||||
|
};
|
||||||
|
|
||||||
ShelleyAddress::new(
|
ShelleyAddress::new(
|
||||||
network,
|
network,
|
||||||
|
|
Loading…
Reference in New Issue