Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.Mock.Ledger.UTxO
Synopsis
- data Addr
- type Amount = Word
- data Expiry
- type Ix = Word
- data Tx where
- type TxId = Hash SHA256 Tx
- type TxIn = (TxId, Ix)
- type TxOut = (Addr, Amount)
- type Utxo = Map TxIn TxOut
- class HasMockTxs a where
- getMockTxs ∷ a → [Tx]
- data UtxoError
- confirmed ∷ HasMockTxs a ⇒ a → Set TxId
- txIns ∷ HasMockTxs a ⇒ a → Set TxIn
- txOuts ∷ HasMockTxs a ⇒ a → Utxo
- updateUtxo ∷ HasMockTxs a ⇒ a → Utxo → Except UtxoError Utxo
- genesisTx ∷ AddrDist → Tx
- genesisUtxo ∷ AddrDist → Utxo
Basic definitions
Mock address
Instances
FromCBOR Addr Source # | |
ToCBOR Addr Source # | |
NFData Addr Source # | |
Defined in Ouroboros.Consensus.Mock.Ledger.Address | |
IsString Addr Source # | |
Defined in Ouroboros.Consensus.Mock.Ledger.Address Methods fromString ∷ String → Addr # | |
Show Addr Source # | |
Eq Addr Source # | |
Ord Addr Source # | |
MemPack Addr Source # | |
NoThunks Addr Source # | |
Condense Addr Source # | |
Serialise Addr Source # | |
IndexedMemPack (LedgerState (SimpleBlock c ext) EmptyMK) TxOut Source # | |
Defined in Ouroboros.Consensus.Mock.Ledger.Block Methods indexedPackedByteCount ∷ LedgerState (SimpleBlock c ext) EmptyMK → TxOut → Int Source # indexedPackM ∷ LedgerState (SimpleBlock c ext) EmptyMK → TxOut → Pack s () Source # indexedUnpackM ∷ Buffer b ⇒ LedgerState (SimpleBlock c ext) EmptyMK → Unpack b TxOut Source # indexedTypeName ∷ LedgerState (SimpleBlock c ext) EmptyMK → String Source # |
Constructors
DoNotExpire | |
ExpireAtOnsetOf !SlotNo |
Instances
Instances
ToCBOR Tx Source # | |||||
NFData Tx Source # | |||||
Defined in Ouroboros.Consensus.Mock.Ledger.UTxO | |||||
Generic Tx Source # | |||||
Defined in Ouroboros.Consensus.Mock.Ledger.UTxO Associated Types
| |||||
Show Tx Source # | |||||
Eq Tx Source # | |||||
Ord Tx Source # | |||||
NoThunks Tx Source # | |||||
Condense Tx Source # | |||||
HasMockTxs Tx Source # | |||||
Defined in Ouroboros.Consensus.Mock.Ledger.UTxO Methods getMockTxs ∷ Tx → [Tx] Source # | |||||
Serialise Tx Source # | |||||
type Rep Tx Source # | |||||
Defined in Ouroboros.Consensus.Mock.Ledger.UTxO type Rep Tx = D1 ('MetaData "Tx" "Ouroboros.Consensus.Mock.Ledger.UTxO" "ouroboros-consensus-0.26.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])))) |
Computing UTxO
class HasMockTxs a where Source #
Instances
HasMockTxs SimpleBody Source # | |
Defined in Ouroboros.Consensus.Mock.Ledger.Block Methods getMockTxs ∷ SimpleBody → [Tx] Source # | |
HasMockTxs Tx Source # | |
Defined in Ouroboros.Consensus.Mock.Ledger.UTxO Methods getMockTxs ∷ Tx → [Tx] Source # | |
HasMockTxs (GenTx (SimpleBlock p c)) Source # | |
Defined in Ouroboros.Consensus.Mock.Ledger.Block Methods getMockTxs ∷ GenTx (SimpleBlock p c) → [Tx] Source # | |
HasMockTxs a ⇒ HasMockTxs (Chain a) Source # | |
Defined in Ouroboros.Consensus.Mock.Ledger.UTxO Methods getMockTxs ∷ Chain a → [Tx] Source # | |
HasMockTxs a ⇒ HasMockTxs [a] Source # | |
Defined in Ouroboros.Consensus.Mock.Ledger.UTxO Methods getMockTxs ∷ [a] → [Tx] Source # | |
HasMockTxs (SimpleBlock' c ext ext') Source # | |
Defined in Ouroboros.Consensus.Mock.Ledger.Block Methods getMockTxs ∷ SimpleBlock' c ext ext' → [Tx] Source # |
Constructors
MissingInput TxIn | |
InputOutputMismatch | |
Instances
Generic UtxoError Source # | |||||
Defined in Ouroboros.Consensus.Mock.Ledger.UTxO Associated Types
| |||||
Show UtxoError Source # | |||||
Eq UtxoError Source # | |||||
NoThunks UtxoError Source # | |||||
Condense UtxoError Source # | |||||
Serialise UtxoError Source # | |||||
type Rep UtxoError Source # | |||||
Defined in Ouroboros.Consensus.Mock.Ledger.UTxO type Rep UtxoError = D1 ('MetaData "UtxoError" "Ouroboros.Consensus.Mock.Ledger.UTxO" "ouroboros-consensus-0.26.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.
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
genesisUtxo ∷ AddrDist → Utxo Source #