Skip to content

Commit

Permalink
Fix off-by-one in inclusion smoke test (#790)
Browse files Browse the repository at this point in the history
* Fix off-by-one in inclusion smoke test

* Fix comment
  • Loading branch information
tmpolaczyk authored Dec 19, 2024
1 parent 49bcaf6 commit 70224d2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/suites/smoke-test-dancelight/test-para-inclusion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,12 @@ describeSuite({

const parentBlockNumber = blockNumberMap.get(relayParent);

// allowedAncestryLen = 1 means that parent + 1 == current
// with allowedAncestryLen = 2, parent + allowedAncestryLen >= current
// allowedAncestryLen = 0 means that we only allow building on top of the parent block
// allowedAncestryLen = 1 means that we allow 2 different parent blocks,
// so parent + 2 >= current
// In general, parent + allowedAncestryLen + 1 >= current
expect(
parentBlockNumber + allowedAncestryLen,
parentBlockNumber + allowedAncestryLen + 1,
`Block #${blockNum}: backed candidate for para id ${paraId} has too old relayParent: ${parentBlockNumber} vs current ${blockNum}`
).to.be.greaterThanOrEqual(blockNum);

Expand Down

0 comments on commit 70224d2

Please sign in to comment.