Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class EraTx era ⇒ EraUTxO era where
- type ScriptsNeeded era = (r ∷ Type) | r → era
- getConsumedValue ∷ PParams era → (Credential 'Staking → Maybe Coin) → (Credential 'DRepRole → Maybe Coin) → UTxO era → TxBody era → Value era
- getProducedValue ∷ PParams era → (KeyHash 'StakePool → Bool) → TxBody era → Value era
- getScriptsProvided ∷ UTxO era → Tx era → ScriptsProvided era
- getScriptsNeeded ∷ UTxO era → TxBody era → ScriptsNeeded era
- getScriptsHashesNeeded ∷ ScriptsNeeded era → Set ScriptHash
- getWitsVKeyNeeded ∷ CertState era → UTxO era → TxBody era → Set (KeyHash 'Witness)
- getMinFeeTxUtxo ∷ PParams era → Tx era → UTxO era → Coin
- newtype ShelleyScriptsNeeded era = ShelleyScriptsNeeded (Set ScriptHash)
- getShelleyScriptsNeeded ∷ EraTxBody era ⇒ UTxO era → TxBody era → ShelleyScriptsNeeded era
- getConsumedCoin ∷ EraTxBody era ⇒ PParams era → (Credential 'Staking → Maybe Coin) → UTxO era → TxBody era → Coin
- shelleyProducedValue ∷ EraTxBody era ⇒ PParams era → (KeyHash 'StakePool → Bool) → TxBody era → Value era
- consumed ∷ EraUTxO era ⇒ PParams era → CertState era → UTxO era → TxBody era → Value era
- produced ∷ EraUTxO era ⇒ PParams era → CertState era → TxBody era → Value era
- getShelleyMinFeeTxUtxo ∷ EraTx era ⇒ PParams era → Tx era → Coin
- getShelleyWitsVKeyNeeded ∷ ∀ era. (EraTx era, ShelleyEraTxBody era) ⇒ CertState era → UTxO era → TxBody era → Set (KeyHash 'Witness)
- getShelleyWitsVKeyNeededNoGov ∷ ∀ era. EraTx era ⇒ UTxO era → TxBody era → Set (KeyHash 'Witness)
- module Cardano.Ledger.UTxO
Documentation
class EraTx era ⇒ EraUTxO era where Source #
type ScriptsNeeded era = (r ∷ Type) | r → era Source #
A customizable type on per era basis for the information required to find all scripts needed for the transaction.
∷ PParams era | |
→ (Credential 'Staking → Maybe Coin) | Function that can lookup current delegation deposits |
→ (Credential 'DRepRole → Maybe Coin) | Function that can lookup current drep deposits |
→ UTxO era | |
→ TxBody era | |
→ Value era |
Calculate all the value that is being consumed by the transaction.
∷ PParams era | |
→ (KeyHash 'StakePool → Bool) | Check whether a pool with a supplied PoolStakeId is already registered. |
→ TxBody era | |
→ Value era |
∷ UTxO era | For some era it is necessary to look into the UTxO to find all of the available scripts for the transaction |
→ Tx era | |
→ ScriptsProvided era |
Initial eras will look into witness set to find all of the available scripts, but starting with Babbage we can look for available scripts in the UTxO using reference inputs.
getScriptsNeeded ∷ UTxO era → TxBody era → ScriptsNeeded era Source #
Produce all the information required for figuring out which scripts are required for the transaction to be valid, once those scripts are evaluated
getScriptsHashesNeeded ∷ ScriptsNeeded era → Set ScriptHash Source #
Extract the set of all script hashes that are needed for script validation.
getWitsVKeyNeeded ∷ CertState era → UTxO era → TxBody era → Set (KeyHash 'Witness) Source #
Extract all of the KeyHash witnesses that are required for validating the transaction
getMinFeeTxUtxo ∷ PParams era → Tx era → UTxO era → Coin Source #
Minimum fee computation, excluding witnesses and including ref scripts size
Instances
EraUTxO ShelleyEra Source # | |
Defined in Cardano.Ledger.Shelley.UTxO type ScriptsNeeded ShelleyEra = (r ∷ Type) Source # getConsumedValue ∷ PParams ShelleyEra → (Credential 'Staking → Maybe Coin) → (Credential 'DRepRole → Maybe Coin) → UTxO ShelleyEra → TxBody ShelleyEra → Value ShelleyEra Source # getProducedValue ∷ PParams ShelleyEra → (KeyHash 'StakePool → Bool) → TxBody ShelleyEra → Value ShelleyEra Source # getScriptsProvided ∷ UTxO ShelleyEra → Tx ShelleyEra → ScriptsProvided ShelleyEra Source # getScriptsNeeded ∷ UTxO ShelleyEra → TxBody ShelleyEra → ScriptsNeeded ShelleyEra Source # getScriptsHashesNeeded ∷ ScriptsNeeded ShelleyEra → Set ScriptHash Source # getWitsVKeyNeeded ∷ CertState ShelleyEra → UTxO ShelleyEra → TxBody ShelleyEra → Set (KeyHash 'Witness) Source # getMinFeeTxUtxo ∷ PParams ShelleyEra → Tx ShelleyEra → UTxO ShelleyEra → Coin Source # |
newtype ShelleyScriptsNeeded era Source #
Instances
Show (ShelleyScriptsNeeded era) Source # | |
Defined in Cardano.Ledger.Shelley.UTxO | |
Eq (ShelleyScriptsNeeded era) Source # | |
Defined in Cardano.Ledger.Shelley.UTxO (==) ∷ ShelleyScriptsNeeded era → ShelleyScriptsNeeded era → Bool Source # (/=) ∷ ShelleyScriptsNeeded era → ShelleyScriptsNeeded era → Bool Source # |
getShelleyScriptsNeeded ∷ EraTxBody era ⇒ UTxO era → TxBody era → ShelleyScriptsNeeded era Source #
getConsumedCoin ∷ EraTxBody era ⇒ PParams era → (Credential 'Staking → Maybe Coin) → UTxO era → TxBody era → Coin Source #
Compute the lovelace which are destroyed by the transaction. This implementation is suitable for Shelley and Allegra only.
consumed ∷ EraUTxO era ⇒ PParams era → CertState era → UTxO era → TxBody era → Value era Source #
For eras before Conway, VState is expected to have an empty Map for vsDReps, and so deposit summed up is zero.
produced ∷ EraUTxO era ⇒ PParams era → CertState era → TxBody era → Value era Source #
Compute the lovelace which are created by the transaction For eras before Conway, VState is expected to have an empty Map for vsDReps, and so deposit summed up is zero.
getShelleyWitsVKeyNeeded ∷ ∀ era. (EraTx era, ShelleyEraTxBody era) ⇒ CertState era → UTxO era → TxBody era → Set (KeyHash 'Witness) Source #
getShelleyWitsVKeyNeededNoGov ∷ ∀ era. EraTx era ⇒ UTxO era → TxBody era → Set (KeyHash 'Witness) Source #
Extract witnesses from UTxO and TxBody. Does not enforce witnesses for governance
related Keys, i.e. GenDelegs
module Cardano.Ledger.UTxO