From 80e9ac5cb4c5163de205ce8acb6bc328c4edee6e Mon Sep 17 00:00:00 2001 From: hewison-chris Date: Thu, 17 Mar 2022 18:02:18 +0900 Subject: [PATCH] QuorumPreimage unit test: use auto enroll for validators If we use auto enroll then we do not need to manually enroll the outsiders for their second enrollment. --- source/agora/test/QuorumPreimage.d | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/source/agora/test/QuorumPreimage.d b/source/agora/test/QuorumPreimage.d index 1c3080a95cd..095a2bb485f 100644 --- a/source/agora/test/QuorumPreimage.d +++ b/source/agora/test/QuorumPreimage.d @@ -30,7 +30,6 @@ import core.thread; unittest { TestConf conf = { - recurring_enrollment : false, outsider_validators : 2, }; conf.node.network_discovery_interval = 2.seconds; @@ -104,7 +103,7 @@ unittest Height(GenesisValidatorCycle - 1)); // Now we enroll new validators and re-enroll the original validators - iota(validators).each!(idx => network.enroll(idx)); + iota(GenesisValidators, validators).each!(idx => network.enroll(idx)); // Generate the last block of cycle with Genesis validators network.generateBlocks(iota(GenesisValidators), @@ -155,20 +154,13 @@ unittest } // create 19 more blocks with all validators (1 short of end of 2nd cycle) - iota(Height(GenesisValidatorCycle + 1), Height(2 * GenesisValidatorCycle)) + iota(Height(GenesisValidatorCycle + 1), Height(2 * GenesisValidatorCycle + 1)) .each!((Height h) { network.sendTransaction(nodes.front); network.expectHeightAndPreImg(iota(validators), h, block20.header.enrollments); }); - // Re-enroll - iota(validators).each!(idx => network.enroll(iota(validators), idx)); - - // Generate the last block of cycle with all validators - network.generateBlocks(iota(validators), - Height(2 * GenesisValidatorCycle)); - // these changed compared to quorums_2 due to the new enrollments // which use a different preimage enum quorums_3 = [