Skip to content

Commit

Permalink
New genCardanoKeyWitness function
Browse files Browse the repository at this point in the history
  • Loading branch information
newhoggy committed Apr 7, 2023
1 parent be1dd96 commit 5c4ad0b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cardano-api/gen/Test/Gen/Cardano/Api/Typed.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
Expand All @@ -18,6 +19,7 @@ module Test.Gen.Cardano.Api.Typed
, genValueNestedRep
, genValueNestedBundle
, genByronKeyWitness
, genCardanoKeyWitness
, genShelleyKeyWitness

, genTxId
Expand Down Expand Up @@ -761,6 +763,13 @@ genShelleyWitnessSigningKey =
, WitnessGenesisUTxOKey <$> genSigningKey AsGenesisUTxOKey
]

genCardanoKeyWitness
:: CardanoEra era
-> Gen (KeyWitness era)
genCardanoKeyWitness era = case cardanoEraStyle era of
LegacyByronEra -> genByronKeyWitness
ShelleyBasedEra _ -> genShelleyWitness era

genSeed :: Int -> Gen Crypto.Seed
genSeed n = Crypto.mkSeedFromBytes <$> Gen.bytes (Range.singleton n)

Expand Down

0 comments on commit 5c4ad0b

Please sign in to comment.