ouroboros-network:protocols-tests-lib
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Network.Protocol.LocalStateQuery.Test

Synopsis

Documentation

codec :: forall (m :: Type -> Type). MonadST m => Codec (LocalStateQuery Block (Point Block) Query) DeserialiseFailure (State :: LocalStateQuery Block (Point Block) Query -> Type) m ByteString Source #

newtype AnyMessageWithResult block point (query :: Type -> Type) result Source #

A newtype wrapper which captures type of response generated for all queries.

Note that this is not as general as the protocol allows, since the protocol admits different result for different queries.

Constructors

AnyMessageWithResult 

Fields

Instances

Instances details
(Arbitrary point, Arbitrary (query result), Arbitrary result) => Arbitrary (AnyMessageWithResult block point query result) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Test

Methods

arbitrary :: Gen (AnyMessageWithResult block point query result) #

shrink :: AnyMessageWithResult block point query result -> [AnyMessageWithResult block point query result] #

(ShowQuery query, Show point) => Show (AnyMessageWithResult block point query result) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Test

Methods

showsPrec :: Int -> AnyMessageWithResult block point query result -> ShowS #

show :: AnyMessageWithResult block point query result -> String #

showList :: [AnyMessageWithResult block point query result] -> ShowS #

data Query result where Source #

Constructors

GetTheLedgerState :: Query MockLedgerState

An arbitrary query that happens to be trivial to implement in this test

Instances

Instances details
ShowQuery Query Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Test

Methods

showResult :: Query result -> result -> String

Arbitrary (Query MockLedgerState) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Test

Show (Query result) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Test

Methods

showsPrec :: Int -> Query result -> ShowS #

show :: Query result -> String #

showList :: [Query result] -> ShowS #

Eq (AnyMessage (LocalStateQuery Block (Point Block) Query) (State :: LocalStateQuery Block (Point Block) Query -> Type)) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Test

Methods

(==) :: AnyMessage (LocalStateQuery Block (Point Block) Query) (State :: LocalStateQuery Block (Point Block) Query -> Type) -> AnyMessage (LocalStateQuery Block (Point Block) Query) (State :: LocalStateQuery Block (Point Block) Query -> Type) -> Bool #

(/=) :: AnyMessage (LocalStateQuery Block (Point Block) Query) (State :: LocalStateQuery Block (Point Block) Query -> Type) -> AnyMessage (LocalStateQuery Block (Point Block) Query) (State :: LocalStateQuery Block (Point Block) Query -> Type) -> Bool #

ShowProxy Query Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Test

newtype MockLedgerState Source #

Constructors

MockLedgerState (Target (Point Block)) 

Instances

Instances details
Arbitrary MockLedgerState Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Test

NFData MockLedgerState Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Test

Methods

rnf :: MockLedgerState -> () #

Generic MockLedgerState Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Test

Associated Types

type Rep MockLedgerState 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Test

type Rep MockLedgerState = D1 ('MetaData "MockLedgerState" "Ouroboros.Network.Protocol.LocalStateQuery.Test" "ouroboros-network-1.0.0.0-inplace-protocols-tests-lib" 'True) (C1 ('MetaCons "MockLedgerState" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Target (Point Block)))))
Show MockLedgerState Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Test

Eq MockLedgerState Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Test

Serialise MockLedgerState Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Test

Arbitrary (Query MockLedgerState) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Test

type Rep MockLedgerState Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Test

type Rep MockLedgerState = D1 ('MetaData "MockLedgerState" "Ouroboros.Network.Protocol.LocalStateQuery.Test" "ouroboros-network-1.0.0.0-inplace-protocols-tests-lib" 'True) (C1 ('MetaCons "MockLedgerState" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Target (Point Block)))))

Orphan instances

Arbitrary AcquireFailure Source # 
Instance details

Methods

arbitrary :: Gen AcquireFailure #

shrink :: AcquireFailure -> [AcquireFailure] #

Arbitrary point => Arbitrary (Target point) Source # 
Instance details

Methods

arbitrary :: Gen (Target point) #

shrink :: Target point -> [Target point] #

Serialise point => Serialise (Target point) Source # 
Instance details

Methods

encode :: Target point -> Encoding #

decode :: Decoder s (Target point) #

encodeList :: [Target point] -> Encoding #

decodeList :: Decoder s [Target point] #