Skip to content

Commit c2f52ba

Browse files
authored
Merge pull request #4198 from ProvableHQ/test/fix-spurious-error
[Fix] Spurious error in block sync test
2 parents 1e09e8f + 6671dcf commit c2f52ba

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

node/sync/src/block_sync.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2122,7 +2122,10 @@ mod tests {
21222122
let rng = &mut TestRng::default();
21232123
let sync = sample_sync_at_height(0);
21242124

2125-
let locator_height = rng.random_range(0..50);
2125+
// Ensure the locator always includes at least one block,
2126+
// that is not the genesis block.
2127+
// Otherwise there are no block requests to construct.
2128+
let locator_height = rng.random_range(1..50);
21262129

21272130
// Add a peer.
21282131
let locators = sample_block_locators(locator_height);

0 commit comments

Comments
 (0)