Skip to content

Commit

Permalink
fix: ✅ Wait for new signed up BSP to catch up to chain tip
Browse files Browse the repository at this point in the history
  • Loading branch information
ffarall committed Dec 26, 2024
1 parent 6e4ce16 commit 7c27ccf
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions test/suites/integration/bsp/bsp-thresholds.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ describeBspNet(
bspStartingWeight: 800_000_000n
});
const bspThreeApi = await BspNetTestApi.create(`ws://127.0.0.1:${rpcPort}`);
await userApi.wait.bspCatchUpToChainTip(bspThreeApi);

// Wait for it to catch up to the top of the chain
await userApi.wait.bspCatchUpToChainTip(bspThreeApi);
Expand Down Expand Up @@ -303,11 +304,11 @@ describeBspNet(
);

// Advance to the tick where the new BSP can volunteer
if (
(await userApi.rpc.chain.getHeader()).number.toNumber() < highReputationBspVolunteerTick
) {
await userApi.block.skipTo(highReputationBspVolunteerTick);
}
const currentBlockNumber = (await userApi.rpc.chain.getHeader()).number.toNumber();
assert(
currentBlockNumber === highReputationBspVolunteerTick,
"BSP with high reputation should be able to volunteer immediately"
);

// Wait until the new BSP volunteers
await userApi.wait.bspVolunteer(1);
Expand Down

0 comments on commit 7c27ccf

Please sign in to comment.