Skip to content

Commit 71ec275

Browse files
authored
Merge pull request #5468 from IntersectMBO/td/arbitrary-dijkstrablockbody
`Arbitrary` instance for `DijkstraBlockBody`
2 parents 86bf874 + f553a9a commit 71ec275

File tree

2 files changed

+15
-2
lines changed
  • eras/dijkstra/impl/testlib/Test/Cardano/Ledger/Dijkstra
  • libs/cardano-ledger-core/src/Cardano/Ledger

2 files changed

+15
-2
lines changed

eras/dijkstra/impl/testlib/Test/Cardano/Ledger/Dijkstra/Arbitrary.hs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import Cardano.Ledger.Allegra.Scripts (
2020
pattern RequireTimeExpire,
2121
pattern RequireTimeStart,
2222
)
23-
import Cardano.Ledger.BaseTypes (StrictMaybe)
23+
import Cardano.Ledger.BaseTypes (PerasCert (..), StrictMaybe)
2424
import Cardano.Ledger.Dijkstra (DijkstraEra)
2525
import Cardano.Ledger.Dijkstra.Core
2626
import Cardano.Ledger.Dijkstra.Genesis (DijkstraGenesis (..))
@@ -207,3 +207,16 @@ instance
207207
Arbitrary (DijkstraGovPredFailure era)
208208
where
209209
arbitrary = genericArbitraryU
210+
211+
instance Arbitrary PerasCert where
212+
arbitrary = pure PerasCert
213+
214+
instance
215+
( EraBlockBody era
216+
, AlonzoEraTx era
217+
, Arbitrary (Tx TopTx era)
218+
, SafeToHash (TxWits era)
219+
) =>
220+
Arbitrary (DijkstraBlockBody era)
221+
where
222+
arbitrary = DijkstraBlockBody <$> arbitrary <*> arbitrary

libs/cardano-ledger-core/src/Cardano/Ledger/BaseTypes.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ module Cardano.Ledger.BaseTypes (
9292
ToKeyValuePairs (..),
9393

9494
-- * Peras-specific types
95-
PerasCert,
95+
PerasCert (..),
9696
) where
9797

9898
import Cardano.Crypto.Hash

0 commit comments

Comments
 (0)