feat(traverse): Expose collateral return (#158)

This commit is contained in:
Sebastien Guillemot 2022-08-04 04:14:00 +09:00 committed by GitHub
parent 4965603e32
commit 737b0eee21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -192,6 +192,17 @@ impl<'b> MultiEraTx<'b> {
}
}
pub fn collateral_return(&self) -> Option<MultiEraOutput> {
match self {
MultiEraTx::Babbage(x) => x
.transaction_body
.collateral_return
.as_ref()
.map(MultiEraOutput::from_babbage),
_ => None
}
}
pub fn withdrawals(&self) -> MultiEraWithdrawals {
match self {
MultiEraTx::AlonzoCompatible(x, _) => match &x.transaction_body.withdrawals {