From 87f061a357b310d2104b88b1f393014eadbc6d19 Mon Sep 17 00:00:00 2001 From: teodanciu Date: Thu, 16 Oct 2025 22:04:42 +0100 Subject: [PATCH 1/5] Implement `Enc/DecCBOR` for `PoolParams` explicitly rather than via `Enc/DecCBORGroup` --- .../impl/src/Cardano/Ledger/Shelley/TxCert.hs | 18 ++-- libs/cardano-ledger-core/CHANGELOG.md | 2 + .../src/Cardano/Ledger/State/StakePool.hs | 98 +++++++++++-------- 3 files changed, 68 insertions(+), 50 deletions(-) diff --git a/eras/shelley/impl/src/Cardano/Ledger/Shelley/TxCert.hs b/eras/shelley/impl/src/Cardano/Ledger/Shelley/TxCert.hs index 7698e905533..e5fcfcc8bdc 100644 --- a/eras/shelley/impl/src/Cardano/Ledger/Shelley/TxCert.hs +++ b/eras/shelley/impl/src/Cardano/Ledger/Shelley/TxCert.hs @@ -77,10 +77,8 @@ module Cardano.Ledger.Shelley.TxCert ( import Cardano.Ledger.BaseTypes (invalidKey, kindObject) import Cardano.Ledger.Binary ( DecCBOR (decCBOR), - DecCBORGroup (..), Decoder, EncCBOR (..), - EncCBORGroup (..), Encoding, FromCBOR (..), ToCBOR (..), @@ -90,7 +88,6 @@ import Cardano.Ledger.Binary ( decodeWord, encodeListLen, encodeWord8, - listLenInt, peekTokenType, ) import Cardano.Ledger.Coin (Coin (..), DeltaCoin) @@ -105,7 +102,12 @@ import Cardano.Ledger.Internal.Era (AllegraEra, AlonzoEra, BabbageEra, MaryEra) import Cardano.Ledger.Keys (asWitness) import Cardano.Ledger.Shelley.Era (ShelleyEra) import Cardano.Ledger.Shelley.PParams () -import Cardano.Ledger.State (PoolParams (..)) +import Cardano.Ledger.State ( + PoolParams (..), + decCBORGroupPoolParams, + encCBORGroupPoolParams, + poolParamsCount, + ) import Cardano.Ledger.Val ((<+>), (<×>)) import Control.DeepSeq (NFData (..), rwhnf) import Data.Aeson (ToJSON (..), (.=)) @@ -434,9 +436,9 @@ encodeShelleyDelegCert = \case encodePoolCert :: PoolCert -> Encoding encodePoolCert = \case RegPool poolParams -> - encodeListLen (1 + listLen poolParams) + encodeListLen (1 + fromIntegral poolParamsCount) <> encodeWord8 3 - <> encCBORGroup poolParams + <> encCBORGroupPoolParams poolParams RetirePool vk epoch -> encodeListLen 3 <> encodeWord8 4 @@ -504,8 +506,8 @@ shelleyTxCertDelegDecoder = \case poolTxCertDecoder :: EraTxCert era => Word -> Decoder s (Int, TxCert era) poolTxCertDecoder = \case 3 -> do - group <- decCBORGroup - pure (1 + listLenInt group, RegPoolTxCert group) + group <- decCBORGroupPoolParams + pure (1 + fromIntegral poolParamsCount, RegPoolTxCert group) 4 -> do a <- decCBOR b <- decCBOR diff --git a/libs/cardano-ledger-core/CHANGELOG.md b/libs/cardano-ledger-core/CHANGELOG.md index bf38d8d1bc7..91526e7142a 100644 --- a/libs/cardano-ledger-core/CHANGELOG.md +++ b/libs/cardano-ledger-core/CHANGELOG.md @@ -2,6 +2,8 @@ ## 1.19.0.0 +* Add `poolParamsCount`, `decCBORGroupPoolParams`, `encCBORGroupPoolParams` to `StakePool` module +* Remove `DecCBORGroup` and `EncCBORGroup` instances for `PoolParams` * Remove the `UMap` module and the `umap` benchmarks cabal target. * Export `dRepToText` * Deprecated `bheader` and `bbody` diff --git a/libs/cardano-ledger-core/src/Cardano/Ledger/State/StakePool.hs b/libs/cardano-ledger-core/src/Cardano/Ledger/State/StakePool.hs index 6f16171946b..4133b256ae7 100644 --- a/libs/cardano-ledger-core/src/Cardano/Ledger/State/StakePool.hs +++ b/libs/cardano-ledger-core/src/Cardano/Ledger/State/StakePool.hs @@ -5,6 +5,7 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} @@ -26,6 +27,9 @@ module Cardano.Ledger.State.StakePool ( -- * Stake Pool State StakePoolState (..), + decCBORGroupPoolParams, + encCBORGroupPoolParams, + poolParamsCount, -- * Lenses spsVrfL, @@ -68,12 +72,11 @@ import Cardano.Ledger.BaseTypes ( strictMaybeToMaybe, ) import Cardano.Ledger.Binary ( - CBORGroup (..), DecCBOR (..), - DecCBORGroup (..), DecShareCBOR (..), + Decoder, EncCBOR (..), - EncCBORGroup (..), + Encoding, decodeNullMaybe, decodeRecordNamed, decodeRecordSum, @@ -381,8 +384,6 @@ data PoolParams = PoolParams , ppMetadata :: !(StrictMaybe PoolMetadata) } deriving (Show, Generic, Eq, Ord) - deriving (EncCBOR) via CBORGroup PoolParams - deriving (DecCBOR) via CBORGroup PoolParams ppVrfL :: Lens' PoolParams (VRFVerKeyHash 'StakePoolVRF) ppVrfL = lens ppVrf (\pp u -> pp {ppVrf = u}) @@ -452,40 +453,53 @@ data SizeOfPoolRelays = SizeOfPoolRelays instance EncCBOR SizeOfPoolRelays where encCBOR = error "The `SizeOfPoolRelays` type cannot be encoded!" -instance EncCBORGroup PoolParams where - encCBORGroup poolParams = - encCBOR (ppId poolParams) - <> encCBOR (ppVrf poolParams) - <> encCBOR (ppPledge poolParams) - <> encCBOR (ppCost poolParams) - <> encCBOR (ppMargin poolParams) - <> encCBOR (ppRewardAccount poolParams) - <> encCBOR (ppOwners poolParams) - <> encCBOR (ppRelays poolParams) - <> encodeNullMaybe encCBOR (strictMaybeToMaybe (ppMetadata poolParams)) - listLen _ = 9 - listLenBound _ = 9 - -instance DecCBORGroup PoolParams where - decCBORGroup = do - hk <- decCBOR - vrf <- decCBOR - pledge <- decCBOR - cost <- decCBOR - margin <- decCBOR - ra <- decCBOR - owners <- decCBOR - relays <- decCBOR - md <- decodeNullMaybe decCBOR - pure $ - PoolParams - { ppId = hk - , ppVrf = vrf - , ppPledge = pledge - , ppCost = cost - , ppMargin = margin - , ppRewardAccount = ra - , ppOwners = owners - , ppRelays = relays - , ppMetadata = maybeToStrictMaybe md - } +instance EncCBOR PoolParams where + encCBOR poolParams = + encodeListLen poolParamsCount + <> encCBORGroupPoolParams poolParams + +instance DecCBOR PoolParams where + decCBOR = + decodeRecordNamed + "CBORGroup" + (const (fromIntegral poolParamsCount)) + decCBORGroupPoolParams + +poolParamsCount :: Word +poolParamsCount = 9 + +encCBORGroupPoolParams :: PoolParams -> Encoding +encCBORGroupPoolParams PoolParams {..} = + encCBOR ppId + <> encCBOR ppVrf + <> encCBOR ppPledge + <> encCBOR ppCost + <> encCBOR ppMargin + <> encCBOR ppRewardAccount + <> encCBOR ppOwners + <> encCBOR ppRelays + <> encodeNullMaybe encCBOR (strictMaybeToMaybe ppMetadata) + +decCBORGroupPoolParams :: Decoder s PoolParams +decCBORGroupPoolParams = do + hk <- decCBOR + vrf <- decCBOR + pledge <- decCBOR + cost <- decCBOR + margin <- decCBOR + ra <- decCBOR + owners <- decCBOR + relays <- decCBOR + md <- decodeNullMaybe decCBOR + pure $ + PoolParams + { ppId = hk + , ppVrf = vrf + , ppPledge = pledge + , ppCost = cost + , ppMargin = margin + , ppRewardAccount = ra + , ppOwners = owners + , ppRelays = relays + , ppMetadata = maybeToStrictMaybe md + } From 1d87e5aebf7023a282f24230a335948f2780eec8 Mon Sep 17 00:00:00 2001 From: teodanciu Date: Tue, 14 Oct 2025 15:53:56 +0100 Subject: [PATCH 2/5] Move `Vote` to core `BaseTypes` --- .../Ledger/Conway/Governance/Procedures.hs | 21 +---------------- .../Test/Cardano/Ledger/Conway/Arbitrary.hs | 4 ---- .../Test/Cardano/Ledger/Conway/TreeDiff.hs | 2 -- libs/cardano-ledger-core/CHANGELOG.md | 2 ++ .../src/Cardano/Ledger/BaseTypes.hs | 23 +++++++++++++++++++ .../Test/Cardano/Ledger/Core/Arbitrary.hs | 4 ++++ .../testlib/Test/Cardano/Ledger/TreeDiff.hs | 2 ++ 7 files changed, 32 insertions(+), 26 deletions(-) diff --git a/eras/conway/impl/src/Cardano/Ledger/Conway/Governance/Procedures.hs b/eras/conway/impl/src/Cardano/Ledger/Conway/Governance/Procedures.hs index ed4df370511..2d3802d5159 100644 --- a/eras/conway/impl/src/Cardano/Ledger/Conway/Governance/Procedures.hs +++ b/eras/conway/impl/src/Cardano/Ledger/Conway/Governance/Procedures.hs @@ -90,6 +90,7 @@ import Cardano.Ledger.BaseTypes ( ProtVer, ToKeyValuePairs (..), UnitInterval, + Vote (..), maybeToStrictMaybe, ) import Cardano.Ledger.Binary ( @@ -100,12 +101,10 @@ import Cardano.Ledger.Binary ( Interns, ToCBOR (toCBOR), decNoShareCBOR, - decodeEnumBounded, decodeMapByKey, decodeNullStrictMaybe, decodeRecordNamed, decodeRecordNamedT, - encodeEnum, encodeListLen, encodeNullStrictMaybe, encodeWord8, @@ -373,24 +372,6 @@ instance NoThunks Voter instance NFData Voter -data Vote - = VoteNo - | VoteYes - | Abstain - deriving (Ord, Generic, Eq, Show, Enum, Bounded) - -instance ToJSON Vote - -instance NoThunks Vote - -instance NFData Vote - -instance DecCBOR Vote where - decCBOR = decodeEnumBounded - -instance EncCBOR Vote where - encCBOR = encodeEnum - newtype VotingProcedures era = VotingProcedures { unVotingProcedures :: Map Voter (Map GovActionId (VotingProcedure era)) } diff --git a/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Arbitrary.hs b/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Arbitrary.hs index 7d00af7e334..a5672667574 100644 --- a/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Arbitrary.hs +++ b/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Arbitrary.hs @@ -562,10 +562,6 @@ instance Arbitrary Voter where ] shrink = genericShrink -instance Arbitrary Vote where - arbitrary = arbitraryBoundedEnum - shrink = shrinkBoundedEnum - instance Arbitrary (TxBody ConwayEra) where arbitrary = ConwayTxBody diff --git a/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/TreeDiff.hs b/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/TreeDiff.hs index 6149ea72c9f..409d7c3997d 100644 --- a/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/TreeDiff.hs +++ b/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/TreeDiff.hs @@ -71,8 +71,6 @@ instance ToExpr (PParamsHKD StrictMaybe era) => ToExpr (GovActionState era) instance ToExpr Voter -instance ToExpr Vote - instance Era era => ToExpr (VotingProcedures era) instance ToExpr (VotingProcedure era) diff --git a/libs/cardano-ledger-core/CHANGELOG.md b/libs/cardano-ledger-core/CHANGELOG.md index 91526e7142a..920c5958664 100644 --- a/libs/cardano-ledger-core/CHANGELOG.md +++ b/libs/cardano-ledger-core/CHANGELOG.md @@ -2,6 +2,8 @@ ## 1.19.0.0 +* Add `FromJSON` instance to `Vote` +* Move `Vote` to `BaseTypes` module * Add `poolParamsCount`, `decCBORGroupPoolParams`, `encCBORGroupPoolParams` to `StakePool` module * Remove `DecCBORGroup` and `EncCBORGroup` instances for `PoolParams` * Remove the `UMap` module and the `umap` benchmarks cabal target. diff --git a/libs/cardano-ledger-core/src/Cardano/Ledger/BaseTypes.hs b/libs/cardano-ledger-core/src/Cardano/Ledger/BaseTypes.hs index d3bd00c38f1..f34e733fa4a 100644 --- a/libs/cardano-ledger-core/src/Cardano/Ledger/BaseTypes.hs +++ b/libs/cardano-ledger-core/src/Cardano/Ledger/BaseTypes.hs @@ -57,6 +57,7 @@ module Cardano.Ledger.BaseTypes ( module Data.Maybe.Strict, BlocksMade (..), kindObject, + Vote (..), -- * Indices TxIx (..), @@ -106,6 +107,8 @@ import Cardano.Ledger.Binary ( FromCBOR, ToCBOR, cborError, + decodeEnumBounded, + encodeEnum, ifDecoderVersionAtLeast, ) import Cardano.Ledger.Binary.Coders ( @@ -970,3 +973,23 @@ newtype KeyValuePairs a = KeyValuePairs {unKeyValuePairs :: a} instance ToKeyValuePairs a => ToJSON (KeyValuePairs a) where toJSON = object . toKeyValuePairs . unKeyValuePairs toEncoding = pairs . mconcat . toKeyValuePairs . unKeyValuePairs + +data Vote + = VoteNo + | VoteYes + | Abstain + deriving (Ord, Generic, Eq, Show, Enum, Bounded) + +instance ToJSON Vote + +instance FromJSON Vote + +instance NoThunks Vote + +instance NFData Vote + +instance DecCBOR Vote where + decCBOR = decodeEnumBounded + +instance EncCBOR Vote where + encCBOR = encodeEnum diff --git a/libs/cardano-ledger-core/testlib/Test/Cardano/Ledger/Core/Arbitrary.hs b/libs/cardano-ledger-core/testlib/Test/Cardano/Ledger/Core/Arbitrary.hs index 39326b56ef9..7ca41cab5b5 100644 --- a/libs/cardano-ledger-core/testlib/Test/Cardano/Ledger/Core/Arbitrary.hs +++ b/libs/cardano-ledger-core/testlib/Test/Cardano/Ledger/Core/Arbitrary.hs @@ -517,6 +517,10 @@ deriving instance (Era era, Arbitrary (PParamsHKD Identity era)) => Arbitrary (P deriving instance (Era era, Arbitrary (PParamsHKD StrictMaybe era)) => Arbitrary (PParamsUpdate era) +instance Arbitrary BaseTypes.Vote where + arbitrary = arbitraryBoundedEnum + shrink = shrinkBoundedEnum + ------------------------------------------------------------------------------------------ -- Cardano.Ledger.DRep ------------------------------------------------------------------- ------------------------------------------------------------------------------------------ diff --git a/libs/cardano-ledger-core/testlib/Test/Cardano/Ledger/TreeDiff.hs b/libs/cardano-ledger-core/testlib/Test/Cardano/Ledger/TreeDiff.hs index b7bf4cda2b9..a0babd2eac3 100644 --- a/libs/cardano-ledger-core/testlib/Test/Cardano/Ledger/TreeDiff.hs +++ b/libs/cardano-ledger-core/testlib/Test/Cardano/Ledger/TreeDiff.hs @@ -179,6 +179,8 @@ instance ToExpr TxId instance ToExpr ChainAccountState +instance ToExpr Vote + -- CertState instance ToExpr DRep From 137d5b40e7abfd94915e74c182c99c36acb2dda1 Mon Sep 17 00:00:00 2001 From: teodanciu Date: Tue, 14 Oct 2025 16:07:01 +0100 Subject: [PATCH 3/5] Add optional default vote to `PoolParams` --- .../testlib/Test/Cardano/Ledger/Shelley/Examples.hs | 1 + .../testlib/Test/Cardano/Ledger/Shelley/ImpTest.hs | 2 ++ .../bench/Cardano/Ledger/Shelley/Bench/Rewards.hs | 1 + .../Test/Cardano/Ledger/Shelley/BenchmarkFunctions.hs | 1 + .../src/Test/Cardano/Ledger/Shelley/Examples/Cast.hs | 2 ++ .../Test/Cardano/Ledger/Shelley/Generator/TxCert.hs | 1 + .../src/Test/Cardano/Ledger/Shelley/Rewards.hs | 1 + .../test/Test/Cardano/Ledger/Shelley/Fees.hs | 1 + .../Ledger/Shelley/Serialisation/Golden/Encoding.hs | 1 + .../Ledger/Shelley/Serialisation/Golden/Genesis.hs | 1 + .../test/Test/Cardano/Ledger/Shelley/UnitTests.hs | 1 + libs/cardano-ledger-core/CHANGELOG.md | 1 + .../src/Cardano/Ledger/State/StakePool.hs | 11 +++++++++-- .../testlib/Test/Cardano/Ledger/Core/Arbitrary.hs | 1 + .../Test/Cardano/Ledger/Constrained/Conway/Pool.hs | 2 +- .../src/Test/Cardano/Ledger/Examples/AlonzoBBODY.hs | 1 + .../src/Test/Cardano/Ledger/Generic/GenState.hs | 1 + 17 files changed, 27 insertions(+), 3 deletions(-) diff --git a/eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/Examples.hs b/eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/Examples.hs index d9aa313ddcd..c54c51e30bb 100644 --- a/eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/Examples.hs +++ b/eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/Examples.hs @@ -404,6 +404,7 @@ examplePoolParams = { pmUrl = fromJust $ textToUrl 64 "consensus.pool" , pmHash = "{}" } + , ppDefaultVote = SNothing } examplePayKey :: KeyPair 'Payment diff --git a/eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/ImpTest.hs b/eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/ImpTest.hs index f4492431511..8a6fa9ae396 100644 --- a/eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/ImpTest.hs +++ b/eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/ImpTest.hs @@ -1679,6 +1679,7 @@ freshPoolParams khPool rewardAccount = do let minCost = pp ^. ppMinPoolCostL poolCostExtra <- uniformRM (Coin 0, Coin 100_000_000) pledge <- uniformRM (Coin 0, Coin 100_000_000) + defaultVote <- arbitrary pure PoolParams { ppVrf = vrfHash @@ -1690,6 +1691,7 @@ freshPoolParams khPool rewardAccount = do , ppMargin = def , ppId = khPool , ppCost = minCost <> poolCostExtra + , ppDefaultVote = defaultVote } registerPool :: diff --git a/eras/shelley/test-suite/bench/Cardano/Ledger/Shelley/Bench/Rewards.hs b/eras/shelley/test-suite/bench/Cardano/Ledger/Shelley/Bench/Rewards.hs index 30faaf27e7f..11223be05fc 100644 --- a/eras/shelley/test-suite/bench/Cardano/Ledger/Shelley/Bench/Rewards.hs +++ b/eras/shelley/test-suite/bench/Cardano/Ledger/Shelley/Bench/Rewards.hs @@ -149,6 +149,7 @@ genChainInEpoch epoch = do , ppOwners = Set.singleton owner , ppRelays = StrictSeq.empty , ppMetadata = SNothing + , ppDefaultVote = SNothing } ] , sgsStake = diff --git a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/BenchmarkFunctions.hs b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/BenchmarkFunctions.hs index 01c82b876ff..ed8b8c1a6db 100644 --- a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/BenchmarkFunctions.hs +++ b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/BenchmarkFunctions.hs @@ -362,6 +362,7 @@ mkPoolParameters keys = , ppOwners = Set.singleton $ hashKey (vKey stakeKeyOne) , ppRelays = StrictSeq.empty , ppMetadata = SNothing + , ppDefaultVote = SNothing } -- Create stake pool registration certs diff --git a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Examples/Cast.hs b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Examples/Cast.hs index 5465feea4a9..2eeae574ed2 100644 --- a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Examples/Cast.hs +++ b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Examples/Cast.hs @@ -137,6 +137,7 @@ alicePoolParams = { pmUrl = fromJust $ textToUrl 64 "alice.pool" , pmHash = BS.pack "{}" } + , ppDefaultVote = SNothing } -- | Alice's VRF key hash @@ -187,6 +188,7 @@ bobPoolParams = , ppOwners = Set.singleton $ hashKey (vKey bobStake) , ppRelays = StrictSeq.empty , ppMetadata = SNothing + , ppDefaultVote = SNothing } -- | Bob's VRF key hash diff --git a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/TxCert.hs b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/TxCert.hs index b83070b6d68..97749a3317f 100644 --- a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/TxCert.hs +++ b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/TxCert.hs @@ -389,6 +389,7 @@ genStakePool poolKeys skeys (Coin minPoolCost) = Set.empty StrictSeq.empty SNothing + SNothing in (pps, aikCold allPoolKeys) -- | Generate `RegPool` and the key witness. diff --git a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Rewards.hs b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Rewards.hs index c9fbdb44994..18f0be6eb3b 100644 --- a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Rewards.hs +++ b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Rewards.hs @@ -276,6 +276,7 @@ genPoolInfo PoolSetUpArgs {poolPledge, poolCost, poolMargin, poolMembers} = do , ppOwners = Set.fromList [hashKey $ vKey ownerKey] , ppRelays = StrictSeq.empty , ppMetadata = SNothing + , ppDefaultVote = SNothing } pure $ PoolInfo {params, coldKey, ownerKey, ownerStake, rewardKey, members} diff --git a/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Fees.hs b/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Fees.hs index b09f5f745a9..e3870b885f9 100644 --- a/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Fees.hs +++ b/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Fees.hs @@ -126,6 +126,7 @@ alicePoolParams = { pmUrl = fromJust $ textToUrl 64 "alice.pool" , pmHash = BS.pack "{}" } + , ppDefaultVote = SNothing } aliceAddr :: Addr diff --git a/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Serialisation/Golden/Encoding.hs b/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Serialisation/Golden/Encoding.hs index 51fcd985bb6..2fc69992bcb 100644 --- a/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Serialisation/Golden/Encoding.hs +++ b/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Serialisation/Golden/Encoding.hs @@ -536,6 +536,7 @@ tests = { pmUrl = Maybe.fromJust $ textToUrl 64 poolUrl , pmHash = poolMDHash } + , ppDefaultVote = SNothing } ) ) diff --git a/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Serialisation/Golden/Genesis.hs b/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Serialisation/Golden/Genesis.hs index 77009319595..332ecb8cfc2 100644 --- a/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Serialisation/Golden/Genesis.hs +++ b/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Serialisation/Golden/Genesis.hs @@ -265,6 +265,7 @@ exampleShelleyGenesis = { L.pmUrl = fromJust $ textToUrl 64 "best.pool.com" , L.pmHash = BS.pack "100ab{}100ab{}" } + , L.ppDefaultVote = L.SNothing } staking = ShelleyGenesisStaking diff --git a/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/UnitTests.hs b/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/UnitTests.hs index efeae172ddf..c4e7fec870d 100644 --- a/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/UnitTests.hs +++ b/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/UnitTests.hs @@ -602,6 +602,7 @@ alicePoolParamsSmallCost = { pmUrl = fromJust $ textToUrl 64 "alice.pool" , pmHash = BS.pack "{}" } + , ppDefaultVote = SNothing } where vkVrf = vrfVerKey $ mkVRFKeyPair @MockCrypto (RawSeed 0 0 0 0 2) diff --git a/libs/cardano-ledger-core/CHANGELOG.md b/libs/cardano-ledger-core/CHANGELOG.md index 920c5958664..0ae0a6c53de 100644 --- a/libs/cardano-ledger-core/CHANGELOG.md +++ b/libs/cardano-ledger-core/CHANGELOG.md @@ -2,6 +2,7 @@ ## 1.19.0.0 +* Add `ppDefaultVote` to `PoolParams` * Add `FromJSON` instance to `Vote` * Move `Vote` to `BaseTypes` module * Add `poolParamsCount`, `decCBORGroupPoolParams`, `encCBORGroupPoolParams` to `StakePool` module diff --git a/libs/cardano-ledger-core/src/Cardano/Ledger/State/StakePool.hs b/libs/cardano-ledger-core/src/Cardano/Ledger/State/StakePool.hs index 4133b256ae7..04fbed1e25d 100644 --- a/libs/cardano-ledger-core/src/Cardano/Ledger/State/StakePool.hs +++ b/libs/cardano-ledger-core/src/Cardano/Ledger/State/StakePool.hs @@ -67,6 +67,7 @@ import Cardano.Ledger.BaseTypes ( StrictMaybe (..), UnitInterval, Url, + Vote, invalidKey, maybeToStrictMaybe, strictMaybeToMaybe, @@ -242,6 +243,8 @@ stakePoolStateToPoolParams poolId sps = , ppOwners = spsOwners sps , ppRelays = spsRelays sps , ppMetadata = spsMetadata sps + , -- TODO: spsDefaultVote + ppDefaultVote = SNothing } data PoolMetadata = PoolMetadata @@ -382,6 +385,7 @@ data PoolParams = PoolParams , ppOwners :: !(Set (KeyHash 'Staking)) , ppRelays :: !(StrictSeq StakePoolRelay) , ppMetadata :: !(StrictMaybe PoolMetadata) + , ppDefaultVote :: !(StrictMaybe Vote) } deriving (Show, Generic, Eq, Ord) @@ -395,7 +399,7 @@ ppMetadataL :: Lens' PoolParams (StrictMaybe PoolMetadata) ppMetadataL = lens ppMetadata (\pp u -> pp {ppMetadata = u}) instance Default PoolParams where - def = PoolParams def def (Coin 0) (Coin 0) def def def def def + def = PoolParams def def (Coin 0) (Coin 0) def def def def def def instance NoThunks PoolParams @@ -403,7 +407,7 @@ deriving instance NFData PoolParams instance ToJSON PoolParams where toJSON pp = - Aeson.object + Aeson.object $ [ "publicKey" .= ppId pp -- TODO publicKey is an unfortunate name, should be poolId , "vrf" .= ppVrf pp , "pledge" .= ppPledge pp @@ -414,6 +418,7 @@ instance ToJSON PoolParams where , "relays" .= ppRelays pp , "metadata" .= ppMetadata pp ] + ++ ["defaultVote" .= v | SJust v <- [ppDefaultVote pp]] instance FromJSON PoolParams where parseJSON = @@ -428,6 +433,7 @@ instance FromJSON PoolParams where <*> obj .: "owners" <*> obj .: "relays" <*> obj .: "metadata" + <*> obj .:? "defaultVote" .!= SNothing instance EncCBOR PoolMetadata where encCBOR (PoolMetadata u h) = @@ -502,4 +508,5 @@ decCBORGroupPoolParams = do , ppOwners = owners , ppRelays = relays , ppMetadata = maybeToStrictMaybe md + , ppDefaultVote = SNothing } diff --git a/libs/cardano-ledger-core/testlib/Test/Cardano/Ledger/Core/Arbitrary.hs b/libs/cardano-ledger-core/testlib/Test/Cardano/Ledger/Core/Arbitrary.hs index 7ca41cab5b5..beedd3fc03b 100644 --- a/libs/cardano-ledger-core/testlib/Test/Cardano/Ledger/Core/Arbitrary.hs +++ b/libs/cardano-ledger-core/testlib/Test/Cardano/Ledger/Core/Arbitrary.hs @@ -449,6 +449,7 @@ instance Arbitrary PoolParams where <*> arbitrary <*> arbitrary <*> arbitrary + <*> arbitrary instance Arbitrary StakePoolState where arbitrary = diff --git a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Constrained/Conway/Pool.hs b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Constrained/Conway/Pool.hs index 923b03f83cf..0ce730ed6ab 100644 --- a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Constrained/Conway/Pool.hs +++ b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Constrained/Conway/Pool.hs @@ -70,7 +70,7 @@ poolCertSpec univ (PoolEnv e pp) ps = (caseOn pc) -- RegPool !(PoolParams c) ( branchW 1 $ \poolParams -> - match poolParams $ \_ _ _ cost _ rewAccnt _ _ mMetadata -> + match poolParams $ \_ _ _ cost _ rewAccnt _ _ mMetadata _ -> [ witness univ poolParams , match rewAccnt $ \net' _ -> net' ==. lit Testnet diff --git a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Examples/AlonzoBBODY.hs b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Examples/AlonzoBBODY.hs index 605045500c2..c74e7a0efa0 100644 --- a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Examples/AlonzoBBODY.hs +++ b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Examples/AlonzoBBODY.hs @@ -509,6 +509,7 @@ poolMDHTooBigTx = , ppOwners = mempty , ppRelays = mempty , ppMetadata = SJust $ PoolMetadata (fromJust $ textToUrl 64 "") tooManyBytes + , ppDefaultVote = SNothing } -- ============================== Expected UTXO =============================== diff --git a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/GenState.hs b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/GenState.hs index a4a0d8f86d6..aac6d12b4be 100644 --- a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/GenState.hs +++ b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/GenState.hs @@ -956,6 +956,7 @@ genPoolParams ppId = do let ppOwners = mempty let ppRelays = mempty let ppMetadata = SNothing + let ppDefaultVote = SNothing pure PoolParams {..} -- | Generate a 'n' fresh credentials (ones not in the set 'old'). We get 'tries' chances, From c6536884f5c6ab855189599ea340e7995def2e0f Mon Sep 17 00:00:00 2001 From: teodanciu Date: Fri, 17 Oct 2025 14:54:29 +0100 Subject: [PATCH 4/5] Generate arbitrary `PoolParams` with no default vote before Dijkstra and in Snapshots --- .../Test/Cardano/Ledger/Conway/Arbitrary.hs | 14 +++++++-- .../Conway/Translation/TranslatableGen.hs | 4 +-- .../Test/Cardano/Ledger/Shelley/Arbitrary.hs | 30 +++++++++++++++---- .../Shelley/UnitTests/InstantStakeTest.hs | 4 +-- .../cardano-ledger-api.cabal | 1 + .../Test/Cardano/Ledger/Api/Arbitrary.hs | 10 ++++++- .../Test/Cardano/Ledger/Core/Arbitrary.hs | 29 ++++++++++++++++-- 7 files changed, 78 insertions(+), 14 deletions(-) diff --git a/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Arbitrary.hs b/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Arbitrary.hs index a5672667574..b009140e562 100644 --- a/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Arbitrary.hs +++ b/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Arbitrary.hs @@ -23,6 +23,7 @@ module Test.Cardano.Ledger.Conway.Arbitrary ( genParameterChange, genNewConstitution, govActionGenerators, + genConwayTxCertPool, genConwayPlutusPurposePointer, genGovAction, genGovActionState, @@ -76,7 +77,8 @@ import Test.Cardano.Ledger.Alonzo.Arbitrary (genValidAndUnknownCostModels, genVa import Test.Cardano.Ledger.Babbage.Arbitrary () import Test.Cardano.Ledger.Binary.Random (QC (..)) import Test.Cardano.Ledger.Common -import Test.Cardano.Ledger.Core.Arbitrary (uniformSubMap) +import Test.Cardano.Ledger.Core.Arbitrary (genPoolParamsNoDefaultVote, uniformSubMap) +import Test.Cardano.Ledger.Shelley.Arbitrary () instance (Era era, Arbitrary (PParamsUpdate era)) => @@ -163,10 +165,18 @@ instance Era era => Arbitrary (ConwayTxCert era) where arbitrary = oneof [ ConwayTxCertDeleg <$> arbitrary - , ConwayTxCertPool <$> arbitrary + , genConwayTxCertPool , ConwayTxCertGov <$> arbitrary ] +genConwayTxCertPool :: Gen (ConwayTxCert era) +genConwayTxCertPool = + ConwayTxCertPool + <$> oneof + [ RegPool <$> genPoolParamsNoDefaultVote + , RetirePool <$> arbitrary <*> arbitrary + ] + instance Arbitrary ConwayGovCert where arbitrary = oneof diff --git a/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Translation/TranslatableGen.hs b/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Translation/TranslatableGen.hs index 6dae9433a0b..a989e76ae15 100644 --- a/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Translation/TranslatableGen.hs +++ b/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Translation/TranslatableGen.hs @@ -30,7 +30,7 @@ import qualified Test.Cardano.Ledger.Babbage.Translation.TranslatableGen as Babb utxoWithTx, ) import Test.Cardano.Ledger.Common -import Test.Cardano.Ledger.Conway.Arbitrary () +import Test.Cardano.Ledger.Conway.Arbitrary (genConwayTxCertPool) instance TranslatableGen ConwayEra where tgRedeemers = genRedeemers @@ -65,7 +65,7 @@ genTxBody l@(SupportedLanguage slang) = do genOSet $ frequency [ (33, ConwayTxCertDeleg <$> genDelegCert) - , (33, ConwayTxCertPool <$> arbitrary) + , (33, genConwayTxCertPool) , (offPrePlutusV3 33, ConwayTxCertGov <$> arbitrary) ] genForPlutusV3 :: Arbitrary a => a -> Gen a diff --git a/eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/Arbitrary.hs b/eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/Arbitrary.hs index 41256a8d9da..7296bb030e7 100644 --- a/eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/Arbitrary.hs +++ b/eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/Arbitrary.hs @@ -77,7 +77,7 @@ import Cardano.Ledger.Shelley.Tx (Tx (..)) import Cardano.Ledger.Shelley.TxAuxData import Cardano.Ledger.Shelley.TxCert ( GenesisDelegCert (..), - ShelleyTxCert, + ShelleyTxCert (..), ) import Cardano.Ledger.Shelley.TxOut import Cardano.Ledger.Shelley.TxWits (ShelleyTxWits (ShelleyTxWits)) @@ -93,7 +93,7 @@ import Data.Word (Word64) import Generic.Random (genericArbitraryU) import Test.Cardano.Chain.UTxO.Gen (genCompactTxOut) import Test.Cardano.Ledger.Common -import Test.Cardano.Ledger.Core.Arbitrary () +import Test.Cardano.Ledger.Core.Arbitrary (genPoolParamsNoDefaultVote) import Test.Cardano.Ledger.Core.Utils (unsafeBoundRational) import Test.QuickCheck.Hedgehog (hedgehog) @@ -248,7 +248,7 @@ instance Arbitrary PoolRewardInfo where PoolRewardInfo <$> arbitrary <*> arbitrary - <*> arbitrary + <*> genPoolParamsNoDefaultVote <*> arbitrary <*> arbitrary shrink = genericShrink @@ -439,8 +439,18 @@ vectorOfMetadatumSimple = do ------------------------------------------------------------------------------------------ instance Era era => Arbitrary (ShelleyTxCert era) where - arbitrary = genericArbitraryU shrink = genericShrink + arbitrary = + oneof + [ ShelleyTxCertDelegCert <$> arbitrary + , ShelleyTxCertPool + <$> oneof + [ RegPool <$> genPoolParamsNoDefaultVote + , RetirePool <$> arbitrary <*> arbitrary + ] + , ShelleyTxCertGenesisDeleg <$> arbitrary + , ShelleyTxCertMir <$> arbitrary + ] instance Arbitrary ShelleyDelegCert where arbitrary = genericArbitraryU @@ -608,7 +618,17 @@ instance pure ShelleyGenesis {..} instance Arbitrary ShelleyGenesisStaking where - arbitrary = ShelleyGenesisStaking <$> arbitrary <*> arbitrary + arbitrary = ShelleyGenesisStaking <$> genPoolParamsListMap <*> arbitrary + +genPoolParamsListMap :: Gen (LM.ListMap (KeyHash 'StakePool) PoolParams) +genPoolParamsListMap = + LM.fromList <$> listOf pair + where + pair :: Gen (KeyHash 'StakePool, PoolParams) + pair = do + k <- arbitrary + v <- genPoolParamsNoDefaultVote + pure (k, v) instance ( Era era diff --git a/eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/UnitTests/InstantStakeTest.hs b/eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/UnitTests/InstantStakeTest.hs index 027e3eac9f2..850e4303c21 100644 --- a/eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/UnitTests/InstantStakeTest.hs +++ b/eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/UnitTests/InstantStakeTest.hs @@ -20,7 +20,7 @@ import Data.MonoTuple (TupleN) import qualified Data.VMap as VMap import Lens.Micro import Test.Cardano.Ledger.Common -import Test.Cardano.Ledger.Core.Arbitrary () +import Test.Cardano.Ledger.Core.Arbitrary (genPoolParamsNoDefaultVote) import Test.Cardano.Ledger.Core.KeyPair (mkAddr) import Test.Cardano.Ledger.Shelley.Era import Test.Cardano.Ledger.Shelley.ImpTest @@ -36,7 +36,7 @@ arbitraryLens l b = (l .~ b) <$> arbitrary instantStakeIncludesRewards :: forall era. ShelleyEraImp era => Gen Property instantStakeIncludesRewards = do - (pool1, pool2) <- arbitrary @(TupleN 2 PoolParams) + (pool1, pool2) <- (,) <$> genPoolParamsNoDefaultVote <*> genPoolParamsNoDefaultVote let poolId1 = pool1 ^. ppIdL poolId2 = pool2 ^. ppIdL diff --git a/libs/cardano-ledger-api/cardano-ledger-api.cabal b/libs/cardano-ledger-api/cardano-ledger-api.cabal index 949d1a7fe8a..ffa3884da2c 100644 --- a/libs/cardano-ledger-api/cardano-ledger-api.cabal +++ b/libs/cardano-ledger-api/cardano-ledger-api.cabal @@ -100,6 +100,7 @@ library testlib cardano-ledger-binary:{cardano-ledger-binary, testlib}, cardano-ledger-core:{cardano-ledger-core, testlib}, cardano-ledger-dijkstra:testlib, + containers, data-default, prettyprinter, diff --git a/libs/cardano-ledger-api/testlib/Test/Cardano/Ledger/Api/Arbitrary.hs b/libs/cardano-ledger-api/testlib/Test/Cardano/Ledger/Api/Arbitrary.hs index dcfcf35ecd0..73e0bbbf1c1 100644 --- a/libs/cardano-ledger-api/testlib/Test/Cardano/Ledger/Api/Arbitrary.hs +++ b/libs/cardano-ledger-api/testlib/Test/Cardano/Ledger/Api/Arbitrary.hs @@ -3,11 +3,19 @@ module Test.Cardano.Ledger.Api.Arbitrary () where import Cardano.Ledger.Api.State.Query (MemberStatus, QueryPoolStateResult (..)) +import qualified Data.Map as Map import Test.Cardano.Ledger.Common +import Test.Cardano.Ledger.Core.Arbitrary (genPoolParamsNoDefaultVote) import Test.Cardano.Ledger.Dijkstra.Arbitrary () instance Arbitrary MemberStatus where arbitrary = arbitraryBoundedEnum instance Arbitrary QueryPoolStateResult where - arbitrary = QueryPoolStateResult <$> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary + arbitrary = QueryPoolStateResult <$> genPoolParams <*> genPoolParams <*> arbitrary <*> arbitrary + where + genPoolParams = Map.fromList <$> listOf pair + pair = do + k <- arbitrary + v <- genPoolParamsNoDefaultVote + pure (k, v) diff --git a/libs/cardano-ledger-core/testlib/Test/Cardano/Ledger/Core/Arbitrary.hs b/libs/cardano-ledger-core/testlib/Test/Cardano/Ledger/Core/Arbitrary.hs index beedd3fc03b..42e2b8964bb 100644 --- a/libs/cardano-ledger-core/testlib/Test/Cardano/Ledger/Core/Arbitrary.hs +++ b/libs/cardano-ledger-core/testlib/Test/Cardano/Ledger/Core/Arbitrary.hs @@ -20,6 +20,7 @@ module Test.Cardano.Ledger.Core.Arbitrary ( genAddrBadPtr, genCompactAddrBadPtr, genBadPtr, + genPoolParamsNoDefaultVote, genericShrinkMemo, -- * Plutus @@ -451,6 +452,20 @@ instance Arbitrary PoolParams where <*> arbitrary <*> arbitrary +genPoolParamsNoDefaultVote :: Gen PoolParams +genPoolParamsNoDefaultVote = + PoolParams + <$> arbitrary + <*> arbitrary + <*> arbitrary + <*> arbitrary + <*> arbitrary + <*> arbitrary + <*> arbitrary + <*> arbitrary + <*> arbitrary + <*> pure BaseTypes.SNothing + instance Arbitrary StakePoolState where arbitrary = StakePoolState @@ -667,7 +682,17 @@ instance Arbitrary SnapShot where SnapShot <$> arbitrary <*> arbitrary - <*> arbitrary + <*> genPoolParamsVMap + +genPoolParamsVMap :: Gen (VMap.VMap VMap.VB VMap.VB (KeyHash 'StakePool) PoolParams) +genPoolParamsVMap = + VMap.fromMap . Map.fromList <$> listOf pair + where + pair :: Gen (KeyHash 'StakePool, PoolParams) + pair = do + k <- arbitrary + v <- genPoolParamsNoDefaultVote + pure (k, v) instance Arbitrary SnapShots where arbitrary = do @@ -684,7 +709,7 @@ instance Arbitrary SnapShots where -- There will never be a real Stake in the system with that many Ada, because total Ada is constant. -- So using a restricted Arbitrary Generator is OK. instance Arbitrary Stake where - arbitrary = Stake <$> (VMap.fromMap <$> theMap) + arbitrary = Stake . VMap.fromMap <$> theMap where genWord64 :: Int -> Gen Word64 genWord64 n = From c82131d8f460bbdea85e362dddb71dc55e53c54e Mon Sep 17 00:00:00 2001 From: teodanciu Date: Fri, 17 Oct 2025 19:27:06 +0100 Subject: [PATCH 5/5] Run CBOR roundtrip tests in Dijkstra --- eras/dijkstra/impl/cardano-ledger-dijkstra.cabal | 2 +- eras/dijkstra/impl/test/Main.hs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/eras/dijkstra/impl/cardano-ledger-dijkstra.cabal b/eras/dijkstra/impl/cardano-ledger-dijkstra.cabal index 367807f5715..54ddca8078a 100644 --- a/eras/dijkstra/impl/cardano-ledger-dijkstra.cabal +++ b/eras/dijkstra/impl/cardano-ledger-dijkstra.cabal @@ -201,7 +201,7 @@ test-suite tests cardano-ledger-alonzo, cardano-ledger-babbage:testlib, cardano-ledger-binary:testlib, - cardano-ledger-conway, + cardano-ledger-conway:{cardano-ledger-conway, testlib}, cardano-ledger-core:{cardano-ledger-core, testlib}, cardano-ledger-dijkstra:{cardano-ledger-dijkstra, testlib}, cardano-ledger-shelley:testlib, diff --git a/eras/dijkstra/impl/test/Main.hs b/eras/dijkstra/impl/test/Main.hs index 712c4b59deb..d613918d258 100644 --- a/eras/dijkstra/impl/test/Main.hs +++ b/eras/dijkstra/impl/test/Main.hs @@ -8,6 +8,7 @@ import Cardano.Ledger.Plutus (SLanguage (..)) import Test.Cardano.Ledger.Babbage.TxInfoSpec (txInfoSpec) import qualified Test.Cardano.Ledger.Babbage.TxInfoSpec as BabbageTxInfo import Test.Cardano.Ledger.Common +import qualified Test.Cardano.Ledger.Conway.BinarySpec as Binary import Test.Cardano.Ledger.Dijkstra.Binary.Annotator () import qualified Test.Cardano.Ledger.Dijkstra.Binary.CddlSpec as Cddl import Test.Cardano.Ledger.Dijkstra.Binary.RoundTrip () @@ -29,3 +30,4 @@ main = BabbageTxInfo.spec @DijkstraEra txInfoSpec @DijkstraEra SPlutusV3 txInfoSpec @DijkstraEra SPlutusV4 + Binary.spec @DijkstraEra