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

Test.Ouroboros.Network.LedgerPeers

Synopsis

Documentation

prop_ledgerPeerSnapshot_requests :: ArbStakeMapOverSource -> Property Source #

This test checks whether requesting ledger peers works as intended when snapshot data is available. For each request, peers must be returned from the right source - either the ledger or snapshot, depending on whether which source is fresher.

prop_pick100 Source #

A pool with 100% stake should always be picked.

prop_pick :: LedgerPools -> ArbLedgerPeersKind -> Word16 -> Word16 -> MockRoots -> Script DNSLookupDelay -> ArbitrarySlotNo -> ArbitraryLedgerStateJudgement -> Property Source #

Verify that given at least one peer we manage to pick count peers.

prop_recomputeRelativeStake :: LedgerPools -> Property Source #

This functions checks the following properties: 1. The accumulated relative stake adds up to unity 2. No pool relative stake can be less than 0 3. The relays aren't mangled 4. Running this function multiple times always produces the same result

prop_ledgerPeerSnapshotCBORV1 :: ArbitrarySlotNo -> LedgerPools -> Property Source #

Checks validity of LedgerPeerSnapshot CBOR encoding, and whether round trip cycle is the identity function

prop_ledgerPeerSnapshotJSONV1 :: ArbitrarySlotNo -> LedgerPools -> Property Source #

Tests if LedgerPeerSnapshot JSON round trip is the identity function

snapshotV1 :: ArbitrarySlotNo -> LedgerPools -> LedgerPeerSnapshot Source #

helper functions for ledgerpeersnapshot encoding tests

data WithThreadAndTime a Source #

Instances

Instances details
Show a => Show (WithThreadAndTime a) Source # 
Instance details

Defined in Test.Ouroboros.Network.LedgerPeers

verboseTracer :: forall a (m :: Type -> Type). (MonadAsync m, MonadSay m, MonadMonotonicTime m, Show a) => Tracer m a Source #