@@ -535,7 +535,7 @@ close ctx spendableUTxO headId HeadParameters{parties, contestationPeriod} confi
535
535
{ snapshotNumber = number
536
536
, closeUtxoHash = UTxOHash $ hashUTxO @ Tx utxo
537
537
, closeUtxoToDecommitHash =
538
- UTxOHash $ maybe ( hashUTxO @ Tx mempty ) (hashUTxO @ Tx ) utxoToDecommit
538
+ UTxOHash $ hashUTxO @ Tx $ fromMaybe mempty utxoToDecommit
539
539
, signatures
540
540
}
541
541
@@ -598,19 +598,21 @@ fanout ::
598
598
UTxO ->
599
599
-- | Seed TxIn
600
600
TxIn ->
601
- -- | Snapshot UTxO to fanout
601
+ -- | Snapshot UTxO to decommit to fanout
602
602
UTxO ->
603
+ -- | Snapshot UTxO to fanout
604
+ Maybe UTxO ->
603
605
-- | Contestation deadline as SlotNo, used to set lower tx validity bound.
604
606
SlotNo ->
605
607
Either FanoutTxError Tx
606
- fanout ctx spendableUTxO seedTxIn utxo deadlineSlotNo = do
608
+ fanout ctx spendableUTxO seedTxIn utxo utxoToDecommit deadlineSlotNo = do
607
609
headUTxO <-
608
610
UTxO. find (isScriptTxOut headScript) (utxoOfThisHead (headPolicyId seedTxIn) spendableUTxO)
609
611
?> CannotFindHeadOutputToFanout
610
612
611
613
closedThreadUTxO <- checkHeadDatum headUTxO
612
614
613
- pure $ fanoutTx scriptRegistry utxo closedThreadUTxO deadlineSlotNo headTokenScript
615
+ pure $ fanoutTx scriptRegistry utxo utxoToDecommit closedThreadUTxO deadlineSlotNo headTokenScript
614
616
where
615
617
headTokenScript = mkHeadTokenScript seedTxIn
616
618
@@ -1084,7 +1086,8 @@ genFanoutTx numParties numOutputs = do
1084
1086
cctx <- pickChainContext ctx
1085
1087
let deadlineSlotNo = slotNoFromUTCTime systemStart slotLength (getContestationDeadline stClosed)
1086
1088
spendableUTxO = getKnownUTxO stClosed
1087
- pure (ctx, stClosed, unsafeFanout cctx spendableUTxO seedTxIn toFanout deadlineSlotNo)
1089
+ -- TODO: generate UTxO to decommit here too
1090
+ pure (ctx, stClosed, unsafeFanout cctx spendableUTxO seedTxIn toFanout Nothing deadlineSlotNo)
1088
1091
1089
1092
getContestationDeadline :: ClosedState -> UTCTime
1090
1093
getContestationDeadline
@@ -1224,11 +1227,13 @@ unsafeFanout ::
1224
1227
TxIn ->
1225
1228
-- | Snapshot UTxO to fanout
1226
1229
UTxO ->
1230
+ -- | Snapshot decommit UTxO to fanout
1231
+ Maybe UTxO ->
1227
1232
-- | Contestation deadline as SlotNo, used to set lower tx validity bound.
1228
1233
SlotNo ->
1229
1234
Tx
1230
- unsafeFanout ctx spendableUTxO seedTxIn utxo deadlineSlotNo =
1231
- either (error . show ) id $ fanout ctx spendableUTxO seedTxIn utxo deadlineSlotNo
1235
+ unsafeFanout ctx spendableUTxO seedTxIn utxo utxoToDecommit deadlineSlotNo =
1236
+ either (error . show ) id $ fanout ctx spendableUTxO seedTxIn utxo utxoToDecommit deadlineSlotNo
1232
1237
1233
1238
unsafeObserveInit ::
1234
1239
HasCallStack =>
0 commit comments