diff --git a/test/suites/integration/bsp/multiple-delete.test.ts b/test/suites/integration/bsp/multiple-delete.test.ts index 68f11d963..dff30e677 100644 --- a/test/suites/integration/bsp/multiple-delete.test.ts +++ b/test/suites/integration/bsp/multiple-delete.test.ts @@ -138,8 +138,16 @@ describeBspNet("Single BSP Volunteering", ({ before, createBspApi, it, createUse // Wait enough blocks for the deletion to be allowed. const currentBlock = await userApi.rpc.chain.getBlock(); const currentBlockNumber = currentBlock.block.header.number.toNumber(); - const cooldown = - currentBlockNumber + userApi.consts.fileSystem.minWaitForStopStoring.toNumber(); + const minWaitForStopStoring = ( + await userApi.query.parameters.parameters({ + RuntimeConfig: { + MinWaitForStopStoring: null + } + }) + ) + .unwrap() + .asRuntimeConfig.asMinWaitForStopStoring.toNumber(); + const cooldown = currentBlockNumber + minWaitForStopStoring; await userApi.block.skipTo(cooldown); for (let i = 0; i < fileKeys.length; i++) { @@ -281,8 +289,16 @@ describeBspNet("Single BSP Volunteering", ({ before, createBspApi, it, createUse // Wait enough blocks for the deletion to be allowed. const currentBlock = await userApi.rpc.chain.getBlock(); const currentBlockNumber = currentBlock.block.header.number.toNumber(); - const cooldown = - currentBlockNumber + userApi.consts.fileSystem.minWaitForStopStoring.toNumber(); + const minWaitForStopStoring = ( + await userApi.query.parameters.parameters({ + RuntimeConfig: { + MinWaitForStopStoring: null + } + }) + ) + .unwrap() + .asRuntimeConfig.asMinWaitForStopStoring.toNumber(); + const cooldown = currentBlockNumber + minWaitForStopStoring; await userApi.block.skipTo(cooldown); // Batching the delete confirmation should fail because of the wrong inclusionForestProof for extrinsinc 2 and 3 diff --git a/test/suites/integration/bsp/reorg-proof.test.ts b/test/suites/integration/bsp/reorg-proof.test.ts index dfaecde42..c0fbda235 100644 --- a/test/suites/integration/bsp/reorg-proof.test.ts +++ b/test/suites/integration/bsp/reorg-proof.test.ts @@ -353,7 +353,15 @@ describeBspNet( // Wait the required time for the BSP to be able to confirm the deletion. const currentBlock = await userApi.rpc.chain.getBlock(); const currentBlockNumber = currentBlock.block.header.number.toNumber(); - const minWaitForStopStoring = userApi.consts.fileSystem.minWaitForStopStoring.toNumber(); + const minWaitForStopStoring = ( + await userApi.query.parameters.parameters({ + RuntimeConfig: { + MinWaitForStopStoring: null + } + }) + ) + .unwrap() + .asRuntimeConfig.asMinWaitForStopStoring.toNumber(); const blockToAdvanceTo = currentBlockNumber + minWaitForStopStoring; await userApi.block.skipTo(blockToAdvanceTo, { watchForBspProofs: [userApi.shConsts.DUMMY_BSP_ID] diff --git a/test/suites/integration/bsp/storage-delete.test.ts b/test/suites/integration/bsp/storage-delete.test.ts index 15ba4dbd7..71b3a660f 100644 --- a/test/suites/integration/bsp/storage-delete.test.ts +++ b/test/suites/integration/bsp/storage-delete.test.ts @@ -109,8 +109,16 @@ describeBspNet( // Wait for the right moment to confirm stop storing const currentBlock = await userApi.rpc.chain.getBlock(); const currentBlockNumber = currentBlock.block.header.number.toNumber(); - const cooldown = - currentBlockNumber + userApi.consts.fileSystem.minWaitForStopStoring.toNumber(); + const minWaitForStopStoring = ( + await userApi.query.parameters.parameters({ + RuntimeConfig: { + MinWaitForStopStoring: null + } + }) + ) + .unwrap() + .asRuntimeConfig.asMinWaitForStopStoring.toNumber(); + const cooldown = currentBlockNumber + minWaitForStopStoring; // New storage request does not get fulfilled and therefore gets cleaned up and we enqueue a checkpoint challenge remove mutation // Which then the bsp responds to and has the file key get removed from the forest diff --git a/test/suites/integration/bsp/submit-proofs.test.ts b/test/suites/integration/bsp/submit-proofs.test.ts index 5434c94f0..2da8dcf5b 100644 --- a/test/suites/integration/bsp/submit-proofs.test.ts +++ b/test/suites/integration/bsp/submit-proofs.test.ts @@ -214,8 +214,16 @@ describeBspNet( // Wait enough blocks for the deletion to be allowed. const currentBlock = await userApi.rpc.chain.getBlock(); const currentBlockNumber = currentBlock.block.header.number.toNumber(); - const cooldown = - currentBlockNumber + bspThreeApi.consts.fileSystem.minWaitForStopStoring.toNumber(); + const minWaitForStopStoring = ( + await userApi.query.parameters.parameters({ + RuntimeConfig: { + MinWaitForStopStoring: null + } + }) + ) + .unwrap() + .asRuntimeConfig.asMinWaitForStopStoring.toNumber(); + const cooldown = currentBlockNumber + minWaitForStopStoring; await userApi.block.skipTo(cooldown); await userApi.wait.waitForAvailabilityToSendTx(bspThreeKey.address.toString()); @@ -280,9 +288,19 @@ describeBspNet( oneBspfileMetadata = fileMetadata; }); - it("Only one BSP confirms it", async () => { + it("Only one BSP confirms it and the MSP accepts it", async () => { + // Wait for the MSP acceptance of the file to be in the TX pool + await userApi.assert.extrinsicPresent({ + module: "fileSystem", + method: "mspRespondStorageRequestsMultipleBuckets", + checkTxPool: true, + timeout: 5000 + }); + + // Then wait for the BSP volunteer to be in the TX pool and seal the block await userApi.wait.bspVolunteer(1); + // Finally, wait for the BSP to confirm storing the file and seal the block const address = userApi.createType("Address", NODE_INFOS.bsp.AddressId); await userApi.wait.bspStored(1, address); }); @@ -317,18 +335,6 @@ describeBspNet( checkTxPool: true }); - await userApi.assert.extrinsicPresent({ - module: "fileSystem", - method: "mspRespondStorageRequestsMultipleBuckets", - checkTxPool: true - }); - - await userApi.assert.extrinsicPresent({ - module: "fileSystem", - method: "mspRespondStorageRequestsMultipleBuckets", - checkTxPool: true - }); - // Seal block and check that the transaction was successful. await userApi.block.seal();