test: remove outdated regtest
This commit is contained in:
parent
afda35962b
commit
c8ba4eaa8f
@ -116,84 +116,6 @@ describe('Node Functionality', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
var invalidatedBlockHash;
|
|
||||||
|
|
||||||
it.skip('will handle a reorganization', function(done) {
|
|
||||||
|
|
||||||
var count;
|
|
||||||
var blockHash;
|
|
||||||
|
|
||||||
async.series([
|
|
||||||
function(next) {
|
|
||||||
client.getBlockCount(function(err, response) {
|
|
||||||
if (err) {
|
|
||||||
return next(err);
|
|
||||||
}
|
|
||||||
count = response.result;
|
|
||||||
next();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
function(next) {
|
|
||||||
client.getBlockHash(count, function(err, response) {
|
|
||||||
if (err) {
|
|
||||||
return next(err);
|
|
||||||
}
|
|
||||||
invalidatedBlockHash = response.result;
|
|
||||||
next();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
function(next) {
|
|
||||||
client.invalidateBlock(invalidatedBlockHash, next);
|
|
||||||
},
|
|
||||||
function(next) {
|
|
||||||
client.getBlockCount(function(err, response) {
|
|
||||||
if (err) {
|
|
||||||
return next(err);
|
|
||||||
}
|
|
||||||
response.result.should.equal(count - 1);
|
|
||||||
next();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
], function(err) {
|
|
||||||
if (err) {
|
|
||||||
throw err;
|
|
||||||
}
|
|
||||||
var blocksRemoved = 0;
|
|
||||||
var blocksAdded = 0;
|
|
||||||
|
|
||||||
var removeBlock = function() {
|
|
||||||
blocksRemoved++;
|
|
||||||
};
|
|
||||||
|
|
||||||
node.services.db.on('removeblock', removeBlock);
|
|
||||||
|
|
||||||
var addBlock = function() {
|
|
||||||
blocksAdded++;
|
|
||||||
if (blocksAdded === 2 && blocksRemoved === 1) {
|
|
||||||
node.services.db.removeListener('addblock', addBlock);
|
|
||||||
node.services.db.removeListener('removeblock', removeBlock);
|
|
||||||
done();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
node.services.db.on('addblock', addBlock);
|
|
||||||
|
|
||||||
// We need to add a transaction to the mempool so that the next block will
|
|
||||||
// have a different hash as the hash has been invalidated.
|
|
||||||
client.sendToAddress(testKey.toAddress(regtest).toString(), 10, function(err) {
|
|
||||||
if (err) {
|
|
||||||
throw err;
|
|
||||||
}
|
|
||||||
client.generate(2, function(err, response) {
|
|
||||||
if (err) {
|
|
||||||
throw err;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('Bus Functionality', function() {
|
describe('Bus Functionality', function() {
|
||||||
it('subscribes and unsubscribes to an event on the bus', function(done) {
|
it('subscribes and unsubscribes to an event on the bus', function(done) {
|
||||||
var bus = node.openBus();
|
var bus = node.openBus();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user