ouroboros-consensus-mock-0.1.0.0: Mock ledger integration in the Ouroboros consensus layer
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Mock.Ledger.UTxO

Synopsis

Basic definitions

data Addr Source #

Mock address

Instances

Instances details
Eq Addr Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Address

Methods

(==)AddrAddrBool Source #

(/=)AddrAddrBool Source #

Ord Addr Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Address

Methods

compareAddrAddrOrdering Source #

(<)AddrAddrBool Source #

(<=)AddrAddrBool Source #

(>)AddrAddrBool Source #

(>=)AddrAddrBool Source #

maxAddrAddrAddr Source #

minAddrAddrAddr Source #

Show Addr Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Address

Methods

showsPrecIntAddrShowS Source #

showAddrString Source #

showList ∷ [Addr] → ShowS Source #

IsString Addr Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Address

Methods

fromStringStringAddr Source #

NFData Addr Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Address

Methods

rnfAddr → () Source #

Serialise Addr Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Address

Methods

encodeAddr → Encoding #

decode ∷ Decoder s Addr #

encodeList ∷ [Addr] → Encoding #

decodeList ∷ Decoder s [Addr] #

Condense Addr Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Address

Methods

condenseAddrString Source #

NoThunks Addr Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Address

Methods

noThunks ∷ Context → AddrIO (Maybe ThunkInfo) #

wNoThunks ∷ Context → AddrIO (Maybe ThunkInfo) #

showTypeOfProxy AddrString #

data Expiry Source #

Instances

Instances details
Eq Expiry Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

(==)ExpiryExpiryBool Source #

(/=)ExpiryExpiryBool Source #

Ord Expiry Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Show Expiry Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Generic Expiry Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Associated Types

type Rep ExpiryTypeType Source #

Methods

fromExpiryRep Expiry x Source #

toRep Expiry x → Expiry Source #

NFData Expiry Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

rnfExpiry → () Source #

Serialise Expiry Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

encodeExpiry → Encoding #

decode ∷ Decoder s Expiry #

encodeList ∷ [Expiry] → Encoding #

decodeList ∷ Decoder s [Expiry] #

Condense Expiry Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

condenseExpiryString Source #

NoThunks Expiry Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

noThunks ∷ Context → ExpiryIO (Maybe ThunkInfo) #

wNoThunks ∷ Context → ExpiryIO (Maybe ThunkInfo) #

showTypeOfProxy ExpiryString #

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-mock-0.1.0.0-inplace" '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
Eq Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

(==)TxTxBool Source #

(/=)TxTxBool Source #

Ord Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

compareTxTxOrdering Source #

(<)TxTxBool Source #

(<=)TxTxBool Source #

(>)TxTxBool Source #

(>=)TxTxBool Source #

maxTxTxTx Source #

minTxTxTx Source #

Show Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

showsPrecIntTxShowS Source #

showTxString Source #

showList ∷ [Tx] → ShowS Source #

Generic Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Associated Types

type Rep TxTypeType Source #

Methods

fromTxRep Tx x Source #

toRep Tx x → Tx Source #

NFData Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

rnfTx → () Source #

Serialise Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

encodeTx → Encoding #

decode ∷ Decoder s Tx #

encodeList ∷ [Tx] → Encoding #

decodeList ∷ Decoder s [Tx] #

Condense Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

condenseTxString Source #

NoThunks Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

noThunks ∷ Context → TxIO (Maybe ThunkInfo) #

wNoThunks ∷ Context → TxIO (Maybe ThunkInfo) #

showTypeOfProxy TxString #

ToCBOR Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

toCBORTx → Encoding

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy Tx → Size

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

HasMockTxs Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

getMockTxsTx → [Tx] Source #

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-mock-0.1.0.0-inplace" '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 TxId = Hash SHA256 Tx Source #

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 Tx Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

getMockTxsTx → [Tx] Source #

HasMockTxs SimpleBody Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Block

Methods

getMockTxsSimpleBody → [Tx] Source #

HasMockTxs a ⇒ HasMockTxs [a] Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

getMockTxs ∷ [a] → [Tx] Source #

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

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

getMockTxsChain a → [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 (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
Eq UtxoError Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Show UtxoError Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Generic UtxoError Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Associated Types

type Rep UtxoErrorTypeType Source #

Serialise UtxoError Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

encodeUtxoError → Encoding #

decode ∷ Decoder s UtxoError #

encodeList ∷ [UtxoError] → Encoding #

decodeList ∷ Decoder s [UtxoError] #

Condense UtxoError Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

NoThunks UtxoError Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.UTxO

Methods

noThunks ∷ Context → UtxoErrorIO (Maybe ThunkInfo) #

wNoThunks ∷ Context → UtxoErrorIO (Maybe ThunkInfo) #

showTypeOfProxy UtxoErrorString #

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-mock-0.1.0.0-inplace" '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