ouroboros-consensus-0.21.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ouroboros.Consensus.Mock.Ledger.UTxO

Synopsis

Basic definitions

data Addr Source #

Mock address

Instances

Instances details
IsString Addr Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Address

Methods

fromStringStringAddr #

Show Addr Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Address

Methods

showsPrecIntAddrShowS #

showAddrString #

showList ∷ [Addr] → ShowS #

FromCBOR Addr Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Address

ToCBOR Addr Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Address

Methods

toCBORAddrEncoding Source #

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

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

NFData Addr Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Address

Methods

rnfAddr → () #

Eq Addr Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Address

Methods

(==)AddrAddrBool #

(/=)AddrAddrBool #

Ord Addr Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Address

Methods

compareAddrAddrOrdering #

(<)AddrAddrBool #

(<=)AddrAddrBool #

(>)AddrAddrBool #

(>=)AddrAddrBool #

maxAddrAddrAddr #

minAddrAddrAddr #

NoThunks Addr Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Address

Condense Addr Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Address

Methods

condenseAddrString Source #

Serialise Addr Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Address

data Expiry Source #

Instances

Instances details
Generic Expiry Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Associated Types

type Rep ExpiryTypeType #

Methods

fromExpiryRep Expiry x #

toRep Expiry x → Expiry #

Show Expiry Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

showsPrecIntExpiryShowS #

showExpiryString #

showList ∷ [Expiry] → ShowS #

NFData Expiry Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

rnfExpiry → () #

Eq Expiry Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

(==)ExpiryExpiryBool #

(/=)ExpiryExpiryBool #

Ord Expiry Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

compareExpiryExpiryOrdering #

(<)ExpiryExpiryBool #

(<=)ExpiryExpiryBool #

(>)ExpiryExpiryBool #

(>=)ExpiryExpiryBool #

maxExpiryExpiryExpiry #

minExpiryExpiryExpiry #

NoThunks Expiry Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Condense Expiry Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

condenseExpiryString Source #

Serialise Expiry Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

type Rep Expiry Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

type Rep Expiry = D1 ('MetaData "Expiry" "Ouroboros.Consensus.Mock.Ledger.UTxO" "ouroboros-consensus-0.21.0.0-inplace-unstable-mock-block" 'False) (C1 ('MetaCons "DoNotExpire" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "ExpireAtOnsetOf" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNo)))

type Ix = Word Source #

data Tx where Source #

Bundled Patterns

pattern TxExpirySet TxIn → [TxOut] → Tx 

Instances

Instances details
Generic Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Associated Types

type Rep TxTypeType #

Methods

fromTxRep Tx x #

toRep Tx x → Tx #

Show Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

showsPrecIntTxShowS #

showTxString #

showList ∷ [Tx] → ShowS #

ToCBOR Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

toCBORTxEncoding Source #

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

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

NFData Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

rnfTx → () #

Eq Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

(==)TxTxBool #

(/=)TxTxBool #

Ord Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

compareTxTxOrdering #

(<)TxTxBool #

(<=)TxTxBool #

(>)TxTxBool #

(>=)TxTxBool #

maxTxTxTx #

minTxTxTx #

NoThunks Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Condense Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

condenseTxString Source #

HasMockTxs Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

getMockTxsTx → [Tx] Source #

Serialise Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

type Rep Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

type Rep Tx = D1 ('MetaData "Tx" "Ouroboros.Consensus.Mock.Ledger.UTxO" "ouroboros-consensus-0.21.0.0-inplace-unstable-mock-block" 'False) (C1 ('MetaCons "UnsafeTx" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Expiry) :*: (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set TxIn)) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TxOut]))))

type TxIn = (TxId, Ix) Source #

Computing UTxO

class HasMockTxs a where Source #

Methods

getMockTxs ∷ a → [Tx] Source #

The transactions in the order they are to be applied

Instances

Instances details
HasMockTxs SimpleBody Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Block

Methods

getMockTxsSimpleBody → [Tx] Source #

HasMockTxs Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

getMockTxsTx → [Tx] Source #

HasMockTxs (GenTx (SimpleBlock p c)) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Block

Methods

getMockTxsGenTx (SimpleBlock p c) → [Tx] Source #

HasMockTxs a ⇒ HasMockTxs (Chain a) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

getMockTxsChain a → [Tx] Source #

HasMockTxs a ⇒ HasMockTxs [a] Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

getMockTxs ∷ [a] → [Tx] Source #

HasMockTxs (SimpleBlock' c ext ext') Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Block

Methods

getMockTxsSimpleBlock' c ext ext' → [Tx] Source #

data UtxoError Source #

Constructors

MissingInput TxIn 
InputOutputMismatch 

Fields

Instances

Instances details
Generic UtxoError Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Associated Types

type Rep UtxoErrorTypeType #

Methods

fromUtxoErrorRep UtxoError x #

toRep UtxoError x → UtxoError #

Show UtxoError Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

showsPrecIntUtxoErrorShowS #

showUtxoErrorString #

showList ∷ [UtxoError] → ShowS #

Eq UtxoError Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

(==)UtxoErrorUtxoErrorBool #

(/=)UtxoErrorUtxoErrorBool #

NoThunks UtxoError Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Condense UtxoError Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Serialise UtxoError Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

type Rep UtxoError Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

type Rep UtxoError = D1 ('MetaData "UtxoError" "Ouroboros.Consensus.Mock.Ledger.UTxO" "ouroboros-consensus-0.21.0.0-inplace-unstable-mock-block" 'False) (C1 ('MetaCons "MissingInput" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TxIn)) :+: C1 ('MetaCons "InputOutputMismatch" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Amount) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Amount)))

confirmedHasMockTxs a ⇒ a → Set TxId Source #

confirmed stands for all the transaction hashes present in the given collection.

txInsHasMockTxs a ⇒ a → Set TxIn Source #

txOutsHasMockTxs a ⇒ a → Utxo Source #

updateUtxoHasMockTxs a ⇒ a → UtxoExcept UtxoError Utxo Source #

Update the Utxo with the transactions from the given a, by removing the inputs and adding the outputs.

Genesis

genesisTxAddrDistTx Source #

Transaction giving initial stake to the nodes