Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data BabbageLEDGER c
- data BabbageUTXO era
- data BabbageUtxoPredFailure era
- = AlonzoInBabbageUtxoPredFailure !(AlonzoUtxoPredFailure era)
- | IncorrectTotalCollateralField !DeltaCoin !Coin
- | BabbageOutputTooSmallUTxO ![(TxOut era, Coin)]
- | BabbageNonDisjointRefInputs !(NonEmpty (TxIn (EraCrypto era)))
- utxoTransition ∷ ∀ era. (EraUTxO era, BabbageEraTxBody era, AlonzoEraTxWits era, Tx era ~ AlonzoTx era, InjectRuleFailure "UTXO" ShelleyUtxoPredFailure era, InjectRuleFailure "UTXO" AllegraUtxoPredFailure era, InjectRuleFailure "UTXO" AlonzoUtxoPredFailure era, InjectRuleFailure "UTXO" BabbageUtxoPredFailure era, Environment (EraRule "UTXO" era) ~ UtxoEnv era, State (EraRule "UTXO" era) ~ UTxOState era, Signal (EraRule "UTXO" era) ~ AlonzoTx era, BaseM (EraRule "UTXO" era) ~ ShelleyBase, STS (EraRule "UTXO" era), Embed (EraRule "UTXOS" era) (EraRule "UTXO" era), Environment (EraRule "UTXOS" era) ~ UtxoEnv era, State (EraRule "UTXOS" era) ~ UTxOState era, Signal (EraRule "UTXOS" era) ~ Tx era) ⇒ TransitionRule (EraRule "UTXO" era)
- feesOK ∷ ∀ era rule. (EraUTxO era, BabbageEraTxBody era, AlonzoEraTxWits era, InjectRuleFailure rule AlonzoUtxoPredFailure era, InjectRuleFailure rule BabbageUtxoPredFailure era) ⇒ PParams era → Tx era → UTxO era → Test (EraRuleFailure rule era)
- validateTotalCollateral ∷ ∀ era rule. (BabbageEraTxBody era, InjectRuleFailure rule AlonzoUtxoPredFailure era, InjectRuleFailure rule BabbageUtxoPredFailure era) ⇒ PParams era → TxBody era → Map (TxIn (EraCrypto era)) (TxOut era) → Test (EraRuleFailure rule era)
- validateCollateralEqBalance ∷ DeltaCoin → StrictMaybe Coin → Validation (NonEmpty (BabbageUtxoPredFailure era)) ()
- validateOutputTooSmallUTxO ∷ (EraTxOut era, Foldable f) ⇒ PParams era → f (Sized (TxOut era)) → Test (BabbageUtxoPredFailure era)
- data BabbageUTXOS era
- utxosTransition ∷ ∀ era. (AlonzoEraTx era, ShelleyEraTxBody era, BabbageEraTxBody era, AlonzoEraUTxO era, ScriptsNeeded era ~ AlonzoScriptsNeeded era, EraGov era, GovState era ~ ShelleyGovState era, Environment (EraRule "PPUP" era) ~ PpupEnv era, Signal (EraRule "PPUP" era) ~ StrictMaybe (Update era), Embed (EraRule "PPUP" era) (BabbageUTXOS era), State (EraRule "PPUP" era) ~ ShelleyGovState era, Signal (BabbageUTXOS era) ~ Tx era, EncCBOR (EraRuleFailure "PPUP" era), Eq (EraRuleFailure "PPUP" era), Show (EraRuleFailure "PPUP" era), EraPlutusContext era, EraRule "UTXOS" era ~ BabbageUTXOS era, InjectRuleFailure "UTXOS" AlonzoUtxosPredFailure era, InjectRuleEvent "UTXOS" AlonzoUtxosEvent era) ⇒ TransitionRule (BabbageUTXOS era)
- expectScriptsToPass ∷ ∀ era. (AlonzoEraTx era, EraPlutusContext era, AlonzoEraUTxO era, ScriptsNeeded era ~ AlonzoScriptsNeeded era, STS (EraRule "UTXOS" era), InjectRuleFailure "UTXOS" AlonzoUtxosPredFailure era, BaseM (EraRule "UTXOS" era) ~ ShelleyBase, InjectRuleEvent "UTXOS" AlonzoUtxosEvent era) ⇒ PParams era → Tx era → UTxO era → Rule (EraRule "UTXOS" era) 'Transition ()
- babbageEvalScriptsTxInvalid ∷ ∀ era. (AlonzoEraTx era, BabbageEraTxBody era, EraPlutusContext era, AlonzoEraUTxO era, ScriptsNeeded era ~ AlonzoScriptsNeeded era, STS (EraRule "UTXOS" era), Environment (EraRule "UTXOS" era) ~ UtxoEnv era, Signal (EraRule "UTXOS" era) ~ Tx era, State (EraRule "UTXOS" era) ~ UTxOState era, BaseM (EraRule "UTXOS" era) ~ ShelleyBase, InjectRuleFailure "UTXOS" AlonzoUtxosPredFailure era, InjectRuleEvent "UTXOS" AlonzoUtxosEvent era) ⇒ TransitionRule (EraRule "UTXOS" era)
- data BabbageUTXOW era
- data BabbageUtxowPredFailure era
- = AlonzoInBabbageUtxowPredFailure !(AlonzoUtxowPredFailure era)
- | UtxoFailure !(PredicateFailure (EraRule "UTXO" era))
- | MalformedScriptWitnesses !(Set (ScriptHash (EraCrypto era)))
- | MalformedReferenceScripts !(Set (ScriptHash (EraCrypto era)))
- babbageMissingScripts ∷ ∀ era. PParams era → Set (ScriptHash (EraCrypto era)) → Set (ScriptHash (EraCrypto era)) → Set (ScriptHash (EraCrypto era)) → Test (ShelleyUtxowPredFailure era)
- validateFailedBabbageScripts ∷ EraTx era ⇒ Tx era → ScriptsProvided era → Set (ScriptHash (EraCrypto era)) → Test (ShelleyUtxowPredFailure era)
- validateScriptsWellFormed ∷ ∀ era. (EraTx era, BabbageEraTxBody era) ⇒ PParams era → Tx era → Test (BabbageUtxowPredFailure era)
- babbageUtxowTransition ∷ ∀ era. (AlonzoEraTx era, AlonzoEraUTxO era, ScriptsNeeded era ~ AlonzoScriptsNeeded era, BabbageEraTxBody era, Signable (DSIGN (EraCrypto era)) (Hash (HASH (EraCrypto era)) EraIndependentTxBody), Environment (EraRule "UTXOW" era) ~ UtxoEnv era, Signal (EraRule "UTXOW" era) ~ Tx era, State (EraRule "UTXOW" era) ~ UTxOState era, InjectRuleFailure "UTXOW" ShelleyUtxowPredFailure era, InjectRuleFailure "UTXOW" AlonzoUtxowPredFailure era, InjectRuleFailure "UTXOW" BabbageUtxowPredFailure era, Embed (EraRule "UTXO" era) (EraRule "UTXOW" era), Environment (EraRule "UTXO" era) ~ UtxoEnv era, Signal (EraRule "UTXO" era) ~ Tx era, State (EraRule "UTXO" era) ~ UTxOState era) ⇒ TransitionRule (EraRule "UTXOW" era)
Documentation
data BabbageLEDGER c Source #
Instances
data BabbageUTXO era Source #
Instances
data BabbageUtxoPredFailure era Source #
Predicate failure for the Babbage Era
AlonzoInBabbageUtxoPredFailure !(AlonzoUtxoPredFailure 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. |
BabbageNonDisjointRefInputs !(NonEmpty (TxIn (EraCrypto era))) | TxIns that appear in both inputs and reference inputs |
Instances
utxoTransition ∷ ∀ era. (EraUTxO era, BabbageEraTxBody era, AlonzoEraTxWits era, Tx era ~ AlonzoTx era, InjectRuleFailure "UTXO" ShelleyUtxoPredFailure era, InjectRuleFailure "UTXO" AllegraUtxoPredFailure era, InjectRuleFailure "UTXO" AlonzoUtxoPredFailure era, InjectRuleFailure "UTXO" BabbageUtxoPredFailure era, Environment (EraRule "UTXO" era) ~ UtxoEnv era, State (EraRule "UTXO" era) ~ UTxOState era, Signal (EraRule "UTXO" era) ~ AlonzoTx era, BaseM (EraRule "UTXO" era) ~ ShelleyBase, STS (EraRule "UTXO" era), Embed (EraRule "UTXOS" era) (EraRule "UTXO" era), Environment (EraRule "UTXOS" era) ~ UtxoEnv era, State (EraRule "UTXOS" era) ~ UTxOState era, Signal (EraRule "UTXOS" era) ~ Tx era) ⇒ TransitionRule (EraRule "UTXO" era) Source #
The UTxO transition rule for the Babbage eras.
feesOK ∷ ∀ era rule. (EraUTxO era, BabbageEraTxBody era, AlonzoEraTxWits era, InjectRuleFailure rule AlonzoUtxoPredFailure era, InjectRuleFailure rule BabbageUtxoPredFailure era) ⇒ PParams era → Tx era → UTxO era → Test (EraRuleFailure rule 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 ∷ ∀ era rule. (BabbageEraTxBody era, InjectRuleFailure rule AlonzoUtxoPredFailure era, InjectRuleFailure rule BabbageUtxoPredFailure era) ⇒ PParams era → TxBody era → Map (TxIn (EraCrypto era)) (TxOut era) → Test (EraRuleFailure rule era) Source #
validateCollateralEqBalance ∷ DeltaCoin → StrictMaybe Coin → Validation (NonEmpty (BabbageUtxoPredFailure era)) () Source #
validateOutputTooSmallUTxO ∷ (EraTxOut era, Foldable f) ⇒ PParams era → f (Sized (TxOut era)) → Test (BabbageUtxoPredFailure era) Source #
data BabbageUTXOS era Source #
Instances
utxosTransition ∷ ∀ era. (AlonzoEraTx era, ShelleyEraTxBody era, BabbageEraTxBody era, AlonzoEraUTxO era, ScriptsNeeded era ~ AlonzoScriptsNeeded era, EraGov era, GovState era ~ ShelleyGovState era, Environment (EraRule "PPUP" era) ~ PpupEnv era, Signal (EraRule "PPUP" era) ~ StrictMaybe (Update era), Embed (EraRule "PPUP" era) (BabbageUTXOS era), State (EraRule "PPUP" era) ~ ShelleyGovState era, Signal (BabbageUTXOS era) ~ Tx era, EncCBOR (EraRuleFailure "PPUP" era), Eq (EraRuleFailure "PPUP" era), Show (EraRuleFailure "PPUP" era), EraPlutusContext era, EraRule "UTXOS" era ~ BabbageUTXOS era, InjectRuleFailure "UTXOS" AlonzoUtxosPredFailure era, InjectRuleEvent "UTXOS" AlonzoUtxosEvent era) ⇒ TransitionRule (BabbageUTXOS era) Source #
expectScriptsToPass ∷ ∀ era. (AlonzoEraTx era, EraPlutusContext era, AlonzoEraUTxO era, ScriptsNeeded era ~ AlonzoScriptsNeeded era, STS (EraRule "UTXOS" era), InjectRuleFailure "UTXOS" AlonzoUtxosPredFailure era, BaseM (EraRule "UTXOS" era) ~ ShelleyBase, InjectRuleEvent "UTXOS" AlonzoUtxosEvent era) ⇒ PParams era → Tx era → UTxO era → Rule (EraRule "UTXOS" era) 'Transition () Source #
babbageEvalScriptsTxInvalid ∷ ∀ era. (AlonzoEraTx era, BabbageEraTxBody era, EraPlutusContext era, AlonzoEraUTxO era, ScriptsNeeded era ~ AlonzoScriptsNeeded era, STS (EraRule "UTXOS" era), Environment (EraRule "UTXOS" era) ~ UtxoEnv era, Signal (EraRule "UTXOS" era) ~ Tx era, State (EraRule "UTXOS" era) ~ UTxOState era, BaseM (EraRule "UTXOS" era) ~ ShelleyBase, InjectRuleFailure "UTXOS" AlonzoUtxosPredFailure era, InjectRuleEvent "UTXOS" AlonzoUtxosEvent era) ⇒ TransitionRule (EraRule "UTXOS" era) Source #
data BabbageUTXOW era Source #
Instances
data BabbageUtxowPredFailure era Source #
AlonzoInBabbageUtxowPredFailure !(AlonzoUtxowPredFailure era) | |
UtxoFailure !(PredicateFailure (EraRule "UTXO" era)) | Embed UTXO rule failures |
MalformedScriptWitnesses !(Set (ScriptHash (EraCrypto era))) | the set of malformed script witnesses |
MalformedReferenceScripts !(Set (ScriptHash (EraCrypto era))) | the set of malformed script witnesses |
Instances
babbageMissingScripts ∷ ∀ era. PParams era → Set (ScriptHash (EraCrypto era)) → Set (ScriptHash (EraCrypto era)) → Set (ScriptHash (EraCrypto era)) → Test (ShelleyUtxowPredFailure era) Source #
validateFailedBabbageScripts ∷ EraTx era ⇒ Tx era → ScriptsProvided era → Set (ScriptHash (EraCrypto era)) → Test (ShelleyUtxowPredFailure era) Source #
validateScriptsWellFormed ∷ ∀ era. (EraTx era, BabbageEraTxBody era) ⇒ PParams era → Tx era → Test (BabbageUtxowPredFailure era) Source #
babbageUtxowTransition ∷ ∀ era. (AlonzoEraTx era, AlonzoEraUTxO era, ScriptsNeeded era ~ AlonzoScriptsNeeded era, BabbageEraTxBody era, Signable (DSIGN (EraCrypto era)) (Hash (HASH (EraCrypto era)) EraIndependentTxBody), Environment (EraRule "UTXOW" era) ~ UtxoEnv era, Signal (EraRule "UTXOW" era) ~ Tx era, State (EraRule "UTXOW" era) ~ UTxOState era, InjectRuleFailure "UTXOW" ShelleyUtxowPredFailure era, InjectRuleFailure "UTXOW" AlonzoUtxowPredFailure era, InjectRuleFailure "UTXOW" BabbageUtxowPredFailure era, Embed (EraRule "UTXO" era) (EraRule "UTXOW" era), Environment (EraRule "UTXO" era) ~ UtxoEnv era, Signal (EraRule "UTXO" era) ~ Tx era, State (EraRule "UTXO" era) ~ UTxOState era) ⇒ TransitionRule (EraRule "UTXOW" era) Source #
UTXOW transition rule that is used in Babbage and Conway era.