feat(upstream): Make output generic by adapter (#236)

This commit is contained in:
Santiago Carmuega 2023-03-16 20:21:06 +01:00 committed by GitHub
parent 6ac63a04e2
commit 44465369be
7 changed files with 63 additions and 42 deletions

View file

@ -7,13 +7,10 @@ use crate::MultiEraTx;
impl<'b> MultiEraTx<'b> {
pub fn aux_plutus_v1_scripts(&self) -> &[alonzo::PlutusScript] {
if let Some(aux_data) = self.aux_data() {
match aux_data.deref() {
alonzo::AuxiliaryData::PostAlonzo(x) => {
if let Some(plutus) = &x.plutus_scripts {
return plutus.as_ref();
}
if let alonzo::AuxiliaryData::PostAlonzo(x) = aux_data.deref() {
if let Some(plutus) = &x.plutus_scripts {
return plutus.as_ref();
}
_ => (),
}
}

View file

@ -1,4 +1,4 @@
use std::{borrow::Cow, ops::Deref};
use std::borrow::Cow;
use pallas_codec::minicbor;
use pallas_crypto::hash::Hash;