Skip to content

Commit

Permalink
Merge pull request #2218 from input-output-hk/jc/two-minor-alonzo-tweaks
Browse files Browse the repository at this point in the history
two minor alonzo tweaks
  • Loading branch information
nc6 authored Apr 3, 2021
2 parents 0785f35 + da5f377 commit 57bc9a5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion alonzo/impl/src/Cardano/Ledger/Alonzo/PlutusScriptApi.hs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ collectNNScriptInputs ::
[(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)
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))),
Expand Down
4 changes: 2 additions & 2 deletions alonzo/impl/src/Cardano/Ledger/Alonzo/Tx.hs
Original file line number Diff line number Diff line change
Expand Up @@ -523,10 +523,10 @@ indexedRdmrs ::
Tx era ->
ScriptPurpose (Crypto era) ->
Maybe (Data era, ExUnits)
indexedRdmrs tx sp = Map.lookup policyid rdmrs
indexedRdmrs tx sp = Map.lookup rdptr' rdmrs
where
rdmrs = unRedeemers $ txrdmrs' . getField @"wits" $ tx
policyid = rdptr @era (getField @"body" tx) sp
rdptr' = rdptr @era (getField @"body" tx) sp

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

Expand Down
4 changes: 2 additions & 2 deletions alonzo/impl/src/Cardano/Ledger/Alonzo/TxInfo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ valContext ::
Era era =>
P.TxInfo ->
ScriptPurpose (Crypto era) ->
[Data era]
valContext txinfo sp = [Data (P.toData (P.Context txinfo (transScriptPurpose sp)))]
Data era
valContext txinfo sp = Data (P.toData (P.Context txinfo (transScriptPurpose sp)))

-- The runPLCScript in the Specification has a slightly different type
-- than the one in the implementation below. Made necessary by the the type
Expand Down

0 comments on commit 57bc9a5

Please sign in to comment.