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

Replace totExunits check with redeemer check #2260

Merged
merged 1 commit into from
Apr 28, 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
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