Skip to content

Commit

Permalink
test: restore count to generateBlocks regtest util
Browse files Browse the repository at this point in the history
  • Loading branch information
braydonf committed Jun 27, 2019
1 parent b5a9074 commit 4f96017
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
10 changes: 5 additions & 5 deletions test/util/regtest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -166,6 +166,6 @@ module.exports = {
initNodeClient,
initWalletClient,
initWallet,
generateBlock,
generateBlocks,
generateInitialBlocks
}
1 change: 0 additions & 1 deletion test/wallet-pagination-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const {
initNodeClient,
initWalletClient,
initWallet,
generateBlock,
generateInitialBlocks
} = require('./util/regtest');

Expand Down
1 change: 0 additions & 1 deletion test/wallet-time-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const {
initNodeClient,
initWalletClient,
initWallet,
generateBlock,
generateInitialBlocks
} = require('./util/regtest');

Expand Down

0 comments on commit 4f96017

Please sign in to comment.