Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Test.Ouroboros.Network.LedgerPeers
Synopsis
- tests :: TestTree
- newtype ArbitraryPortNumber = ArbitraryPortNumber {
- getArbitraryPortNumber :: PortNumber
- newtype ArbitraryRelayAccessPoint = ArbitraryRelayAccessPoint {}
- data StakePool = StakePool {}
- newtype LedgerPools = LedgerPools {
- getLedgerPools :: [(PoolStake, NonEmpty RelayAccessPoint)]
- calculateRelativeStake :: [StakePool] -> [(PoolStake, NonEmpty RelayAccessPoint)]
- genLedgerPoolsFrom :: [RelayAccessPoint] -> Gen LedgerPools
- newtype ArbLedgerPeersKind = ArbLedgerPeersKind LedgerPeersKind
- prop_pick100 :: Word16 -> NonNegative Int -> ArbLedgerPeersKind -> MockRoots -> DelayAndTimeoutScripts -> Property
- prop_pick :: LedgerPools -> ArbLedgerPeersKind -> Word16 -> Word16 -> MockRoots -> Script DNSLookupDelay -> Property
- prop_accBigPoolStake :: LedgerPools -> Property
- data SimResult a
- = SimReturn a [String]
- | SimException SomeException [String]
- | SimDeadLock [String]
- evaluateTrace :: SimTrace a -> IO (SimResult a)
- data WithThreadAndTime a = WithThreadAndTime {
- wtatOccuredAt :: !Time
- wtatWithinThread :: !String
- wtatEvent :: !a
- verboseTracer :: forall a m. (MonadAsync m, MonadSay m, MonadMonotonicTime m, Show a) => Tracer m a
- threadAndTimeTracer :: forall a m. (MonadAsync m, MonadMonotonicTime m) => Tracer m (WithThreadAndTime a) -> Tracer m a
Documentation
newtype ArbitraryPortNumber Source #
Constructors
ArbitraryPortNumber | |
Fields
|
Instances
Arbitrary ArbitraryPortNumber Source # | |
Defined in Test.Ouroboros.Network.LedgerPeers |
newtype ArbitraryRelayAccessPoint Source #
Constructors
ArbitraryRelayAccessPoint | |
Instances
newtype LedgerPools Source #
Constructors
LedgerPools | |
Fields
|
Instances
Arbitrary LedgerPools Source # | |
Defined in Test.Ouroboros.Network.LedgerPeers | |
Show LedgerPools Source # | |
Defined in Test.Ouroboros.Network.LedgerPeers |
calculateRelativeStake :: [StakePool] -> [(PoolStake, NonEmpty RelayAccessPoint)] Source #
genLedgerPoolsFrom :: [RelayAccessPoint] -> Gen LedgerPools Source #
newtype ArbLedgerPeersKind Source #
Constructors
ArbLedgerPeersKind LedgerPeersKind |
Instances
Arbitrary ArbLedgerPeersKind Source # | |
Defined in Test.Ouroboros.Network.LedgerPeers | |
Show ArbLedgerPeersKind Source # | |
Defined in Test.Ouroboros.Network.LedgerPeers |
Arguments
:: Word16 | |
-> NonNegative Int | number of pools with 0 stake |
-> ArbLedgerPeersKind | |
-> MockRoots | |
-> DelayAndTimeoutScripts | |
-> Property |
A pool with 100% stake should always be picked.
prop_pick :: LedgerPools -> ArbLedgerPeersKind -> Word16 -> Word16 -> MockRoots -> Script DNSLookupDelay -> Property Source #
Verify that given at least one peer we manage to pick count
peers.
prop_accBigPoolStake :: LedgerPools -> Property Source #
Constructors
SimReturn a [String] | |
SimException SomeException [String] | |
SimDeadLock [String] |
evaluateTrace :: SimTrace a -> IO (SimResult a) Source #
data WithThreadAndTime a Source #
Constructors
WithThreadAndTime | |
Fields
|
Instances
Show a => Show (WithThreadAndTime a) Source # | |
Defined in Test.Ouroboros.Network.LedgerPeers |
verboseTracer :: forall a m. (MonadAsync m, MonadSay m, MonadMonotonicTime m, Show a) => Tracer m a Source #
threadAndTimeTracer :: forall a m. (MonadAsync m, MonadMonotonicTime m) => Tracer m (WithThreadAndTime a) -> Tracer m a Source #