Skip to content

Commit

Permalink
Fix DirectChainSpec version
Browse files Browse the repository at this point in the history
  • Loading branch information
v0d1ch committed Dec 19, 2024
1 parent 2b00cfe commit 0bc832e
Showing 1 changed file with 13 additions and 28 deletions.
41 changes: 13 additions & 28 deletions hydra-cluster/test/Test/DirectChainSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ import Hydra.Tx.Utils (
import System.FilePath ((</>))
import System.Process (proc, readCreateProcess)
import Test.Hydra.Tx.Gen (genKeyPair)
import Test.QuickCheck (choose, elements, generate, oneof)
import Test.QuickCheck (choose, generate)

spec :: Spec
spec = around (showLogsOnFailure "DirectChainSpec") $ do
Expand Down Expand Up @@ -321,33 +321,18 @@ spec = around (showLogsOnFailure "DirectChainSpec") $ do

postTx $ CollectComTx someUTxO headId headParameters
aliceChain `observesInTime` OnCollectComTx{headId}
v <- generate $ elements [0, 1]
snapshotVersion <- generate $ elements [0, 1]
snapshot <-
generate $
oneof
[ let (inHead, toDecommit) = splitUTxO someUTxO
in pure
Snapshot
{ headId
, number = 1
, utxo = inHead
, confirmed = []
, utxoToCommit = Nothing
, utxoToDecommit = Just toDecommit
, version = snapshotVersion
}
, pure
Snapshot
{ headId
, number = 1
, utxo = someUTxO
, confirmed = []
, utxoToCommit = Just someUTxOToCommit
, utxoToDecommit = Nothing
, version = snapshotVersion
}
]
let v = 0
let snapshotVersion = 0
let snapshot =
Snapshot
{ headId
, number = 1
, utxo = someUTxO
, confirmed = []
, utxoToCommit = Just someUTxOToCommit
, utxoToDecommit = Nothing
, version = snapshotVersion
}

postTx $ CloseTx headId headParameters snapshotVersion (ConfirmedSnapshot{snapshot, signatures = aggregate [sign aliceSk snapshot]})

Expand Down

0 comments on commit 0bc832e

Please sign in to comment.