Skip to content

Commit

Permalink
Remove unused Write.Tx.Gen.genTxOut (#4048)
Browse files Browse the repository at this point in the history
```
This removes the Write.Tx.Gen dependency on Cardano.Api.Gen. In the
future, let's re-add it, and remove the dependency on cardano-api types
even for generators.
```

### Issue Number

ADP-3081
  • Loading branch information
Anviking authored Jul 20, 2023
2 parents a2a5d6b + 7bc198b commit 4477b99
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions lib/wallet/src/Cardano/Wallet/Write/Tx/Gen.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,22 @@
--
module Cardano.Wallet.Write.Tx.Gen
( genDatumHash
, genTxOut
)
where

import Prelude

import Cardano.Wallet.Write.Tx
( DatumHash
, RecentEra
, ShelleyLedgerEra
, TxOut
, cardanoEraFromRecentEra
, datumHashFromBytes
, shelleyBasedEraFromRecentEra
)
( DatumHash, datumHashFromBytes )
import Data.Maybe
( fromMaybe )
import Test.QuickCheck
( Gen, arbitrary, vectorOf )

import qualified Cardano.Api.Gen as Cardano
import qualified Cardano.Api.Shelley as Cardano
import qualified Data.ByteString as BS

genDatumHash :: Gen DatumHash
genDatumHash =
fromMaybe (error "genDatumHash should always generate valid hashes")
. datumHashFromBytes
. BS.pack <$> vectorOf 32 arbitrary

genTxOut :: RecentEra era -> Gen (TxOut (ShelleyLedgerEra era))
genTxOut era = Cardano.toShelleyTxOut (shelleyBasedEraFromRecentEra era)
<$> Cardano.genTxOut (cardanoEraFromRecentEra era)

0 comments on commit 4477b99

Please sign in to comment.