fixing tests

This commit is contained in:
Manuel Araoz 2014-05-29 16:17:17 -03:00
commit 4cd90c45a2
4 changed files with 8 additions and 4 deletions

View file

@ -7,7 +7,7 @@ var HK = bitcore.HierarchicalKey;
var WalletKey = bitcore.WalletKey;
var networks = bitcore.networks;
var util = bitcore.util;
var PublicKeyRing = require('./PublicKeyRing');
var PublicKeyRing = require('./PublicKeyRing');
function PrivateKey(opts) {
opts = opts || {};
@ -62,6 +62,7 @@ PrivateKey.prototype._getHK = function(path) {
};
PrivateKey.prototype.get = function(index,isChange) {
console.log(PublicKeyRing);
var path = PublicKeyRing.FullBranch(index, isChange);
var pk = this.privateKeyCache[path];
if (!pk) {

View file

@ -5,6 +5,7 @@
var imports = require('soop').imports();
var bitcore = require('bitcore');
var HK = bitcore.HierarchicalKey;
var PrivateKey = require('./PrivateKey');
var Address = bitcore.Address;
var Script = bitcore.Script;
var coinUtil = bitcore.util;
@ -127,7 +128,8 @@ PublicKeyRing.prototype._checkKeys = function() {
};
PublicKeyRing.prototype._newExtendedPublicKey = function () {
return new HK(this.network.name)
return new PrivateKey({networkName: this.network.name})
.deriveBIP45Branch()
.extendedPublicKeyString();
};