From 70224d2f356c58f6a5a84c459cf4b23314917908 Mon Sep 17 00:00:00 2001 From: tmpolaczyk <44604217+tmpolaczyk@users.noreply.github.com> Date: Thu, 19 Dec 2024 18:01:59 +0100 Subject: [PATCH] Fix off-by-one in inclusion smoke test (#790) * Fix off-by-one in inclusion smoke test * Fix comment --- test/suites/smoke-test-dancelight/test-para-inclusion.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/suites/smoke-test-dancelight/test-para-inclusion.ts b/test/suites/smoke-test-dancelight/test-para-inclusion.ts index 140695f8f..fd9349168 100644 --- a/test/suites/smoke-test-dancelight/test-para-inclusion.ts +++ b/test/suites/smoke-test-dancelight/test-para-inclusion.ts @@ -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);