test: enable worker pool for all tests.
This commit is contained in:
parent
413f26584d
commit
6f96e64f70
@ -10,6 +10,7 @@ const encoding = require('../lib/utils/encoding');
|
||||
const Coin = require('../lib/primitives/coin');
|
||||
const Script = require('../lib/script/script');
|
||||
const Chain = require('../lib/blockchain/chain');
|
||||
const WorkerPool = require('../lib/workers/workerpool');
|
||||
const Miner = require('../lib/mining/miner');
|
||||
const MTX = require('../lib/primitives/mtx');
|
||||
const MemWallet = require('./util/memwallet');
|
||||
@ -20,14 +21,20 @@ const opcodes = Script.opcodes;
|
||||
|
||||
const network = Network.get('regtest');
|
||||
|
||||
const workers = new WorkerPool({
|
||||
enabled: true
|
||||
});
|
||||
|
||||
const chain = new Chain({
|
||||
db: 'memory',
|
||||
network
|
||||
network,
|
||||
workers
|
||||
});
|
||||
|
||||
const miner = new Miner({
|
||||
chain,
|
||||
version: 4
|
||||
version: 4,
|
||||
workers
|
||||
});
|
||||
|
||||
const cpu = miner.cpu;
|
||||
|
||||
@ -20,6 +20,7 @@ const node = new FullNode({
|
||||
apiKey: 'foo',
|
||||
walletAuth: true,
|
||||
db: 'memory',
|
||||
workers: true,
|
||||
plugins: [require('../lib/wallet/plugin')]
|
||||
});
|
||||
|
||||
|
||||
@ -8,6 +8,7 @@ const encoding = require('../lib/utils/encoding');
|
||||
const random = require('../lib/crypto/random');
|
||||
const MempoolEntry = require('../lib/mempool/mempoolentry');
|
||||
const Mempool = require('../lib/mempool/mempool');
|
||||
const WorkerPool = require('../lib/workers/workerpool');
|
||||
const Chain = require('../lib/blockchain/chain');
|
||||
const MTX = require('../lib/primitives/mtx');
|
||||
const Coin = require('../lib/primitives/coin');
|
||||
@ -19,13 +20,19 @@ const Witness = require('../lib/script/witness');
|
||||
const MemWallet = require('./util/memwallet');
|
||||
const ALL = Script.hashType.ALL;
|
||||
|
||||
const workers = new WorkerPool({
|
||||
enabled: true
|
||||
});
|
||||
|
||||
const chain = new Chain({
|
||||
db: 'memory'
|
||||
db: 'memory',
|
||||
workers
|
||||
});
|
||||
|
||||
const mempool = new Mempool({
|
||||
chain,
|
||||
db: 'memory'
|
||||
db: 'memory',
|
||||
workers
|
||||
});
|
||||
|
||||
const wallet = new MemWallet();
|
||||
|
||||
@ -10,6 +10,7 @@ const encoding = require('../lib/utils/encoding');
|
||||
const digest = require('../lib/crypto/digest');
|
||||
const random = require('../lib/crypto/random');
|
||||
const WalletDB = require('../lib/wallet/walletdb');
|
||||
const WorkerPool = require('../lib/workers/workerpool');
|
||||
const Address = require('../lib/primitives/address');
|
||||
const MTX = require('../lib/primitives/mtx');
|
||||
const Coin = require('../lib/primitives/coin');
|
||||
@ -25,9 +26,14 @@ const KEY1 = 'xprv9s21ZrQH143K3Aj6xQBymM31Zb4BVc7wxqfUhMZrzewdDVCt'
|
||||
const KEY2 = 'xprv9s21ZrQH143K3mqiSThzPtWAabQ22Pjp3uSNnZ53A5bQ4udp'
|
||||
+ 'faKekc2m4AChLYH1XDzANhrSdxHYWUeTWjYJwFwWFyHkTMnMeAcW4JyRCZa';
|
||||
|
||||
const workers = new WorkerPool({
|
||||
enabled: true
|
||||
});
|
||||
|
||||
const wdb = new WalletDB({
|
||||
db: 'memory',
|
||||
verify: true
|
||||
verify: true,
|
||||
workers
|
||||
});
|
||||
|
||||
let currentWallet = null;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user