@@ -167,9 +167,20 @@ buildUtxoMapScan confHashes initialUtxoMap = Scanl.mkScanl step initial
167167
168168transactionScan ::
169169 (Monad m ) =>
170+ -- | Script hashes provided in the configuration.
170171 Set C. ScriptHash ->
172+ -- | Previous minimal UTxO state
171173 Map C. TxIn C. ScriptHash ->
172- Scanl m (C. Tx era ) (Map C. TxIn C. ScriptHash , (C. Tx era , Set C. ScriptHash ))
174+ Scanl
175+ m
176+ (C. Tx era )
177+ ( Map C. TxIn C. ScriptHash -- UTxO state after tx is applied
178+ , ( -- Transaction that is applied
179+ C. Tx era
180+ , -- Script hashes in the transaction that meet the criteria
181+ Set C. ScriptHash
182+ )
183+ )
173184transactionScan confHashes initialUtxoMap =
174185 second withAllIntersectingPolicies
175186 <$> buildUtxoMapScan confHashes initialUtxoMap
@@ -188,6 +199,7 @@ transactionScan confHashes initialUtxoMap =
188199 Set. union nonSpendIntersectingPolicies spendIntersectingPolicies
189200 in (tx, allIntersectingPolicies)
190201
202+ -- QUESTION: Does it make sense to specialize the folds to Identity?
191203selectScriptTriggeredTxs ::
192204 Set C. ScriptHash ->
193205 Map C. TxIn C. ScriptHash ->
@@ -293,6 +305,9 @@ mkTransactionContext' cm bc tx = do
293305-- Evaluation
294306--------------------------------------------------------------------------------
295307
308+ -- TODO: ResolvedScript is something that never changes and can be pretty
309+ -- large. It may be worth putting "Map.Map C.ScriptHash [ResolvedScript]" in a
310+ -- compact region.
296311evaluateTransaction ::
297312 forall era .
298313 BlockContext era ->
0 commit comments