|
|
@ -1667,6 +1667,32 @@ describe('Wallet service', function() { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
it.only('should fail to create more consecutive addresses with no activity than allowed', function(done) { |
|
|
|
var MAX_MAIN_ADDRESS_GAP_old = WalletService.MAX_MAIN_ADDRESS_GAP; |
|
|
|
var n = WalletService.MAX_MAIN_ADDRESS_GAP = 2; |
|
|
|
helpers.stubAddressActivity([]); |
|
|
|
async.map(_.range(n), function(i, next) { |
|
|
|
server.createAddress({}, next); |
|
|
|
}, function(err, addresses) { |
|
|
|
addresses.length.should.equal(n); |
|
|
|
|
|
|
|
server.createAddress({}, function(err, address) { |
|
|
|
should.exist(err); |
|
|
|
should.not.exist(address); |
|
|
|
err.code.should.equal('MAIN_ADDRESS_GAP_REACHED'); |
|
|
|
server.createAddress({ |
|
|
|
ignoreMaxGap: true |
|
|
|
}, function(err, address) { |
|
|
|
should.not.exist(err); |
|
|
|
should.exist(address); |
|
|
|
address.path.should.equal('m/0/' + n); |
|
|
|
WalletService.MAX_MAIN_ADDRESS_GAP = MAX_MAIN_ADDRESS_GAP_old; |
|
|
|
done(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
describe('1-of-1 (BIP44 & P2PKH)', function() { |
|
|
|