@@ -26,8 +26,9 @@ import Hydra.Chain (
2626import Hydra.Chain.ChainState (ChainSlot (ChainSlot ))
2727import Hydra.Chain.Direct.State (initialChainState )
2828import Hydra.Ledger.Cardano.Time (slotNoFromUTCTime , slotNoToUTCTime )
29+ import Hydra.Node.Util (checkNonADAAssetsUTxO )
2930import Hydra.Options (OfflineChainConfig (.. ), defaultContestationPeriod )
30- import Hydra.Tx (HeadId (.. ), HeadParameters (.. ), HeadSeed (.. ), Party )
31+ import Hydra.Tx (HeadId (.. ), HeadParameters (.. ), HeadSeed (.. ), Party , Snapshot ( .. ), getSnapshot )
3132import Hydra.Utils (readJsonFileThrow )
3233
3334-- Upstreamed in cardano-api 10.18
@@ -129,7 +130,10 @@ withOfflineChain config party otherParties chainStateHistory callback action = d
129130 , draftCommitTx = \ _ _ -> pure $ Left FailedToDraftTxNotInitializing
130131 , draftDepositTx = \ _ _ _ _ _ -> pure $ Left FailedToConstructDepositTx {failureReason = " not implemented" }
131132 , postTx = const $ pure ()
132- , checkNonADAAssets = const $ pure ()
133+ , checkNonADAAssets = \ confirmedSnapshot -> do
134+ let Snapshot {utxo, utxoToCommit, utxoToDecommit} = getSnapshot confirmedSnapshot
135+ let snapshotUTxO = utxo <> fromMaybe mempty utxoToCommit <> fromMaybe mempty utxoToDecommit
136+ checkNonADAAssetsUTxO snapshotUTxO
133137 }
134138
135139 initializeOfflineHead = do
0 commit comments