@@ -94,50 +94,51 @@ mutual
9494txInfo : (ℓ : TxLevel) → UTxO → Tx ℓ → TxInfo
9595
9696txInfo TxLevelTop utxo tx =
97- record { realizedInputs = utxo ∣ (TxBody.txIns txBody)
98- ; txOuts = TxBody.txOuts txBody
99- ; txFee = just (TxBody.txFee txBody)
100- ; mint = TxBody.mint txBody
101- ; txCerts = TxBody.txCerts txBody
102- ; txWithdrawals = TxBody.txWithdrawals txBody
103- ; txVldt = TxBody.txVldt txBody
104- ; vkKey = TxBody.reqSignerHashes txBody
105- ; txGuards = TxBody.txGuards txBody
106- ; txData = DataOf tx
107- ; txId = TxBody.txId txBody
108- ; txInfoSubTxs = nothing
97+ record { realizedInputs = utxo ∣ (TxBody.txIns txBody)
98+ ; txOuts = TxBody.txOuts txBody
99+ ; txFee = just (TxBody.txFee txBody)
100+ ; mint = TxBody.mint txBody
101+ ; txCerts = TxBody.txCerts txBody
102+ ; txWithdrawals = TxBody.txWithdrawals txBody
103+ ; txVldt = TxBody.txVldt txBody
104+ ; vkKey = TxBody.reqSignerHashes txBody
105+ ; txGuards = TxBody.txGuards txBody
106+ ; txData = DataOf tx
107+ ; txId = TxBody.txId txBody
108+ ; txInfoSubTxs = nothing
109109 } where open Tx tx
110110
111111txInfo TxLevelSub utxo tx =
112- record { realizedInputs = utxo ∣ (TxBody.txIns txBody)
113- ; txOuts = TxBody.txOuts txBody
114- ; txFee = nothing
115- ; mint = TxBody.mint txBody
116- ; txCerts = TxBody.txCerts txBody
117- ; txWithdrawals = TxBody.txWithdrawals txBody
118- ; txVldt = TxBody.txVldt txBody
119- ; vkKey = TxBody.reqSignerHashes txBody
120- ; txGuards = TxBody.txGuards txBody
121- ; txData = DataOf tx
122- ; txId = TxBody.txId txBody
123- ; txInfoSubTxs = nothing
112+ record { realizedInputs = utxo ∣ (TxBody.txIns txBody)
113+ ; txOuts = TxBody.txOuts txBody
114+ ; txFee = nothing
115+ ; mint = TxBody.mint txBody
116+ ; txCerts = TxBody.txCerts txBody
117+ ; txWithdrawals = TxBody.txWithdrawals txBody
118+ ; txVldt = TxBody.txVldt txBody
119+ ; vkKey = TxBody.reqSignerHashes txBody
120+ ; txGuards = TxBody.txGuards txBody
121+ ; txData = DataOf tx
122+ ; txId = TxBody.txId txBody
123+ ; txInfoSubTxs = nothing
124124 } where open Tx tx
125125
126126txInfoForPurpose : (ℓ : TxLevel) → UTxO → Tx ℓ → ScriptPurpose → TxInfo
127- -- SubTx scripts never get subTx infos (even if their ScriptPurpose is Guard).
127+
128+
128129txInfoForPurpose TxLevelSub utxo tx sp = txInfo TxLevelSub utxo tx
129- -- Top-level scripts:
130- -- - guard scripts see txInfoSubTxs
131- -- - others do not
130+ -- SubTx scripts never get subTx infos (even if their ScriptPurpose is Guard).
131+
132132txInfoForPurpose TxLevelTop utxo tx sp with sp
133- ... | Guard _ =
134- let base = txInfo TxLevelTop utxo tx
135- txb = TxBodyOf tx
136- subTxs = TxBody.txSubTransactions txb
137- subInfos : List SubTxInfo
138- subInfos = map (txInfo TxLevelSub utxo) subTxs
139- in
140- record base { txInfoSubTxs = just subInfos }
133+ -- Top-level scripts:
134+ -- · guard scripts see subTx infos
135+ ... | Guard _ = record base { txInfoSubTxs = just subInfos }
136+ where
137+ base : TxInfo
138+ base = txInfo TxLevelTop utxo tx
139+ subInfos : List SubTxInfo
140+ subInfos = map (txInfo TxLevelSub utxo) (SubTransactionsOf tx)
141+ -- · other top-level scripts see no subTx infos
141142... | _ = txInfo TxLevelTop utxo tx
142143```
143144
0 commit comments