@@ -780,32 +780,27 @@ spec = parallel $ do
780
780
781
781
waitUntil [n1, n2] $ DecommitFinalized {headId = testHeadId, distributedUTxO = utxoRef 42 }
782
782
783
- it " can close with decommit in flight" $
783
+ it " can fanout with decommit in flight" $
784
784
shouldRunInSim $ do
785
785
withSimulatedChainAndNetwork $ \ chain ->
786
786
withHydraNode aliceSk [bob] chain $ \ n1 -> do
787
787
withHydraNode bobSk [alice] chain $ \ n2 -> do
788
788
openHead2 chain n1 n2
789
789
let decommitTx = SimpleTx 1 (utxoRef 2 ) (utxoRef 42 )
790
790
send n2 (Decommit {decommitTx})
791
+ -- Close while the decommit is still in flight
791
792
send n1 Close
792
- -- XXX: Can't assert DecommitFinalized here as it is not
793
- -- emitted because an incorrect simulation of the chain here.
794
- -- The OnDecrementTx only reaches the nodes HeadLogic after
795
- -- the OnCloseTx. This is impossible using a proper chain so
796
- -- we don't assert it here.
797
- -- waitUntil [n1, n2] $ DecommitFinalized{headId = testHeadId, distributedUTxO = utxoRef 42}
798
793
waitUntil [n1, n2] $ ReadyToFanout {headId = testHeadId}
799
794
send n1 Fanout
800
- waitUntil [n1, n2] $ HeadIsFinalized {headId = testHeadId, utxo = utxoRefs [1 ]}
795
+ waitUntil [n1, n2] $ HeadIsFinalized {headId = testHeadId, utxo = utxoRefs [1 , 42 ]}
801
796
802
- it " fanout utxo is correct after a decommit" $
797
+ it " can fanout after a decommit" $
803
798
shouldRunInSim $ do
804
799
withSimulatedChainAndNetwork $ \ chain ->
805
800
withHydraNode aliceSk [bob] chain $ \ n1 -> do
806
801
withHydraNode bobSk [alice] chain $ \ n2 -> do
807
802
openHead2 chain n1 n2
808
- let decommitTx = SimpleTx 1 (utxoRef 1 ) (utxoRef 42 )
803
+ let decommitTx = SimpleTx 1 (utxoRef 2 ) (utxoRef 42 )
809
804
send n2 (Decommit {decommitTx})
810
805
waitUntil [n1, n2] $
811
806
DecommitApproved
@@ -816,7 +811,7 @@ spec = parallel $ do
816
811
send n1 Close
817
812
waitUntil [n1, n2] $ ReadyToFanout {headId = testHeadId}
818
813
send n1 Fanout
819
- waitUntil [n1, n2] $ HeadIsFinalized {headId = testHeadId, utxo = utxoRefs [2 ]}
814
+ waitUntil [n1, n2] $ HeadIsFinalized {headId = testHeadId, utxo = utxoRefs [1 ]}
820
815
821
816
it " can fanout with empty utxo" $
822
817
shouldRunInSim $ do
0 commit comments