Skip to content

Commit

Permalink
Remove TxSpec as we are moving towards StateSpec
Browse files Browse the repository at this point in the history
Also it was failing for the wrong reason (List empty)
Meaning we should add a constraint such that:
   length parties == length cardanoKeys && not (null cardanoKeys)
  • Loading branch information
ffakenz committed Feb 8, 2023
1 parent a9bd662 commit 80146de
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions hydra-node/test/Hydra/Chain/Direct/TxSpec.hs
Expand Up @@ -14,7 +14,6 @@ import Test.Hydra.Prelude

import qualified Cardano.Api.UTxO as UTxO
import Cardano.Ledger.Babbage.PParams (PParams)
import qualified Data.List as List
import qualified Data.Map as Map
import qualified Data.Text as T
import GHC.Natural (wordToNatural)
Expand Down Expand Up @@ -124,21 +123,6 @@ spec =
& counterexample (renderTx tx)
Nothing -> property True

describe "initTx" $ do
prop "Ignore InitTx with wrong number of PT tokens distributed" $
withMaxSuccess 60 $ \txIn cperiod (party :| parties) cardanoKeys ->
let params = HeadParameters cperiod (party : parties)
-- Here we use a wrong number of cardano-keys to build the tx
-- as they are used to generate the PT tokens to be minted
wrongCardanoKeys = List.tail cardanoKeys
tx = initTx testNetworkId wrongCardanoKeys params txIn
in case observeInitTx testNetworkId cardanoKeys cperiod party tx of
Just InitObservation{} -> do
property False
& counterexample "Failed to ignore init tx with the wrong number of PT tokens distributed."
& counterexample (renderTx tx)
Nothing -> property True

ledgerPParams :: PParams LedgerEra
ledgerPParams = toLedgerPParams (shelleyBasedEra @Era) pparams

Expand Down

0 comments on commit 80146de

Please sign in to comment.