Skip to content

Commit

Permalink
Simplify serialization of ApplyTxError
Browse files Browse the repository at this point in the history
  • Loading branch information
lehins committed Feb 14, 2025
1 parent ba5addb commit c46c716
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions eras/shelley/impl/src/Cardano/Ledger/Shelley/API/Mempool.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ import Cardano.Ledger.Binary (
EncCBOR (..),
FromCBOR (..),
ToCBOR (..),
encodeFoldableAsIndefLenList,
ifEncodingVersionAtLeast,
natVersion,
)
import Cardano.Ledger.Core
import Cardano.Ledger.Rules.ValidationMode (lblStatic)
Expand Down Expand Up @@ -201,26 +198,11 @@ deriving stock instance
Show (PredicateFailure (EraRule "LEDGER" era)) =>
Show (ApplyTxError era)

-- TODO: This instance can be switched back to a derived version, once we are officially
-- in the Conway era:
--
-- deriving newtype instance
-- ( Era era
-- , EncCBOR (PredicateFailure (EraRule "LEDGER" era))
-- ) =>
-- EncCBOR (ApplyTxError era)

instance
deriving newtype instance
( Era era
, EncCBOR (PredicateFailure (EraRule "LEDGER" era))
) =>
EncCBOR (ApplyTxError era)
where
encCBOR (ApplyTxError failures) =
ifEncodingVersionAtLeast
(natVersion @9)
(encCBOR failures)
(encodeFoldableAsIndefLenList encCBOR failures)

deriving newtype instance
( Era era
Expand Down

0 comments on commit c46c716

Please sign in to comment.