@@ -77,7 +77,7 @@ import Cardano.Ledger.Shelley.Tx (Tx (..))
7777import Cardano.Ledger.Shelley.TxAuxData
7878import Cardano.Ledger.Shelley.TxCert (
7979 GenesisDelegCert (.. ),
80- ShelleyTxCert ,
80+ ShelleyTxCert ( .. ) ,
8181 )
8282import Cardano.Ledger.Shelley.TxOut
8383import Cardano.Ledger.Shelley.TxWits (ShelleyTxWits (ShelleyTxWits ))
@@ -93,7 +93,7 @@ import Data.Word (Word64)
9393import Generic.Random (genericArbitraryU )
9494import Test.Cardano.Chain.UTxO.Gen (genCompactTxOut )
9595import Test.Cardano.Ledger.Common
96- import Test.Cardano.Ledger.Core.Arbitrary ()
96+ import Test.Cardano.Ledger.Core.Arbitrary (genPoolParamsNoDefaultVote )
9797import Test.Cardano.Ledger.Core.Utils (unsafeBoundRational )
9898import Test.QuickCheck.Hedgehog (hedgehog )
9999
@@ -248,7 +248,7 @@ instance Arbitrary PoolRewardInfo where
248248 PoolRewardInfo
249249 <$> arbitrary
250250 <*> arbitrary
251- <*> arbitrary
251+ <*> genPoolParamsNoDefaultVote
252252 <*> arbitrary
253253 <*> arbitrary
254254 shrink = genericShrink
@@ -439,8 +439,18 @@ vectorOfMetadatumSimple = do
439439------------------------------------------------------------------------------------------
440440
441441instance Era era => Arbitrary (ShelleyTxCert era ) where
442- arbitrary = genericArbitraryU
443442 shrink = genericShrink
443+ arbitrary =
444+ oneof
445+ [ ShelleyTxCertDelegCert <$> arbitrary
446+ , ShelleyTxCertPool
447+ <$> oneof
448+ [ RegPool <$> genPoolParamsNoDefaultVote
449+ , RetirePool <$> arbitrary <*> arbitrary
450+ ]
451+ , ShelleyTxCertGenesisDeleg <$> arbitrary
452+ , ShelleyTxCertMir <$> arbitrary
453+ ]
444454
445455instance Arbitrary ShelleyDelegCert where
446456 arbitrary = genericArbitraryU
@@ -608,7 +618,17 @@ instance
608618 pure ShelleyGenesis {.. }
609619
610620instance Arbitrary ShelleyGenesisStaking where
611- arbitrary = ShelleyGenesisStaking <$> arbitrary <*> arbitrary
621+ arbitrary = ShelleyGenesisStaking <$> genPoolParamsListMap <*> arbitrary
622+
623+ genPoolParamsListMap :: Gen (LM. ListMap (KeyHash 'StakePool) PoolParams )
624+ genPoolParamsListMap =
625+ LM. fromList <$> listOf pair
626+ where
627+ pair :: Gen (KeyHash 'StakePool, PoolParams )
628+ pair = do
629+ k <- arbitrary
630+ v <- genPoolParamsNoDefaultVote
631+ pure (k, v)
612632
613633instance
614634 ( Era era
0 commit comments