|
@ -2280,6 +2280,58 @@ describe('Wallet service', function() { |
|
|
done(); |
|
|
done(); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it.only('should not perform 2 steps after 2 steps was just triggered', function(done) { |
|
|
|
|
|
var oldAddrs, newAddrs; |
|
|
|
|
|
Defaults.TWO_STEP_BALANCE_THRESHOLD = 5; |
|
|
|
|
|
|
|
|
|
|
|
async.series([ |
|
|
|
|
|
|
|
|
|
|
|
function(next) { |
|
|
|
|
|
helpers.createAddresses(server, wallet, 2, 0, function(addrs) { |
|
|
|
|
|
oldAddrs = addrs; |
|
|
|
|
|
next(); |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
function(next) { |
|
|
|
|
|
clock.tick(7 * Defaults.TWO_STEP_CREATION_HOURS * 3600 * 1000); |
|
|
|
|
|
helpers.createAddresses(server, wallet, 2, 0, function(addrs) { |
|
|
|
|
|
newAddrs = addrs; |
|
|
|
|
|
helpers.stubUtxos(server, wallet, [1, 2], { |
|
|
|
|
|
addresses: [oldAddrs[0], newAddrs[0]], |
|
|
|
|
|
}, function() { |
|
|
|
|
|
next(); |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
function(next) { |
|
|
|
|
|
server.getBalance({ |
|
|
|
|
|
twoStep: true |
|
|
|
|
|
}, function(err, balance) { |
|
|
|
|
|
should.not.exist(err); |
|
|
|
|
|
should.exist(balance); |
|
|
|
|
|
balance.totalAmount.should.equal(helpers.toSatoshi(3)); |
|
|
|
|
|
next(); |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
function(next) { |
|
|
|
|
|
setTimeout(next, 100); |
|
|
|
|
|
}, |
|
|
|
|
|
function(next) { |
|
|
|
|
|
server.getNotifications({}, function(err, notifications) { |
|
|
|
|
|
should.not.exist(err); |
|
|
|
|
|
var last = _.last(notifications); |
|
|
|
|
|
last.type.should.not.equal('BalanceUpdated'); |
|
|
|
|
|
next(); |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
], function(err) { |
|
|
|
|
|
should.not.exist(err); |
|
|
|
|
|
done(); |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
describe('#getFeeLevels', function() { |
|
|
describe('#getFeeLevels', function() { |
|
|