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)))
- scriptsNeeded ∷ ∀ era. EraTx era ⇒ UTxO era → Tx era → Set (ScriptHash (EraCrypto era))
- getShelleyScriptsNeeded ∷ EraTxBody era ⇒ UTxO era → TxBody era → ShelleyScriptsNeeded era
- scriptCred ∷ Credential kr c → Maybe (ScriptHash c)
- scriptStakeCred ∷ ShelleyEraTxCert era ⇒ TxCert era → Maybe (ScriptHash (EraCrypto 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
- txup ∷ (EraTx era, ShelleyEraTxBody era) ⇒ Tx era → Maybe (Update 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 # |
scriptsNeeded ∷ ∀ era. EraTx era ⇒ UTxO era → Tx era → Set (ScriptHash (EraCrypto era)) Source #
Deprecated: In favor of getScriptsNeeded
Computes the set of script hashes required to unlock the transaction inputs and the withdrawals.
getShelleyScriptsNeeded ∷ EraTxBody era ⇒ UTxO era → TxBody era → ShelleyScriptsNeeded era Source #
scriptCred ∷ Credential kr c → Maybe (ScriptHash c) Source #
Deprecated: In favor of credScriptHash
scriptStakeCred ∷ ShelleyEraTxCert era ⇒ TxCert era → Maybe (ScriptHash (EraCrypto era)) Source #
Deprecated: In favor of getScriptWitnessTxCert
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.
txup ∷ (EraTx era, ShelleyEraTxBody era) ⇒ Tx era → Maybe (Update era) Source #
Deprecated: In favor of updateTxBodyL
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