Browse Source

fix broken tests

patch-2
Manuel Araoz 10 years ago
parent
commit
edda8ea723
  1. 2
      lib/hdprivatekey.js
  2. 3
      test/hdprivatekey.js

2
lib/hdprivatekey.js

@ -106,7 +106,6 @@ HDPrivateKey._getDerivationIndexes = function(path) {
}
var indexes = steps.slice(1).map(function(step) {
console.log(step);
var isHardened = step.slice(-1) === '\'';
if (isHardened) {
step = step.slice(0, -1);
@ -122,7 +121,6 @@ HDPrivateKey._getDerivationIndexes = function(path) {
return index;
});
console.log(indexes);
return _.any(indexes, isNaN) ? null : indexes;
};

3
test/hdprivatekey.js

@ -222,7 +222,6 @@ describe('HDPrivate key interface', function() {
'K',
'm/',
'm/12asd',
HDPrivateKey.MaxHardened,
'm/1/2//3'
];
@ -237,7 +236,7 @@ describe('HDPrivate key interface', function() {
var indexes;
indexes = HDPrivateKey._getDerivationIndexes('m/-1/12');
indexes.should.eql([-1, 12]);
expect(indexes).to.equal(null);
indexes = HDPrivateKey._getDerivationIndexes('m/0/12/12\'');
indexes.should.eql([0, 12, HDPrivateKey.Hardened + 12]);

Loading…
Cancel
Save