Skip to content

Commit

Permalink
Assert fanout utxo is correct after a decommit
Browse files Browse the repository at this point in the history
  • Loading branch information
v0d1ch authored and ch1bo committed Apr 17, 2024
1 parent a2e1c22 commit 002f732
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions hydra-node/test/Hydra/BehaviorSpec.hs
Expand Up @@ -432,6 +432,19 @@ spec = parallel $ do
waitUntil [n1, n2] $ DecommitApproved{headId = testHeadId, utxoToDecommit = utxoRefs [22]}
waitUntil [n1, n2] $ DecommitFinalized{headId = testHeadId}

it "fanout utxo is correct after a decommit" $
shouldRunInSim $ do
withSimulatedChainAndNetwork $ \chain ->
withHydraNode aliceSk [bob] chain $ \n1 -> do
withHydraNode bobSk [alice] chain $ \n2 -> do
openHead chain n1 n2
let decommitTx = SimpleTx 1 (utxoRef 1) (utxoRef 42)
send n2 (Decommit{decommitTx})
send n1 Close
waitUntil [n1, n2] $ ReadyToFanout{headId = testHeadId}
send n1 Fanout
waitUntil [n1, n2] $ HeadIsFinalized{headId = testHeadId, utxo = utxoRefs [1, 2]}

it "can be finalized by all parties after contestation period" $
shouldRunInSim $ do
withSimulatedChainAndNetwork $ \chain ->
Expand Down

0 comments on commit 002f732

Please sign in to comment.