diff --git a/test/util/regtest.js b/test/util/regtest.js index 232543591..b2ac7a9b6 100644 --- a/test/util/regtest.js +++ b/test/util/regtest.js @@ -97,8 +97,8 @@ async function initWallet(wclient) { return wallet; } -async function generateBlock(nclient, coinbase) { - return await nclient.execute('generatetoaddress', [1, coinbase]); +async function generateBlocks(count, nclient, coinbase) { + return await nclient.execute('generatetoaddress', [count, coinbase]); } async function generateTxs(options) { @@ -130,7 +130,7 @@ async function generateInitialBlocks(options) { let blocktime = genesisTime + c * blockInterval; await nclient.execute('setmocktime', [blocktime]); - const blockhashes = await generateBlock(nclient, coinbase); + const blockhashes = await generateBlocks(1, nclient, coinbase); const block = await nclient.execute('getblock', [blockhashes[0]]); assert(block.time <= blocktime + 1); @@ -152,7 +152,7 @@ async function generateInitialBlocks(options) { if (wclient && c > 110) await generateTxs({wclient: wclient, count: 50}); - const blockhashes = await generateBlock(nclient, coinbase); + const blockhashes = await generateBlocks(1, nclient, coinbase); const block = await nclient.execute('getblock', [blockhashes[0]]); assert(block.time <= blocktime + 1); @@ -166,6 +166,6 @@ module.exports = { initNodeClient, initWalletClient, initWallet, - generateBlock, + generateBlocks, generateInitialBlocks } diff --git a/test/wallet-pagination-test.js b/test/wallet-pagination-test.js index 58a553be0..581a10376 100644 --- a/test/wallet-pagination-test.js +++ b/test/wallet-pagination-test.js @@ -14,7 +14,6 @@ const { initNodeClient, initWalletClient, initWallet, - generateBlock, generateInitialBlocks } = require('./util/regtest'); diff --git a/test/wallet-time-test.js b/test/wallet-time-test.js index 93dd97ffb..5b9033634 100644 --- a/test/wallet-time-test.js +++ b/test/wallet-time-test.js @@ -14,7 +14,6 @@ const { initNodeClient, initWalletClient, initWallet, - generateBlock, generateInitialBlocks } = require('./util/regtest');