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

Ouroboros.Consensus.Mock.Ledger.State

Synopsis

State of the mock ledger

data MockError blk Source #

Constructors

MockExpired !SlotNo !SlotNo

The transaction expired in the first SlotNo, and it failed to validate in the second SlotNo.

MockUtxoError UtxoError 
MockInvalidHash (ChainHash blk) (ChainHash blk) 

Instances

Instances details
StandardHash blk ⇒ Eq (MockError blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.State

Methods

(==)MockError blk → MockError blk → Bool Source #

(/=)MockError blk → MockError blk → Bool Source #

StandardHash blk ⇒ Show (MockError blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.State

Methods

showsPrecIntMockError blk → ShowS Source #

showMockError blk → String Source #

showList ∷ [MockError blk] → ShowS Source #

Generic (MockError blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.State

Associated Types

type Rep (MockError blk) ∷ TypeType Source #

Methods

fromMockError blk → Rep (MockError blk) x Source #

toRep (MockError blk) x → MockError blk Source #

Serialise (HeaderHash blk) ⇒ Serialise (MockError blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.State

Methods

encodeMockError blk → Encoding #

decode ∷ Decoder s (MockError blk) #

encodeList ∷ [MockError blk] → Encoding #

decodeList ∷ Decoder s [MockError blk] #

(StandardHash blk, Typeable blk) ⇒ NoThunks (MockError blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.State

Methods

noThunks ∷ Context → MockError blk → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → MockError blk → IO (Maybe ThunkInfo) #

showTypeOfProxy (MockError blk) → String #

SerialiseNodeToClient (MockBlock ext) (MockError (MockBlock ext)) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Node.Serialisation

Typeable blk ⇒ ShowProxy (MockError blk ∷ Type) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.State

Methods

showProxyProxy (MockError blk) → String Source #

type Rep (MockError blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.State

data MockState blk Source #

Constructors

MockState 

Fields

Instances

Instances details
StandardHash blk ⇒ Eq (MockState blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.State

Methods

(==)MockState blk → MockState blk → Bool Source #

(/=)MockState blk → MockState blk → Bool Source #

StandardHash blk ⇒ Show (MockState blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.State

Methods

showsPrecIntMockState blk → ShowS Source #

showMockState blk → String Source #

showList ∷ [MockState blk] → ShowS Source #

Generic (MockState blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.State

Associated Types

type Rep (MockState blk) ∷ TypeType Source #

Methods

fromMockState blk → Rep (MockState blk) x Source #

toRep (MockState blk) x → MockState blk Source #

Serialise (HeaderHash blk) ⇒ Serialise (MockState blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.State

Methods

encodeMockState blk → Encoding #

decode ∷ Decoder s (MockState blk) #

encodeList ∷ [MockState blk] → Encoding #

decodeList ∷ Decoder s [MockState blk] #

StandardHash blk ⇒ NoThunks (MockState blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.State

Methods

noThunks ∷ Context → MockState blk → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → MockState blk → IO (Maybe ThunkInfo) #

showTypeOfProxy (MockState blk) → String #

type Rep (MockState blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.State

type Rep (MockState blk) = D1 ('MetaData "MockState" "Ouroboros.Consensus.Mock.Ledger.State" "ouroboros-consensus-mock-0.1.0.0-inplace" 'False) (C1 ('MetaCons "MockState" 'PrefixI 'True) (S1 ('MetaSel ('Just "mockUtxo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Utxo) :*: (S1 ('MetaSel ('Just "mockConfirmed") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set TxId)) :*: S1 ('MetaSel ('Just "mockTip") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Point blk)))))

updateMockState ∷ (GetPrevHash blk, HasMockTxs blk) ⇒ blk → MockState blk → Except (MockError blk) (MockState blk) Source #

updateMockTipGetPrevHash blk ⇒ Header blk → MockState blk → Except (MockError blk) (MockState blk) Source #

updateMockUTxOHasMockTxs a ⇒ SlotNo → a → MockState blk → Except (MockError blk) (MockState blk) Source #

Genesis state