From 6e0eec6543c876c2de0d2e0c7272c6d940380b3c Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Wed, 11 Jul 2018 12:26:39 +1000 Subject: [PATCH] Add extra shuffling test --- src/state/state_transition.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/state/state_transition.rs b/src/state/state_transition.rs index c9b3529407..21cb54bfd6 100644 --- a/src/state/state_transition.rs +++ b/src/state/state_transition.rs @@ -87,7 +87,21 @@ mod tests { 10, None, Config::standard()); - assert_eq!(s, + assert_eq!(s, + vec!(0, 9, 7, 6, 4, 1, 8, 5, 2, 3), + "10 validator shuffle was not as expected"); + } + + #[test] + fn test_shuffling_with_gt_half_max_validators() { + let mut config = Config::standard(); + config.max_validators = 19; + let s = get_shuffling( + Sha256Digest::zero(), + 10, + None, + Config::standard()); + assert_eq!(s, vec!(0, 9, 7, 6, 4, 1, 8, 5, 2, 3), "10 validator shuffle was not as expected"); }