|
|
@ -2657,7 +2657,7 @@ describe('Wallet service', function() { |
|
|
|
NotificationBroadcaster.removeAllListeners(); |
|
|
|
}); |
|
|
|
|
|
|
|
it('should start an asynchronous scan', function(done) { |
|
|
|
it.only('should start an asynchronous scan', function(done) { |
|
|
|
helpers.stubAddressActivity(['3K2VWMXheGZ4qG35DyGjA2dLeKfaSr534A']); |
|
|
|
var expectedPaths = [ |
|
|
|
'm/2147483647/0/0', |
|
|
@ -2669,22 +2669,30 @@ describe('Wallet service', function() { |
|
|
|
]; |
|
|
|
WalletService.onNotification(function(n) { |
|
|
|
if (n.type == 'ScanFinished') { |
|
|
|
should.not.exist(n.creatorId); |
|
|
|
server.storage.fetchAddresses(wallet.id, function(err, addresses) { |
|
|
|
should.exist(addresses); |
|
|
|
addresses.length.should.equal(expectedPaths.length); |
|
|
|
var paths = _.pluck(addresses, 'path'); |
|
|
|
_.difference(paths, expectedPaths).length.should.equal(0); |
|
|
|
server.createAddress({}, function(err, address) { |
|
|
|
should.not.exist(err); |
|
|
|
address.path.should.equal('m/2147483647/0/4'); |
|
|
|
done(); |
|
|
|
}); |
|
|
|
}) |
|
|
|
server.getWallet({}, function(err, wallet) { |
|
|
|
should.exist(wallet.scanStatus); |
|
|
|
wallet.scanStatus.should.equal('success'); |
|
|
|
should.not.exist(n.creatorId); |
|
|
|
server.storage.fetchAddresses(wallet.id, function(err, addresses) { |
|
|
|
should.exist(addresses); |
|
|
|
addresses.length.should.equal(expectedPaths.length); |
|
|
|
var paths = _.pluck(addresses, 'path'); |
|
|
|
_.difference(paths, expectedPaths).length.should.equal(0); |
|
|
|
server.createAddress({}, function(err, address) { |
|
|
|
should.not.exist(err); |
|
|
|
address.path.should.equal('m/2147483647/0/4'); |
|
|
|
done(); |
|
|
|
}); |
|
|
|
}) |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
server.startScan({}, function(err) { |
|
|
|
should.not.exist(err); |
|
|
|
server.getWallet({}, function(err, wallet) { |
|
|
|
should.exist(wallet.scanStatus); |
|
|
|
wallet.scanStatus.should.equal('running'); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
it('should start multiple asynchronous scans for different wallets', function(done) { |
|
|
|