Skip to content

Commit

Permalink
QuorumPreimage unit test: Do not use GenerateBlocks
Browse files Browse the repository at this point in the history
For blocks 21 -> 39 it is better to send the tx to one client and check
for the height in the test code as there are outsider validators. In the
`generateBlocks` function it checks that the txs are gossiped to all the
validators before setting the time for the next block. But as the
outsiders were not enrolled until block 20 the client may gossip
the tx before it has updated the peers it sends to. Normally this does
not matter because once an envelope is recieved by the newly enrolled
node it will try to fetch it.
  • Loading branch information
hewison-chris committed Mar 21, 2022
1 parent 576327a commit 8069a41
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions source/agora/test/QuorumPreimage.d
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,12 @@ unittest
}

// create 19 more blocks with all validators (1 short of end of 2nd cycle)
network.generateBlocks(iota(validators),
Height((2 * GenesisValidatorCycle) - 1));
iota(Height(GenesisValidatorCycle + 1), Height(2 * GenesisValidatorCycle))
.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));
Expand Down

0 comments on commit 8069a41

Please sign in to comment.