Skip to content

Commit

Permalink
Not filter protocol updates in Arbitrary Tx anymore
Browse files Browse the repository at this point in the history
Those are now represented differently in Conway and we'll see how the
fully random transactions (including governance actions that supersede
protocol updates) behave in situations where we use this generator.
  • Loading branch information
ch1bo authored and locallycompact committed Mar 13, 2024
1 parent 4444bf7 commit 9494dec
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions hydra-node/src/Hydra/Ledger/Cardano.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ import Hydra.Ledger.Cardano.Builder
import Cardano.Api.UTxO (fromPairs, pairs)
import Cardano.Api.UTxO qualified as UTxO
import Cardano.Crypto.DSIGN qualified as CC
import Cardano.Ledger.Api (updateTxBodyL)
import Cardano.Ledger.Babbage.Tx qualified as Ledger
import Cardano.Ledger.BaseTypes (StrictMaybe (..))
import Cardano.Ledger.BaseTypes qualified as Ledger
import Cardano.Ledger.Binary (decCBOR, decodeFullAnnotator, serialize')
import Cardano.Ledger.Credential qualified as Ledger
Expand All @@ -28,7 +25,6 @@ import Cardano.Ledger.Shelley.Rules qualified as Ledger
import Cardano.Ledger.Shelley.UTxO qualified as Ledger
import Codec.CBOR.Decoding qualified as CBOR
import Codec.CBOR.Encoding qualified as CBOR
import Control.Lens (set)
import Control.Monad (foldM)
import Data.Aeson (object, (.:), (.:?), (.=))
import Data.Aeson qualified as Aeson
Expand Down Expand Up @@ -156,11 +152,7 @@ instance FromJSON Tx where

instance Arbitrary Tx where
-- TODO: shrinker!
arbitrary = fromLedgerTx . withoutProtocolUpdates <$> arbitrary
where
withoutProtocolUpdates tx@(Ledger.AlonzoTx body _ _ _) =
let body' = body & set updateTxBodyL SNothing
in tx{Ledger.body = body'}
arbitrary = fromLedgerTx <$> arbitrary

-- | Create a zero-fee, payment cardano transaction.
mkSimpleTx ::
Expand Down

0 comments on commit 9494dec

Please sign in to comment.