Skip to content

Commit

Permalink
QuorumPreimage unit test: use auto enroll for validators
Browse files Browse the repository at this point in the history
If we use auto enroll then we do not need to manually enroll the
outsiders for their second enrollment.
  • Loading branch information
hewison-chris committed Mar 21, 2022
1 parent 8069a41 commit 80e9ac5
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions source/agora/test/QuorumPreimage.d
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import core.thread;
unittest
{
TestConf conf = {
recurring_enrollment : false,
outsider_validators : 2,
};
conf.node.network_discovery_interval = 2.seconds;
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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 = [
Expand Down

0 comments on commit 80e9ac5

Please sign in to comment.