@@ -42,7 +42,7 @@ import Cardano.Ledger.Allegra.Scripts (ValidityInterval (..))
4242import Cardano.Ledger.Allegra.TxCert ()
4343import Cardano.Ledger.Allegra.TxOut ()
4444import Cardano.Ledger.BaseTypes (SlotNo , StrictMaybe (SJust , SNothing ))
45- import Cardano.Ledger.Binary (DecCBOR (.. ), EncCBOR (.. ), ToCBOR )
45+ import Cardano.Ledger.Binary (Annotator , DecCBOR (.. ), EncCBOR (.. ), ToCBOR )
4646import Cardano.Ledger.Binary.Coders (
4747 Decode (.. ),
4848 Encode (.. ),
@@ -59,6 +59,7 @@ import Cardano.Ledger.Coin (Coin (..))
5959import Cardano.Ledger.Core
6060import Cardano.Ledger.MemoBytes (
6161 EqRaw ,
62+ Mem ,
6263 MemoBytes ,
6364 MemoHashIndex ,
6465 Memoized (RawType ),
@@ -124,6 +125,12 @@ instance (DecCBOR ma, Monoid ma, AllegraEraTxBody era) => DecCBOR (AllegraTxBody
124125 [(0 , " atbrInputs" ), (1 , " atbrOutputs" ), (2 , " atbrFee" )]
125126 )
126127
128+ instance
129+ (DecCBOR m , Monoid m , AllegraEraTxBody era ) =>
130+ DecCBOR (Annotator (AllegraTxBodyRaw m era ))
131+ where
132+ decCBOR = pure <$> decCBOR
133+
127134-- Sparse encodings of AllegraTxBodyRaw, the key values are fixed by backward compatibility
128135-- concerns as we want the ShelleyTxBody to deserialise as AllegraTxBody.
129136-- txXparse and bodyFields should be Duals, visual inspection helps ensure this.
@@ -196,6 +203,11 @@ emptyAllegraTxBodyRaw =
196203instance Memoized (TxBody AllegraEra ) where
197204 type RawType (TxBody AllegraEra ) = AllegraTxBodyRaw () AllegraEra
198205
206+ deriving via
207+ Mem (AllegraTxBodyRaw () AllegraEra )
208+ instance
209+ DecCBOR (Annotator (TxBody AllegraEra ))
210+
199211deriving instance Eq (TxBody AllegraEra )
200212
201213deriving instance Show (TxBody AllegraEra )
0 commit comments