Skip to content

Commit

Permalink
remove the unused collectNNScriptInputs
Browse files Browse the repository at this point in the history
The function was replaced by collectTwoPhaseScriptInputs a while ago,
 but the old function was never removed.
  • Loading branch information
Jared Corduan committed Apr 26, 2021
1 parent 3899fa2 commit 87d3131
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions alonzo/impl/src/Cardano/Ledger/Alonzo/PlutusScriptApi.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
module Cardano.Ledger.Alonzo.PlutusScriptApi
( -- Figure 8
getData,
collectNNScriptInputs,
evalScripts,
-- Figure 12
scriptsNeeded,
Expand Down Expand Up @@ -50,7 +49,7 @@ import Cardano.Ledger.ShelleyMA.Timelocks (evalTimelock)
import Data.Coders
import Data.List (foldl')
import qualified Data.Map as Map
import Data.Maybe (isJust, maybeToList)
import Data.Maybe (isJust)
import Data.Sequence.Strict (StrictSeq)
import Data.Set (Set)
import qualified Data.Set as Set
Expand Down Expand Up @@ -102,32 +101,6 @@ getData tx (UTxO m) sp = case sp of
Nothing -> []
Just d -> [d]

-- | Collect the inputs (Data, execution budget, costModel) for all twoPhase scripts.
collectNNScriptInputs ::
( Era era,
Core.Script era ~ AlonzoScript.Script era,
Core.TxOut era ~ Alonzo.TxOut era,
Core.TxBody era ~ Alonzo.TxBody era,
Core.Value era ~ Mary.Value (Crypto era),
HasField "datahash" (Core.TxOut era) (StrictMaybe (DataHash (Crypto era))),
HasField "_costmdls" (Core.PParams era) (Map.Map Language CostModel),
HasField "wdrls" (Core.TxBody era) (Wdrl (Crypto era)),
HasField "certs" (Core.TxBody era) (StrictSeq (DCert (Crypto era))),
HasField "inputs" (Core.TxBody era) (Set (TxIn (Crypto era)))
) =>
Core.PParams era ->
ValidatedTx era ->
UTxO era ->
[(AlonzoScript.Script era, [Data era], ExUnits, CostModel)]
collectNNScriptInputs pp tx utxo =
let txinfo = transTx utxo tx
in [ (script, d : (valContext txinfo sp : getData tx utxo sp), eu, cost)
| (sp, scripthash) <- scriptsNeeded utxo tx, -- TODO, IN specification ORDER IS WRONG
(d, eu) <- maybeToList (indexedRdmrs tx sp),
script <- maybeToList (Map.lookup scripthash (txscripts' (getField @"wits" tx))),
cost <- maybeToList (Map.lookup PlutusV1 (getField @"_costmdls" pp))
]

-- ========================================================================

-- | When collecting inputs for twophase scripts, 3 things can go wrong.
Expand Down

0 comments on commit 87d3131

Please sign in to comment.