Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
IsString Addr Source # | |
Defined in Ouroboros.Consensus.Mock.Ledger.Address fromString ∷ String → Addr # | |
Show Addr Source # | |
FromCBOR Addr Source # | |
ToCBOR Addr Source # | |
NFData Addr Source # | |
Defined in Ouroboros.Consensus.Mock.Ledger.Address | |
Eq Addr Source # | |
Ord Addr Source # | |
NoThunks Addr Source # | |
Condense Addr Source # | |
Serialise Addr Source # | |
Instances
Generic Expiry Source # | |
Show Expiry Source # | |
NFData Expiry Source # | |
Defined in Ouroboros.Consensus.Mock.Ledger.UTxO | |
Eq Expiry Source # | |
Ord Expiry Source # | |
NoThunks Expiry Source # | |
Condense Expiry Source # | |
Serialise Expiry Source # | |
type Rep Expiry Source # | |
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) (U1 ∷ Type → Type) :+: C1 ('MetaCons "ExpireAtOnsetOf" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNo))) |
Instances
Generic Tx Source # | |
Show Tx Source # | |
ToCBOR Tx Source # | |
NFData Tx Source # | |
Defined in Ouroboros.Consensus.Mock.Ledger.UTxO | |
Eq Tx Source # | |
Ord Tx Source # | |
NoThunks Tx Source # | |
Condense Tx Source # | |
HasMockTxs Tx Source # | |
Defined in Ouroboros.Consensus.Mock.Ledger.UTxO 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.21.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 #
getMockTxs ∷ a → [Tx] Source #
The transactions in the order they are to be applied
Instances
HasMockTxs SimpleBody Source # | |
Defined in Ouroboros.Consensus.Mock.Ledger.Block getMockTxs ∷ SimpleBody → [Tx] Source # | |
HasMockTxs Tx Source # | |
Defined in Ouroboros.Consensus.Mock.Ledger.UTxO getMockTxs ∷ Tx → [Tx] Source # | |
HasMockTxs (GenTx (SimpleBlock p c)) Source # | |
Defined in Ouroboros.Consensus.Mock.Ledger.Block getMockTxs ∷ GenTx (SimpleBlock p c) → [Tx] Source # | |
HasMockTxs a ⇒ HasMockTxs (Chain a) Source # | |
Defined in Ouroboros.Consensus.Mock.Ledger.UTxO getMockTxs ∷ Chain a → [Tx] Source # | |
HasMockTxs a ⇒ HasMockTxs [a] Source # | |
Defined in Ouroboros.Consensus.Mock.Ledger.UTxO getMockTxs ∷ [a] → [Tx] Source # | |
HasMockTxs (SimpleBlock' c ext ext') Source # | |
Defined in Ouroboros.Consensus.Mock.Ledger.Block getMockTxs ∷ SimpleBlock' c ext ext' → [Tx] Source # |
Instances
Generic UtxoError Source # | |
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.21.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 #