ouroboros-consensus:unstable-mock-block
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Mock.Ledger.UTxO

Synopsis

Basic definitions

data Addr Source #

Mock address

Instances

Instances details
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

toCBOR ∷ Addr → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy Addr → Size 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

rnf ∷ Addr → () #

Eq Addr Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Address

Methods

(==) ∷ Addr → Addr → Bool #

(/=) ∷ Addr → Addr → Bool #

Ord Addr Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Address

Methods

compare ∷ Addr → Addr → Ordering #

(<) ∷ Addr → Addr → Bool #

(<=) ∷ Addr → Addr → Bool #

(>) ∷ Addr → Addr → Bool #

(>=) ∷ Addr → Addr → Bool #

max ∷ Addr → Addr → Addr #

min ∷ Addr → Addr → Addr #

IsString Addr Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Address

Methods

fromString ∷ String → Addr #

Show Addr Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Address

Methods

showsPrec ∷ Int → Addr → ShowS #

show ∷ Addr → String #

showList ∷ [Addr] → ShowS #

MemPack Addr Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Address

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

condense ∷ Addr → String Source #

Serialise Addr Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Address

IndexedMemPack LedgerState (SimpleBlock c ext) TxOut Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Block

data Expiry Source #

Instances

Instances details
NFData Expiry Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

rnf ∷ Expiry → () #

Eq Expiry Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

(==) ∷ Expiry → Expiry → Bool #

(/=) ∷ Expiry → Expiry → Bool #

Ord Expiry Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

compare ∷ Expiry → Expiry → Ordering #

(<) ∷ Expiry → Expiry → Bool #

(<=) ∷ Expiry → Expiry → Bool #

(>) ∷ Expiry → Expiry → Bool #

(>=) ∷ Expiry → Expiry → Bool #

max ∷ Expiry → Expiry → Expiry #

min ∷ Expiry → Expiry → Expiry #

Generic Expiry Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Associated Types

type Rep Expiry 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

type Rep Expiry = D1 ('MetaData "Expiry" "Ouroboros.Consensus.Mock.Ledger.UTxO" "ouroboros-consensus-4.0.0.0-inplace-unstable-mock-block" 'False) (C1 ('MetaCons "DoNotExpire" 'PrefixI 'False) (U1 ∷ Type → Type) :+: C1 ('MetaCons "ExpireAtOnsetOf" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNo)))

Methods

from ∷ Expiry → Rep Expiry x #

to ∷ Rep Expiry x → Expiry #

Show Expiry Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

showsPrec ∷ Int → Expiry → ShowS #

show ∷ Expiry → String #

showList ∷ [Expiry] → ShowS #

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

condense ∷ Expiry → String 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-4.0.0.0-inplace-unstable-mock-block" 'False) (C1 ('MetaCons "DoNotExpire" 'PrefixI 'False) (U1 ∷ Type → Type) :+: C1 ('MetaCons "ExpireAtOnsetOf" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNo)))

type Ix = Word Source #

data Tx where Source #

Bundled Patterns

pattern Tx ∷ Expiry → Set TxIn → [TxOut] → Tx 

Instances

Instances details
ToCBOR Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

toCBOR ∷ Tx → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy Tx → Size 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

rnf ∷ Tx → () #

Eq Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

(==) ∷ Tx → Tx → Bool #

(/=) ∷ Tx → Tx → Bool #

Ord Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

compare ∷ Tx → Tx → Ordering #

(<) ∷ Tx → Tx → Bool #

(<=) ∷ Tx → Tx → Bool #

(>) ∷ Tx → Tx → Bool #

(>=) ∷ Tx → Tx → Bool #

max ∷ Tx → Tx → Tx #

min ∷ Tx → Tx → Tx #

Generic Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Associated Types

type Rep Tx 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

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

Methods

from ∷ Tx → Rep Tx x #

to ∷ Rep Tx x → Tx #

Show Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

showsPrec ∷ Int → Tx → ShowS #

show ∷ Tx → String #

showList ∷ [Tx] → ShowS #

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

condense ∷ Tx → String Source #

HasMockTxs Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

getMockTxs ∷ Tx → [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-4.0.0.0-inplace-unstable-mock-block" 'False) (C1 ('MetaCons "UnsafeTx" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Expiry) :*: (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set TxIn)) :*: S1 ('MetaSel ('Nothing ∷ Maybe 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

getMockTxs ∷ SimpleBody → [Tx] Source #

HasMockTxs Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

getMockTxs ∷ Tx → [Tx] Source #

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

Defined in Ouroboros.Consensus.Mock.Ledger.Block

Methods

getMockTxs ∷ GenTx (SimpleBlock p c) → [Tx] Source #

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

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

getMockTxs ∷ Chain 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

getMockTxs ∷ SimpleBlock' c ext ext' → [Tx] Source #

data UtxoError Source #

Constructors

MissingInput TxIn 
InputOutputMismatch 

Fields

Instances

Instances details
Eq UtxoError Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

(==) ∷ UtxoError → UtxoError → Bool #

(/=) ∷ UtxoError → UtxoError → Bool #

Generic UtxoError Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Associated Types

type Rep UtxoError 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

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

Methods

from ∷ UtxoError → Rep UtxoError x #

to ∷ Rep UtxoError x → UtxoError #

Show UtxoError Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

showsPrec ∷ Int → UtxoError → ShowS #

show ∷ UtxoError → String #

showList ∷ [UtxoError] → ShowS #

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-4.0.0.0-inplace-unstable-mock-block" 'False) (C1 ('MetaCons "MissingInput" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TxIn)) :+: C1 ('MetaCons "InputOutputMismatch" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Amount) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Amount)))

confirmed ∷ HasMockTxs a ⇒ a → Set TxId Source #

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

txIns ∷ HasMockTxs a ⇒ a → Set TxIn Source #

txOuts ∷ HasMockTxs a ⇒ a → Utxo Source #

updateUtxo ∷ HasMockTxs a ⇒ a → Utxo → Except UtxoError Utxo Source #

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

Genesis

genesisTx ∷ AddrDist → Tx Source #

Transaction giving initial stake to the nodes