ouroboros-consensus-0.21.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ouroboros.Consensus.Mock.Ledger.State

Synopsis

Config for the mock ledger

data MockConfig Source #

Parameters needed to validate blocks/txs

Constructors

MockConfig 

Instances

Instances details
Generic MockConfig Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.State

Associated Types

type Rep MockConfigTypeType #

Show MockConfig Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.State

Eq MockConfig Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.State

Methods

(==)MockConfigMockConfigBool #

(/=)MockConfigMockConfigBool #

NoThunks MockConfig Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.State

type Rep MockConfig Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.State

type Rep MockConfig = D1 ('MetaData "MockConfig" "Ouroboros.Consensus.Mock.Ledger.State" "ouroboros-consensus-0.21.0.0-inplace-unstable-mock-block" 'False) (C1 ('MetaCons "MockConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "mockCfgMaxTxSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe ByteSize32))))

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) 
MockTxSizeTooBig ByteSize32 ByteSize32 

Instances

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

Defined in Ouroboros.Consensus.Mock.Ledger.State

Methods

showProxyProxy (MockError blk) → String Source #

Generic (MockError blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.State

Associated Types

type Rep (MockError blk) ∷ TypeType #

Methods

fromMockError blk → Rep (MockError blk) x #

toRep (MockError blk) x → MockError blk #

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

Defined in Ouroboros.Consensus.Mock.Ledger.State

Methods

showsPrecIntMockError blk → ShowS #

showMockError blk → String #

showList ∷ [MockError blk] → ShowS #

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

Defined in Ouroboros.Consensus.Mock.Ledger.State

Methods

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

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

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

Defined in Ouroboros.Consensus.Mock.Ledger.State

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

Defined in Ouroboros.Consensus.Mock.Ledger.State

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

Defined in Ouroboros.Consensus.Mock.Node.Serialisation

type Rep (MockError blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.State

data MockState blk Source #

Constructors

MockState 

Fields

Instances

Instances details
Generic (MockState blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.State

Associated Types

type Rep (MockState blk) ∷ TypeType #

Methods

fromMockState blk → Rep (MockState blk) x #

toRep (MockState blk) x → MockState blk #

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

Defined in Ouroboros.Consensus.Mock.Ledger.State

Methods

showsPrecIntMockState blk → ShowS #

showMockState blk → String #

showList ∷ [MockState blk] → ShowS #

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

Defined in Ouroboros.Consensus.Mock.Ledger.State

Methods

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

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

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

Defined in Ouroboros.Consensus.Mock.Ledger.State

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

Defined in Ouroboros.Consensus.Mock.Ledger.State

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-0.21.0.0-inplace-unstable-mock-block" '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) ⇒ MockConfig → blk → MockState blk → Except (MockError blk) (MockState blk) Source #

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

Supporting definitions

Genesis state