shelley-spec-ledger-0.1.0.0
Safe HaskellNone
LanguageHaskell98

Shelley.Spec.Ledger.UTxO

Description

This module defines the types and functions for a simple UTxO Ledger as specified in A Simplified Formal Specification of a UTxO Ledger.

Synopsis

Primitives

newtype UTxO era Source #

The unspent transaction outputs.

Constructors

UTxO 

Fields

Instances

Instances details
ShelleyBased era ⇒ Eq (UTxO era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.UTxO

Methods

(==)UTxO era → UTxO era → Bool #

(/=)UTxO era → UTxO era → Bool #

ShelleyBased era ⇒ Show (UTxO era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.UTxO

Methods

showsPrecIntUTxO era → ShowS #

showUTxO era → String #

showList ∷ [UTxO era] → ShowS #

Generic (UTxO era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.UTxO

Associated Types

type Rep (UTxO era) ∷ TypeType #

Methods

fromUTxO era → Rep (UTxO era) x #

toRep (UTxO era) x → UTxO era #

Era era ⇒ NFData (UTxO era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.UTxO

Methods

rnfUTxO era → () #

ShelleyBased era ⇒ ToCBOR (UTxO era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.UTxO

Methods

toCBORUTxO era → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (UTxO era) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [UTxO era] → Size Source #

ShelleyBased era ⇒ FromCBOR (UTxO era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.UTxO

Methods

fromCBORDecoder s (UTxO era) Source #

labelProxy (UTxO era) → Text Source #

Relation (UTxO era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.UTxO

Associated Types

type Domain (UTxO era) Source #

type Range (UTxO era) Source #

Methods

singletonDomain (UTxO era) → Range (UTxO era) → UTxO era Source #

domUTxO era → Set (Domain (UTxO era)) Source #

rangeUTxO era → Set (Range (UTxO era)) Source #

(◁)Set (Domain (UTxO era)) → UTxO era → UTxO era Source #

(<|)Set (Domain (UTxO era)) → UTxO era → UTxO era Source #

(⋪)Set (Domain (UTxO era)) → UTxO era → UTxO era Source #

(</|)Set (Domain (UTxO era)) → UTxO era → UTxO era Source #

(▷)UTxO era → Set (Range (UTxO era)) → UTxO era Source #

(|>)UTxO era → Set (Range (UTxO era)) → UTxO era Source #

(⋫)UTxO era → Set (Range (UTxO era)) → UTxO era Source #

(|/>)UTxO era → Set (Range (UTxO era)) → UTxO era Source #

(∪)UTxO era → UTxO era → UTxO era Source #

(⨃)UTxO era → UTxO era → UTxO era Source #

sizeIntegral n ⇒ UTxO era → n Source #

haskeyDomain (UTxO era) → UTxO era → Bool Source #

addpairDomain (UTxO era) → Range (UTxO era) → UTxO era → UTxO era Source #

removekeyDomain (UTxO era) → UTxO era → UTxO era Source #

NoThunks (UTxO era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.UTxO

Methods

noThunks ∷ Context → UTxO era → IO (Maybe ThunkInfo)

wNoThunks ∷ Context → UTxO era → IO (Maybe ThunkInfo)

showTypeOfProxy (UTxO era) → String

Embed (UTxO era) (Map (TxIn era) (TxOut era)) Source # 
Instance details

Defined in Shelley.Spec.Ledger.UTxO

Methods

toBaseUTxO era → Map (TxIn era) (TxOut era) Source #

fromBaseMap (TxIn era) (TxOut era) → UTxO era Source #

HasExp (UTxO era) (Map (TxIn era) (TxOut era)) Source # 
Instance details

Defined in Shelley.Spec.Ledger.UTxO

Methods

toExpUTxO era → Exp (Map (TxIn era) (TxOut era)) Source #

type Rep (UTxO era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.UTxO

type Rep (UTxO era) = D1 ('MetaData "UTxO" "Shelley.Spec.Ledger.UTxO" "shelley-spec-ledger-0.1.0.0-inplace" 'True) (C1 ('MetaCons "UTxO" 'PrefixI 'True) (S1 ('MetaSel ('Just "unUTxO") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map (TxIn era) (TxOut era)))))
type Range (UTxO era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.UTxO

type Range (UTxO era) = TxOut era
type Domain (UTxO era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.UTxO

type Domain (UTxO era) = TxIn era

Functions

txid ∷ ∀ era. TxBodyConstraints era ⇒ TxBody era → TxId era Source #

Compute the id of a transaction.

txinsHasField "inputs" (TxBody era) (Set (TxIn era)) ⇒ TxBody era → Set (TxIn era) Source #

Compute the UTxO inputs of a transaction.

txinLookupTxIn era → UTxO era → Maybe (TxOut era) Source #

Lookup a txin for a given UTxO collection

txouts ∷ (ShelleyBased era, HasField "outputs" (TxBody era) (StrictSeq (TxOut era))) ⇒ TxBody era → UTxO era Source #

Compute the transaction outputs of a transaction.

txup ∷ (ShelleyBased era, HasField "update" (TxBody era) (StrictMaybe (Update era))) ⇒ Tx era → Maybe (Update era) Source #

balanceShelleyBased era ⇒ UTxO era → Value era Source #

Determine the total balance contained in the UTxO.

totalDepositsPParams era → Map (KeyHash 'StakePool (Crypto era)) (PoolParams era) → [DCert era] → Coin Source #

Determine the total deposit amount needed. The block may (legitimately) contain multiple registration certificates for the same pool, where the first will be treated as a registration and any subsequent ones as re-registration. As such, we must only take a deposit for the first such registration.

Note that this is not an issue for key registrations since subsequent registration certificates would be invalid.

makeWitnessVKey ∷ ∀ era kr. (Era era, DSignable (Crypto era) (Hash (Crypto era) EraIndependentTxBody)) ⇒ Hash (Crypto era) EraIndependentTxBodyKeyPair kr (Crypto era) → WitVKey 'Witness era Source #

Create a witness for transaction

makeWitnessesVKey ∷ ∀ era kr. (Era era, DSignable (Crypto era) (Hash (Crypto era) EraIndependentTxBody)) ⇒ Hash (Crypto era) EraIndependentTxBody → [KeyPair kr (Crypto era)] → Set (WitVKey 'Witness era) Source #

Create witnesses for transaction

makeWitnessesFromScriptKeys ∷ (Era era, DSignable (Crypto era) (Hash (Crypto era) EraIndependentTxBody)) ⇒ Hash (Crypto era) EraIndependentTxBodyMap (KeyHash kr (Crypto era)) (KeyPair kr (Crypto era)) → Set (KeyHash kr (Crypto era)) → Set (WitVKey 'Witness era) Source #

From a list of key pairs and a set of key hashes required for a multi-sig scripts, return the set of required keys.

verifyWitVKey ∷ (Typeable kr, Era era, DSignable (Crypto era) (Hash (Crypto era) EraIndependentTxBody)) ⇒ Hash (Crypto era) EraIndependentTxBodyWitVKey kr era → Bool Source #

Verify a transaction body witness

getScriptHashAddr era → Maybe (ScriptHash era) Source #

Extract script hash from value address with script.

scriptsNeeded ∷ (ShelleyBased era, HasField "certs" (TxBody era) (StrictSeq (DCert era)), HasField "wdrls" (TxBody era) (Wdrl era), HasField "inputs" (TxBody era) (Set (TxIn era))) ⇒ UTxO era → Tx era → Set (ScriptHash era) Source #

Computes the set of script hashes required to unlock the transcation inputs and the withdrawals.

txinsScriptShelleyBased era ⇒ Set (TxIn era) → UTxO era → Set (TxIn era) Source #

Compute the subset of inputs of the set txInps for which each input is locked by a script in the UTxO u.