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

Add missing haddock comments for some Babbage and Alonzo rules #2768

Merged
merged 1 commit into from
May 6, 2022
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
21 changes: 14 additions & 7 deletions eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Utxo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,10 @@ data UtxoPredicateFailure era
-- ^ the Coin produced by this transaction
| -- | the set of addresses with incorrect network IDs
WrongNetwork
!Network -- the expected network id
!Network
-- ^ the expected network id
!(Set (Addr (Crypto era)))
-- ^ the set of addresses with incorrect network IDs
| WrongNetworkWithdrawal
!Network
-- ^ the expected network id
Expand Down Expand Up @@ -185,14 +187,19 @@ data UtxoPredicateFailure era
CollateralContainsNonADA !(Core.Value era)
| -- | Wrong Network ID in body
WrongNetworkInTxBody
!Network -- Actual Network ID
!Network -- Network ID in transaction body
| OutsideForecast
!SlotNo -- slot number outside consensus forecast range
!Network
-- ^ Actual Network ID
!Network
-- ^ Network ID in transaction body
| -- | slot number outside consensus forecast range
OutsideForecast
!SlotNo
| -- | There are too many collateral inputs
TooManyCollateralInputs
!Natural -- Max allowed collateral inputs
!Natural -- Number of collateral inputs
!Natural
-- ^ Max allowed collateral inputs
!Natural
-- ^ Number of collateral inputs
| NoCollateralInputs
deriving (Generic)

Expand Down
28 changes: 20 additions & 8 deletions eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Utxow.hs
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,33 @@ import Validation
-- failure type of the Shelley Era, as they share some failure modes.
data UtxowPredicateFail era
= WrappedShelleyEraFailure !(UtxowPredicateFailure era)
| MissingRedeemers ![(ScriptPurpose (Crypto era), ScriptHash (Crypto era))]
| -- | List of scripts for which no redeemers were supplied
MissingRedeemers
![(ScriptPurpose (Crypto era), ScriptHash (Crypto era))]
| MissingRequiredDatums
!(Set (DataHash (Crypto era))) -- Set of missing data hashes
!(Set (DataHash (Crypto era))) -- Set of received data hashes
!(Set (DataHash (Crypto era)))
-- ^ Set of missing data hashes
!(Set (DataHash (Crypto era)))
-- ^ Set of received data hashes
| NonOutputSupplimentaryDatums
!(Set (DataHash (Crypto era))) -- Set of unallowed data hashes
!(Set (DataHash (Crypto era))) -- Set of acceptable supplimental data hashes
!(Set (DataHash (Crypto era)))
-- ^ Set of unallowed data hashes
!(Set (DataHash (Crypto era)))
-- ^ Set of acceptable supplimental data hashes
| PPViewHashesDontMatch
!(StrictMaybe (ScriptIntegrityHash (Crypto era)))
-- ^ The PPHash in the TxBody
!(StrictMaybe (ScriptIntegrityHash (Crypto era)))
-- ^ Computed from the current Protocol Parameters
| MissingRequiredSigners (Set (KeyHash 'Witness (Crypto era)))
| UnspendableUTxONoDatumHash (Set (TxIn (Crypto era)))
| ExtraRedeemers ![RdmrPtr]
| -- | Set of witnesses which were needed and not supplied
MissingRequiredSigners
(Set (KeyHash 'Witness (Crypto era)))
| -- | Set of transaction inputs that are TwoPhase scripts, and should have a DataHash but don't
UnspendableUTxONoDatumHash
(Set (TxIn (Crypto era)))
| -- | List of redeemers not needed
ExtraRedeemers
![RdmrPtr]
deriving (Generic)

deriving instance
Expand Down
16 changes: 13 additions & 3 deletions eras/babbage/impl/src/Cardano/Ledger/Babbage/Rules/Utxo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,19 @@ data BabbageUTXO era
data BabbageUtxoPred era
= FromAlonzoUtxoFail !(UtxoPredicateFailure era) -- Inherited from Alonzo
| FromAlonzoUtxowFail !(UtxowPredicateFail era)
| UnequalCollateralReturn !Coin !Coin
| DanglingWitnessDataHash !(Set.Set (DataHash (Crypto era)))
| MalformedScripts !(Set (ScriptHash (Crypto era)))
| -- | The collateral is not equivalent to the total collateral asserted by the transaction
UnequalCollateralReturn
!Coin
-- ^ collateral needed
!Coin
-- ^ collateral returned
| -- | the set of hashes in the transaction datum objects that are not in use
-- in the inputHashes or outputs
DanglingWitnessDataHash
!(Set.Set (DataHash (Crypto era)))
| -- | the set of malformed scripts
MalformedScripts
!(Set (ScriptHash (Crypto era)))
| -- | list of supplied transaction outputs that are too small,
-- together with the minimum value for the given output.
BabbageOutputTooSmallUTxO
Expand Down