Skip to content

Commit

Permalink
Fix red tests
Browse files Browse the repository at this point in the history
Signed-off-by: Sasha Bogicevic <[email protected]>
  • Loading branch information
v0d1ch committed Aug 6, 2024
1 parent e814e51 commit d1b24f2
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions hydra-node/test/Hydra/BehaviorSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -418,13 +418,13 @@ spec = parallel $ do
withHydraNode bobSk [alice] chain $ \n2 -> do
openHead chain n1 n2
let decommitTx1 = SimpleTx 1 (utxoRef 1) (utxoRef 42)
send n2 (Decommit{decommitTx = decommitTx1})
send n1 (Decommit{decommitTx = decommitTx1})
waitUntil [n1, n2] $
DecommitRequested{headId = testHeadId, decommitTx = decommitTx1, utxoToDecommit = utxoRefs [42]}

let decommitTx2 = SimpleTx 2 (utxoRef 2) (utxoRef 22)
send n1 (Decommit{decommitTx = decommitTx2})
waitUntil [n1] $
send n2 (Decommit{decommitTx = decommitTx2})
waitUntil [n2] $
DecommitInvalid
{ headId = testHeadId
, decommitTx = decommitTx2
Expand All @@ -433,7 +433,7 @@ spec = parallel $ do

waitUntil [n1, n2] $ DecommitFinalized{headId = testHeadId, decommitTxId = txId decommitTx1}

send n1 (Decommit{decommitTx = decommitTx2})
send n2 (Decommit{decommitTx = decommitTx2})
waitUntil [n1, n2] $ DecommitApproved{headId = testHeadId, decommitTxId = txId decommitTx2, utxoToDecommit = utxoRefs [22]}
waitUntil [n1, n2] $ DecommitFinalized{headId = testHeadId, decommitTxId = txId decommitTx2}

Expand Down Expand Up @@ -471,7 +471,12 @@ spec = parallel $ do
send n1 Close
waitUntil [n1, n2] $ ReadyToFanout{headId = testHeadId}
send n1 Fanout
waitUntil [n1, n2] $ HeadIsFinalized{headId = testHeadId, utxo = utxoRefs [1, 2]}

waitMatch n2 $ \case
HeadIsContested{headId, snapshotNumber} -> guard $ headId == testHeadId && snapshotNumber == 1
_ -> Nothing

waitUntil [n1, n2] $ HeadIsFinalized{headId = testHeadId, utxo = utxoRefs [1]}

it "fanout utxo is correct after a decommit" $
shouldRunInSim $ do
Expand Down Expand Up @@ -856,9 +861,8 @@ toOnChainTx now = \case
FanoutTx{} ->
OnFanoutTx{headId = testHeadId}

-- NOTE(SN): Deliberately long to emphasize that we run these tests in IOSim.
testContestationPeriod :: ContestationPeriod
testContestationPeriod = UnsafeContestationPeriod 3600
testContestationPeriod = UnsafeContestationPeriod 10

nothingHappensFor ::
(MonadTimer m, MonadThrow m, IsChainState tx) =>
Expand Down

0 comments on commit d1b24f2

Please sign in to comment.