Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data ShelleyUTXO era
- data UtxoEnv era = UtxoEnv {}
- data ShelleyUtxoPredFailure era
- = BadInputsUTxO !(Set (TxIn (EraCrypto era)))
- | ExpiredUTxO !SlotNo !SlotNo
- | MaxTxSizeUTxO !Integer !Integer
- | InputSetEmptyUTxO
- | FeeTooSmallUTxO !Coin !Coin
- | ValueNotConservedUTxO !(Value era) !(Value era)
- | WrongNetwork !Network !(Set (Addr (EraCrypto era)))
- | WrongNetworkWithdrawal !Network !(Set (RewardAccount (EraCrypto era)))
- | OutputTooSmallUTxO ![TxOut era]
- | UpdateFailure (EraRuleFailure "PPUP" era)
- | OutputBootAddrAttrsTooBig ![TxOut era]
- data UtxoEvent era
- = TotalDeposits (SafeHash (EraCrypto era) EraIndependentTxBody) Coin
- | UpdateEvent (Event (EraRule "PPUP" era))
- | TxUTxODiff (UTxO era) (UTxO era)
- type family PredicateFailure a
- updateUTxOState ∷ (EraTxBody era, Monad m) ⇒ PParams era → UTxOState era → TxBody era → CertState era → GovState era → (Coin → m ()) → (UTxO era → UTxO era → m ()) → m (UTxOState era)
- validateInputSetEmptyUTxO ∷ EraTxBody era ⇒ TxBody era → Test (ShelleyUtxoPredFailure era)
- validateFeeTooSmallUTxO ∷ EraUTxO era ⇒ PParams era → Tx era → UTxO era → Test (ShelleyUtxoPredFailure era)
- validateBadInputsUTxO ∷ UTxO era → Set (TxIn (EraCrypto era)) → Test (ShelleyUtxoPredFailure era)
- validateWrongNetwork ∷ (EraTxOut era, Foldable f) ⇒ Network → f (TxOut era) → Test (ShelleyUtxoPredFailure era)
- validateWrongNetworkWithdrawal ∷ EraTxBody era ⇒ Network → TxBody era → Test (ShelleyUtxoPredFailure era)
- validateOutputBootAddrAttrsTooBig ∷ (EraTxOut era, Foldable f) ⇒ f (TxOut era) → Test (ShelleyUtxoPredFailure era)
- validateMaxTxSizeUTxO ∷ EraTx era ⇒ PParams era → Tx era → Test (ShelleyUtxoPredFailure era)
- validateValueNotConservedUTxO ∷ EraUTxO era ⇒ PParams era → UTxO era → CertState era → TxBody era → Test (ShelleyUtxoPredFailure era)
- utxoEnvSlotL ∷ Lens' (UtxoEnv era) SlotNo
- utxoEnvPParamsL ∷ Lens' (UtxoEnv era) (PParams era)
- utxoEnvCertStateL ∷ Lens' (UtxoEnv era) (CertState era)
Documentation
data ShelleyUTXO era Source #
Instances
Instances
Generic (UtxoEnv era) Source # | |
Show (PParams era) ⇒ Show (UtxoEnv era) Source # | |
(Era era, NFData (PParams era)) ⇒ NFData (UtxoEnv era) Source # | |
Defined in Cardano.Ledger.Shelley.Rules.Utxo | |
Eq (PParams era) ⇒ Eq (UtxoEnv era) Source # | |
type Rep (UtxoEnv era) Source # | |
Defined in Cardano.Ledger.Shelley.Rules.Utxo type Rep (UtxoEnv era) = D1 ('MetaData "UtxoEnv" "Cardano.Ledger.Shelley.Rules.Utxo" "cardano-ledger-shelley-1.11.0.0-inplace" 'False) (C1 ('MetaCons "UtxoEnv" 'PrefixI 'True) (S1 ('MetaSel ('Just "ueSlot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SlotNo) :*: (S1 ('MetaSel ('Just "uePParams") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PParams era)) :*: S1 ('MetaSel ('Just "ueCertState") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (CertState era))))) |
data ShelleyUtxoPredFailure era Source #
BadInputsUTxO !(Set (TxIn (EraCrypto era))) | |
ExpiredUTxO !SlotNo !SlotNo | |
MaxTxSizeUTxO !Integer !Integer | |
InputSetEmptyUTxO | |
FeeTooSmallUTxO !Coin !Coin | |
ValueNotConservedUTxO !(Value era) !(Value era) | |
WrongNetwork !Network !(Set (Addr (EraCrypto era))) | |
WrongNetworkWithdrawal !Network !(Set (RewardAccount (EraCrypto era))) | |
OutputTooSmallUTxO ![TxOut era] | |
UpdateFailure (EraRuleFailure "PPUP" era) | |
OutputBootAddrAttrsTooBig ![TxOut era] |
Instances
TotalDeposits (SafeHash (EraCrypto era) EraIndependentTxBody) Coin | |
UpdateEvent (Event (EraRule "PPUP" era)) | |
TxUTxODiff | The UTxOs consumed and created by a signal tx |
Instances
type family PredicateFailure a Source #
Descriptive type for the possible failures which might cause a transition to fail.
As a convention, PredicateFailure
s which are "structural" (meaning that
they are not "throwable" in practice, and are used to pass control from
one transition rule to another) are prefixed with S_
.
Structural PredicateFailure
s represent conditions between rules where
the disjunction of all rules' preconditions is equal to True
. That is,
either one rule will throw a structural PredicateFailure
and the other
will succeed, or vice-versa.
Instances
updateUTxOState ∷ (EraTxBody era, Monad m) ⇒ PParams era → UTxOState era → TxBody era → CertState era → GovState era → (Coin → m ()) → (UTxO era → UTxO era → m ()) → m (UTxOState era) Source #
This monadic action captures the final stages of the UTXO(S) rule. In particular it
applies all of the UTxO related aditions and removals, gathers all of the fees into the
fee pot utxosFees
and updates the utxosDeposited
field. Continuation supplied will
be called on the deposit - refund
change, which is normally used to emit the
TotalDeposits
event.
Validations
validateInputSetEmptyUTxO ∷ EraTxBody era ⇒ TxBody era → Test (ShelleyUtxoPredFailure era) Source #
Ensure that there is at least one input in the TxBody
txins txb ≠ ∅
validateFeeTooSmallUTxO ∷ EraUTxO era ⇒ PParams era → Tx era → UTxO era → Test (ShelleyUtxoPredFailure era) Source #
Ensure that the fee is at least the amount specified by the minfee
minfee pp tx ≤ txfee txb
validateBadInputsUTxO ∷ UTxO era → Set (TxIn (EraCrypto era)) → Test (ShelleyUtxoPredFailure era) Source #
Ensure all transaction inputs are present in UTxO
inputs ⊆ dom utxo
validateWrongNetwork ∷ (EraTxOut era, Foldable f) ⇒ Network → f (TxOut era) → Test (ShelleyUtxoPredFailure era) Source #
Make sure all addresses match the supplied NetworkId
∀(_ → (a, _)) ∈ txouts txb, netId a = NetworkId
validateWrongNetworkWithdrawal ∷ EraTxBody era ⇒ Network → TxBody era → Test (ShelleyUtxoPredFailure era) Source #
Make sure all addresses match the supplied NetworkId
∀(a → ) ∈ txwdrls txb, netId a = NetworkId
validateOutputBootAddrAttrsTooBig ∷ (EraTxOut era, Foldable f) ⇒ f (TxOut era) → Test (ShelleyUtxoPredFailure era) Source #
Bootstrap (i.e. Byron) addresses have variable sized attributes in them. It is important to limit their overall size.
∀ ( _ ↦ (a,_)) ∈ txoutstxb, a ∈ Addrbootstrap → bootstrapAttrsSize a ≤ 64
validateMaxTxSizeUTxO ∷ EraTx era ⇒ PParams era → Tx era → Test (ShelleyUtxoPredFailure era) Source #
Ensure that the size of the transaction does not exceed the maxTxSize
protocol parameter
txsize tx ≤ maxTxSize pp
validateValueNotConservedUTxO ∷ EraUTxO era ⇒ PParams era → UTxO era → CertState era → TxBody era → Test (ShelleyUtxoPredFailure era) Source #
Ensure that value consumed and produced matches up exactly
consumed pp utxo txb = produced pp poolParams txb