Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

two minor alonzo tweaks #2218

Merged
merged 2 commits into from
Apr 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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