diff --git a/test/integration/slp.js b/test/integration/slp.js index 1741d96..69aacad 100644 --- a/test/integration/slp.js +++ b/test/integration/slp.js @@ -22,6 +22,11 @@ describe(`#SLP`, () => { // console.log(`bchjs.SLP.apiToken: ${bchjs.SLP.apiToken}`) // }) + beforeEach(async () => { + // Introduce a delay so that the BVT doesn't trip the rate limits. + await sleep(1000) + }) + describe("#util", () => { describe("#list", () => { it(`should get information on the Spice token`, async () => { @@ -454,3 +459,8 @@ describe(`#SLP`, () => { }) }) }) + +// Promise-based sleep function +function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)) +} diff --git a/test/integration/testnet/slp.js b/test/integration/testnet/slp.js index 014e1e7..bfbe8b7 100644 --- a/test/integration/testnet/slp.js +++ b/test/integration/testnet/slp.js @@ -23,6 +23,11 @@ util.inspect.defaultOptions = { } describe(`#SLP`, () => { + beforeEach(async () => { + // Introduce a delay so that the BVT doesn't trip the rate limits. + await sleep(1000) + }) + describe("#util", () => { it(`should get information on the Oasis token`, async () => { const tokenId = `a371e9934c7695d08a5eb7f31d3bceb4f3644860cc67520cda1e149423b9ec39`