Skip to content

Commit

Permalink
Fixing 'node never uses non-trustable peers in clean state' test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
bolt12 committed May 3, 2024
1 parent 5593ac0 commit 6e5fbcd
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3311,6 +3311,10 @@ prop_governor_only_bootstrap_peers_in_clean_state env =
govHasOnlyBootstrapPeers =
selectGovState Governor.hasOnlyBootstrapPeers events

govTargets :: Signal PeerSelectionTargets
govTargets =
selectGovState Governor.targets events

isInCleanState :: Signal Bool
isInCleanState =
fmap (not . Set.null)
Expand All @@ -3333,9 +3337,11 @@ prop_governor_only_bootstrap_peers_in_clean_state env =
)

in signalProperty 20 show
(\(b, (kp, tp)) -> (b && Set.null (Set.difference kp tp)) || not b)
((,) <$> isInCleanState
<*> govKnownAndTrustedPeers
(\(b, (kp, tp), t) -> (b && (Set.null (Set.difference kp tp) || targetNumberOfKnownPeers t <= 0))
|| not b)
((,,) <$> isInCleanState
<*> govKnownAndTrustedPeers
<*> govTargets
)

-- | This test checks that if the node is not in a sensitive state it will not
Expand Down

0 comments on commit 6e5fbcd

Please sign in to comment.