Skip to content

Commit a0b4161

Browse files
committed
Added sizedCollateralReturnTxBodyF
1 parent b1512f7 commit a0b4161

File tree

2 files changed

+7
-2
lines changed
  • eras/babbage/impl/src/Cardano/Ledger/Babbage
  • libs/cardano-ledger-core/src/Cardano/Ledger/Core

2 files changed

+7
-2
lines changed

eras/babbage/impl/src/Cardano/Ledger/Babbage/TxBody.hs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ import Cardano.Ledger.MemoBytes (
9090
eqRaw,
9191
getMemoRawType,
9292
getMemoSafeHash,
93+
getterMemoRawType,
9394
lensMemoRawType,
9495
mkMemoizedEra,
9596
zipMemoRawType,
@@ -119,6 +120,8 @@ class (AlonzoEraTxBody era, BabbageEraTxOut era) => BabbageEraTxBody era where
119120

120121
sizedCollateralReturnTxBodyL :: Lens' (TxBody TopTx era) (StrictMaybe (Sized (TxOut era)))
121122

123+
sizedCollateralReturnTxBodyF :: SimpleGetter (TxBody l era) (StrictMaybe (Sized (TxOut era)))
124+
122125
allSizedOutputsTxBodyF :: SimpleGetter (TxBody l era) (StrictSeq (Sized (TxOut era)))
123126

124127
-- ======================================
@@ -228,7 +231,7 @@ allSizedOutputsBabbageTxBodyF ::
228231
allSizedOutputsBabbageTxBodyF =
229232
to $ \txBody ->
230233
let txOuts = txBody ^. sizedOutputsTxBodyL
231-
in case txBody ^. sizedCollateralReturnTxBodyL of
234+
in case txBody ^. sizedCollateralReturnTxBodyF of
232235
SNothing -> txOuts
233236
SJust collTxOut -> txOuts |> collTxOut
234237
{-# INLINEABLE allSizedOutputsBabbageTxBodyF #-}
@@ -356,6 +359,8 @@ instance BabbageEraTxBody BabbageEra where
356359
txBodyRaw {btbrCollateralReturn = collateralReturn}
357360
{-# INLINE sizedCollateralReturnTxBodyL #-}
358361

362+
sizedCollateralReturnTxBodyF = getterMemoRawType (\BabbageTxBodyRaw {btbrCollateralReturn} -> btbrCollateralReturn)
363+
359364
allSizedOutputsTxBodyF = allSizedOutputsBabbageTxBodyF
360365
{-# INLINE allSizedOutputsTxBodyF #-}
361366

libs/cardano-ledger-core/src/Cardano/Ledger/Core/TxLevel.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module Cardano.Ledger.Core.TxLevel (
2424
import Cardano.Ledger.Core.Era (Era (..))
2525
import Control.Monad.Trans.Class (lift)
2626
import Control.Monad.Trans.Fail.String
27-
import Data.Functor.Identity (runIdentity)
27+
import Data.Functor.Identity (Identity (..), runIdentity)
2828
import Data.Kind (Type)
2929
import Data.Typeable
3030
import GHC.Stack

0 commit comments

Comments
 (0)