feat(traverse): Add reference inputs to Tx (#161)

This commit is contained in:
Sebastien Guillemot 2022-08-07 03:28:25 +09:00 committed by GitHub
parent 60a6e99189
commit dde9f96595
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -134,6 +134,23 @@ impl<'b> MultiEraTx<'b> {
}
}
pub fn reference_inputs(&self) -> Vec<MultiEraInput> {
match self {
MultiEraTx::Babbage(x) => x
.transaction_body
.reference_inputs
.as_ref()
.map(|inputs|
inputs
.iter()
.map(MultiEraInput::from_alonzo_compatible)
.collect()
)
.unwrap_or_default(),
_ => vec![]
}
}
pub fn certs(&self) -> Vec<MultiEraCert> {
match self {
MultiEraTx::AlonzoCompatible(x, _) => x