Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data BabbageUTXO era
-
data
BabbageUtxoPred
era
- = FromAlonzoUtxoFail !( UtxoPredicateFailure era)
- | IncorrectTotalCollateralField ! Coin ! Coin
- | BabbageOutputTooSmallUTxO ![( TxOut era, Coin )]
- feesOK :: forall era. ( Era era, Tx era ~ ValidatedTx era, TxBody era ~ TxBody era, TxOut era ~ TxOut era, HasField "collateral" ( TxBody era) ( Set ( TxIn ( Crypto era))), HasField "_minfeeA" ( PParams era) Natural , HasField "_minfeeB" ( PParams era) Natural , HasField "_collateralPercentage" ( PParams era) Natural , HasField "collateralReturn" ( TxBody era) ( StrictMaybe ( TxOut era)), HasField "_prices" ( PParams era) Prices , HasField "txrdmrs" ( Witnesses era) ( Redeemers era), HasField "totalCollateral" ( TxBody era) ( StrictMaybe Coin )) => PParams era -> Tx era -> UTxO era -> Test ( BabbageUtxoPred era)
- validateTotalCollateral :: forall era. ( Era era, HasField "_collateralPercentage" ( PParams era) Natural , HasField "totalCollateral" ( TxBody era) ( StrictMaybe Coin )) => PParams era -> TxBody era -> Map ( TxIn ( Crypto era)) ( TxOut era) -> Value era -> Test ( BabbageUtxoPred era)
- validateCollateralEqBalance :: Coin -> StrictMaybe Coin -> Validation ( NonEmpty ( BabbageUtxoPred era)) ()
- babbageMinUTxOValue :: HasField "_coinsPerUTxOByte" ( PParams era) Coin => PParams era -> Sized ( TxOut era) -> Coin
- validateOutputTooSmallUTxO :: ( Era era, HasField "_coinsPerUTxOByte" ( PParams era) Coin ) => PParams era -> [ Sized ( TxOut era)] -> Test ( BabbageUtxoPred era)
- validateOutputTooBigUTxO :: ( HasField "_maxValSize" ( PParams era) Natural , HasField "value" ( TxOut era) ( Value era), ToCBOR ( Value era)) => PParams era -> [ TxOut era] -> Test ( UtxoPredicateFailure era)
- validateOutputBootAddrAttrsTooBig :: Era era => [ TxOut era] -> Test ( UtxoPredicateFailure era)
- utxoTransition :: forall era. ( Era era, ValidateScript era, ConcreteBabbage era, STS ( BabbageUTXO era), Embed ( EraRule "UTXOS" era) ( BabbageUTXO era), Environment ( EraRule "UTXOS" era) ~ UtxoEnv era, State ( EraRule "UTXOS" era) ~ UTxOState era, Signal ( EraRule "UTXOS" era) ~ Tx era, Inject ( PredicateFailure ( EraRule "PPUP" era)) ( PredicateFailure ( EraRule "UTXOS" era)), ExtendedUTxO era) => TransitionRule ( BabbageUTXO era)
Documentation
data BabbageUTXO era Source #
Instances
data BabbageUtxoPred era Source #
Predicate failure for the Babbage Era
FromAlonzoUtxoFail !( UtxoPredicateFailure era) | |
IncorrectTotalCollateralField |
The collateral is not equivalent to the total collateral asserted by the transaction |
BabbageOutputTooSmallUTxO ![( TxOut era, Coin )] |
list of supplied transaction outputs that are too small, together with the minimum value for the given output. |
Instances
feesOK :: forall era. ( Era era, Tx era ~ ValidatedTx era, TxBody era ~ TxBody era, TxOut era ~ TxOut era, HasField "collateral" ( TxBody era) ( Set ( TxIn ( Crypto era))), HasField "_minfeeA" ( PParams era) Natural , HasField "_minfeeB" ( PParams era) Natural , HasField "_collateralPercentage" ( PParams era) Natural , HasField "collateralReturn" ( TxBody era) ( StrictMaybe ( TxOut era)), HasField "_prices" ( PParams era) Prices , HasField "txrdmrs" ( Witnesses era) ( Redeemers era), HasField "totalCollateral" ( TxBody era) ( StrictMaybe Coin )) => PParams era -> Tx era -> UTxO era -> Test ( BabbageUtxoPred era) Source #
feesOK is a predicate with several parts. Some parts only apply in special circumstances. 1) The fee paid is >= the minimum fee 2) If the total ExUnits are 0 in both Memory and Steps, no further part needs to be checked. 3) The collateral consists only of VKey addresses 4) The collateral inputs do not contain any non-ADA part 5) The collateral is sufficient to cover the appropriate percentage of the fee marked in the transaction 6) The collateral is equivalent to total collateral asserted by the transaction 7) There is at least one collateral input
feesOK can differ from Era to Era, as new notions of fees arise. This is the Babbage version See: Figure 2: Functions related to fees and collateral, in the Babbage specification In the spec feesOK is a boolean function. Because wee need to handle predicate failures in the implementaion, it is coded as a Test. Which is a validation. This version is generic in that it can be lifted to any PredicateFailure type that embeds BabbageUtxoPred era. This makes it possibly useful in future Eras.
validateTotalCollateral :: forall era. ( Era era, HasField "_collateralPercentage" ( PParams era) Natural , HasField "totalCollateral" ( TxBody era) ( StrictMaybe Coin )) => PParams era -> TxBody era -> Map ( TxIn ( Crypto era)) ( TxOut era) -> Value era -> Test ( BabbageUtxoPred era) Source #
validateCollateralEqBalance :: Coin -> StrictMaybe Coin -> Validation ( NonEmpty ( BabbageUtxoPred era)) () Source #
babbageMinUTxOValue :: HasField "_coinsPerUTxOByte" ( PParams era) Coin => PParams era -> Sized ( TxOut era) -> Coin Source #
validateOutputTooSmallUTxO :: ( Era era, HasField "_coinsPerUTxOByte" ( PParams era) Coin ) => PParams era -> [ Sized ( TxOut era)] -> Test ( BabbageUtxoPred era) Source #
validateOutputTooBigUTxO :: ( HasField "_maxValSize" ( PParams era) Natural , HasField "value" ( TxOut era) ( Value era), ToCBOR ( Value era)) => PParams era -> [ TxOut era] -> Test ( UtxoPredicateFailure era) Source #
validateOutputBootAddrAttrsTooBig :: Era era => [ TxOut era] -> Test ( UtxoPredicateFailure era) Source #
utxoTransition :: forall era. ( Era era, ValidateScript era, ConcreteBabbage era, STS ( BabbageUTXO era), Embed ( EraRule "UTXOS" era) ( BabbageUTXO era), Environment ( EraRule "UTXOS" era) ~ UtxoEnv era, State ( EraRule "UTXOS" era) ~ UTxOState era, Signal ( EraRule "UTXOS" era) ~ Tx era, Inject ( PredicateFailure ( EraRule "PPUP" era)) ( PredicateFailure ( EraRule "UTXOS" era)), ExtendedUTxO era) => TransitionRule ( BabbageUTXO era) Source #
The UTxO transition rule for the Babbage eras.