@@ -10,6 +10,7 @@ import Cardano.Api.UTxO as UTxO
10
10
import Hydra.Chain.Direct.Contract.Mutation (Mutation (.. ), SomeMutation (.. ), changeMintedTokens )
11
11
import Hydra.Chain.Direct.Fixture (slotLength , systemStart , testNetworkId , testPolicyId , testSeedInput )
12
12
import Hydra.Chain.Direct.ScriptRegistry (genScriptRegistry , registryUTxO )
13
+ import Hydra.Chain.Direct.State (splitUTxO )
13
14
import Hydra.Chain.Direct.Tx (fanoutTx , mkHeadOutput )
14
15
import Hydra.Contract.Error (toErrorCode )
15
16
import Hydra.Contract.HeadError (HeadError (.. ))
@@ -42,9 +43,8 @@ healthyFanoutTx =
42
43
tx =
43
44
fanoutTx
44
45
scriptRegistry
45
- healthyFanoutUTxO
46
- -- TODO: add something to decommit here
47
- Nothing
46
+ (fst healthyFanoutSnapshotUTxO)
47
+ (Just $ snd healthyFanoutSnapshotUTxO)
48
48
(headInput, headOutput)
49
49
healthySlotNo
50
50
headTokenScript
@@ -79,12 +79,15 @@ healthyContestationDeadline :: UTCTime
79
79
healthyContestationDeadline =
80
80
slotNoToUTCTime systemStart slotLength $ healthySlotNo - 1
81
81
82
+ healthyFanoutSnapshotUTxO :: (UTxO , UTxO )
83
+ healthyFanoutSnapshotUTxO = generateWith (splitUTxO healthyFanoutUTxO) 42
84
+
82
85
healthyFanoutDatum :: Head. State
83
86
healthyFanoutDatum =
84
87
Head. Closed
85
88
{ snapshotNumber = 1
86
- , utxoHash = toBuiltin $ hashUTxO @ Tx healthyFanoutUTxO
87
- , utxoToDecommitHash = toBuiltin $ hashUTxO @ Tx mempty
89
+ , utxoHash = toBuiltin $ hashUTxO @ Tx ( fst healthyFanoutSnapshotUTxO)
90
+ , utxoToDecommitHash = toBuiltin $ hashUTxO @ Tx ( snd healthyFanoutSnapshotUTxO)
88
91
, parties =
89
92
partyToChain <$> healthyParties
90
93
, contestationDeadline = posixFromUTCTime healthyContestationDeadline
@@ -129,6 +132,8 @@ genFanoutMutation (tx, _utxo) =
129
132
, SomeMutation (pure $ toErrorCode BurntTokenNumberMismatch ) MutateThreadTokenQuantity <$> do
130
133
(token, _) <- elements burntTokens
131
134
changeMintedTokens tx (valueFromList [(token, 1 )])
135
+ , SomeMutation (pure $ toErrorCode FannedOutUtxoHashNotEqualToClosedUtxoHash ) MutateAddUnexpectedOutput . PrependOutput <$> do
136
+ arbitrary >>= genOutput
132
137
]
133
138
where
134
139
burntTokens =
0 commit comments