Skip to content

Commit

Permalink
Merge pull request #2260 from input-output-hk/jc/change-total-executi…
Browse files Browse the repository at this point in the history
…on-units-check

Replace totExunits check with redeemer check
  • Loading branch information
Jared Corduan authored Apr 28, 2021
2 parents e8f19bc + 0a0b6c6 commit 62fc23a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Utxo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import Cardano.Ledger.Alonzo.Tx
isTwoPhaseScriptAddress,
minfee,
txbody,
wits',
)
import qualified Cardano.Ledger.Alonzo.Tx as Alonzo (ValidatedTx, txins)
import Cardano.Ledger.Alonzo.TxBody
Expand All @@ -32,6 +33,7 @@ import Cardano.Ledger.Alonzo.TxBody
)
import qualified Cardano.Ledger.Alonzo.TxBody as Alonzo (TxBody, TxOut)
import qualified Cardano.Ledger.Alonzo.TxSeq as Alonzo (TxSeq)
import Cardano.Ledger.Alonzo.TxWitness (TxWitness (txrdmrs'), nullRedeemers)
import Cardano.Ledger.Coin
import qualified Cardano.Ledger.Core as Core
import Cardano.Ledger.Era (Crypto, Era, TxInBlock, ValidateScript (..))
Expand Down Expand Up @@ -262,7 +264,7 @@ feesOK pp tx (UTxO m) = do
-- Part 1
(minimumFee <= theFee) ?! FeeTooSmallUTxO minimumFee theFee
-- Part 2
if (getField @"totExunits" tx) == (ExUnits 0 0)
if nullRedeemers . txrdmrs' . wits' $ tx
then pure ()
else do
-- Part 3
Expand Down
1 change: 1 addition & 0 deletions alonzo/impl/src/Cardano/Ledger/Alonzo/TxWitness.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module Cardano.Ledger.Alonzo.TxWitness
Redeemers'
),
unRedeemers,
nullRedeemers,
TxWitness
( TxWitness,
txwitsVKey,
Expand Down

0 comments on commit 62fc23a

Please sign in to comment.