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 (EraCrypto era) → Maybe Coin) → (Credential 'DRepRole (EraCrypto era) → Maybe Coin) → UTxO era → TxBody era → Value era
- getProducedValue ∷ PParams era → (KeyHash 'StakePool (EraCrypto era) → Bool) → TxBody era → Value era
- getScriptsProvided ∷ UTxO era → Tx era → ScriptsProvided era
- getScriptsNeeded ∷ UTxO era → TxBody era → ScriptsNeeded era
- getScriptsHashesNeeded ∷ ScriptsNeeded era → Set (ScriptHash (EraCrypto era))
- getWitsVKeyNeeded ∷ CertState era → UTxO era → TxBody era → Set (KeyHash 'Witness (EraCrypto era))
- getMinFeeTxUtxo ∷ PParams era → Tx era → UTxO era → Coin
- newtype ShelleyScriptsNeeded era = ShelleyScriptsNeeded (Set (ScriptHash (EraCrypto era)))
- getShelleyScriptsNeeded ∷ EraTxBody era ⇒ UTxO era → TxBody era → ShelleyScriptsNeeded era
- getConsumedCoin ∷ EraTxBody era ⇒ PParams era → (Credential 'Staking (EraCrypto era) → Maybe Coin) → UTxO era → TxBody era → Coin
- shelleyProducedValue ∷ EraTxBody era ⇒ PParams era → (KeyHash 'StakePool (EraCrypto era) → 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 (EraCrypto era))
- getShelleyWitsVKeyNeededNoGov ∷ ∀ era. EraTx era ⇒ UTxO era → TxBody era → Set (KeyHash 'Witness (EraCrypto era))
- 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 (EraCrypto era) → Maybe Coin) | Function that can lookup current delegation deposits |
→ (Credential 'DRepRole (EraCrypto era) → 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 (EraCrypto era) → 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 (EraCrypto era)) Source #
Extract the set of all script hashes that are needed for script validation.
getWitsVKeyNeeded ∷ CertState era → UTxO era → TxBody era → Set (KeyHash 'Witness (EraCrypto era)) 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
newtype ShelleyScriptsNeeded era Source #
ShelleyScriptsNeeded (Set (ScriptHash (EraCrypto era))) |
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 (EraCrypto era) → 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 (EraCrypto era)) Source #
getShelleyWitsVKeyNeededNoGov ∷ ∀ era. EraTx era ⇒ UTxO era → TxBody era → Set (KeyHash 'Witness (EraCrypto era)) Source #
Extract witnesses from UTxO and TxBody. Does not enforce witnesses for governance
related Keys, i.e. GenDelegs
module Cardano.Ledger.UTxO