From 737b0eee21c30132e0e9a3d188692979052862fe Mon Sep 17 00:00:00 2001 From: Sebastien Guillemot Date: Thu, 4 Aug 2022 04:14:00 +0900 Subject: [PATCH] feat(traverse): Expose collateral return (#158) --- pallas-traverse/src/tx.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pallas-traverse/src/tx.rs b/pallas-traverse/src/tx.rs index 422ed20..481ae4b 100644 --- a/pallas-traverse/src/tx.rs +++ b/pallas-traverse/src/tx.rs @@ -192,6 +192,17 @@ impl<'b> MultiEraTx<'b> { } } + pub fn collateral_return(&self) -> Option { + 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 {