Skip to content

Commit 6e17447

Browse files
committed
Parametrise collectScriptHashes on Tx instead of TxBody
1 parent 29dae50 commit 6e17447

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cardano-api/internal/Cardano/Api/Plutus.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import Cardano.Api.Query (UTxO, toLedgerUTxO)
1818
import qualified Cardano.Api.ReexposeLedger as L
1919
import Cardano.Api.Script (ScriptHash, fromShelleyScriptHash)
2020
import qualified Cardano.Api.Script as Api
21-
import Cardano.Api.Tx.Body (ScriptWitnessIndex (..), TxBody, toScriptIndex)
22-
import Cardano.Api.Tx.Sign (Tx (..), makeSignedTransaction)
21+
import Cardano.Api.Tx.Body (ScriptWitnessIndex (..), toScriptIndex)
22+
import Cardano.Api.Tx.Sign (Tx (..))
2323

2424
import qualified Cardano.Ledger.Alonzo.Scripts as L
2525
import qualified Cardano.Ledger.Alonzo.UTxO as Alonzo
@@ -105,12 +105,12 @@ lookupPlutusErrorCode code =
105105
-- and return them in a map with their corresponding 'ScriptWitnessIndex' as key.
106106
collectPlutusScriptHashes
107107
:: AlonzoEraOnwards era
108-
-> TxBody era
108+
-> Tx era
109109
-> UTxO era
110110
-> Map ScriptWitnessIndex ScriptHash
111-
collectPlutusScriptHashes aeo tb utxo =
111+
collectPlutusScriptHashes aeo tx utxo =
112112
alonzoEraOnwardsConstraints aeo $
113-
let ShelleyTx _ ledgerTx' = makeSignedTransaction [] tb
113+
let ShelleyTx _ ledgerTx' = tx
114114
ledgerUTxO = toLedgerUTxO (convert aeo) utxo
115115
in getPurposes aeo $ L.getScriptsNeeded ledgerUTxO (ledgerTx' ^. L.bodyTxL)
116116
where

0 commit comments

Comments
 (0)