Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Commit

Permalink
Merge pull request #159 from isocolsky/bump/bwu-1.0.0
Browse files Browse the repository at this point in the history
Bump/bwu 1.0.0
  • Loading branch information
matiu committed Oct 17, 2015
2 parents dda834a + 6463dae commit 377d033
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -1668,7 +1668,7 @@ API.prototype.addAccess = function(opts, cb) {
var requestPubKey = reqPrivKey.toPublicKey().toString();

var xPriv = new Bitcore.HDPrivateKey(this.credentials.xPrivKey)
.derive(WalletUtils.PATHS.BASE_ADDRESS_DERIVATION[this.credentials.derivationStrategy][this.credentials.network]);
.derive(WalletUtils.getBaseAddressDerivationPath(this.credentials.derivationStrategy, this.credentials.network, 0));
var sig = WalletUtils.signRequestPubKey(requestPubKey, xPriv);
var copayerId = this.credentials.copayerId;

Expand Down
2 changes: 1 addition & 1 deletion lib/credentials.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Credentials.prototype._expand = function() {
var xPrivKey = new Bitcore.HDPrivateKey.fromString(this.xPrivKey);

// this extra derivation is not to share a non hardened xPubKey to the server.
var addressDerivation = xPrivKey.derive(WalletUtils.PATHS.BASE_ADDRESS_DERIVATION[this.derivationStrategy][this.network]);
var addressDerivation = xPrivKey.derive(WalletUtils.getBaseAddressDerivationPath(this.derivationStrategy, this.network, 0));
this.xPubKey = (new Bitcore.HDPublicKey(addressDerivation)).toString();

var requestDerivation = xPrivKey.derive(WalletUtils.PATHS.REQUEST_KEY);
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "bitcore-wallet-client",
"description": "Client for bitcore-wallet-service",
"author": "BitPay Inc",
"version": "0.6.4",
"version": "1.0.0",
"license": "MIT",
"keywords": [
"bitcoin",
"copay",
Expand Down Expand Up @@ -36,7 +37,7 @@
"uglify": "^0.1.1"
},
"devDependencies": {
"bitcore-wallet-service": "0.2.3",
"bitcore-wallet-service": "~1.0.0",
"chai": "^1.9.1",
"coveralls": "^2.11.2",
"grunt-jsdoc": "^0.5.8",
Expand Down
7 changes: 3 additions & 4 deletions test/credentials.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ describe('Credentials', function() {
it('Should create credentials from mnemonic (ES)', function() {
var words = 'afirmar diseño hielo fideo etapa ogro cambio fideo toalla pomelo número buscar';
var c = Credentials.fromMnemonic(words);

c.xPrivKey.should.equal('xprv9s21ZrQH143K4WLsaPQZ5kPMo2WqLPsxcNerMhd291niJmkEHqBRBXKrJpBqcftEMpJWpfXN97aXPqxYJrKjLTxbcDEwXH9mRJM9EvGqVdR');
c.xPrivKey.should.equal('xprv9s21ZrQH143K3H3WtXCn9nHtpi7Fz1ZE9VJErWErhrGL4hV1cApFVo3t4aANoPF7ufcLLWqN168izu3xGQdLaGxXG2qYZF8wWQGNWnuSSon');
c.network.should.equal('livenet');
});

Expand All @@ -87,8 +86,8 @@ describe('Credentials', function() {
var c = Credentials.createWithMnemonic('testnet');
c.setPrivateKeyEncryption('hola');
c.unlock('hola');
var o = c.toObj();
var o = c.toObj();

var c2 = Credentials.fromObj(o);
c2.isPrivKeyEncrypted().should.equal(true);
should.not.exist(c2.xPrivKey);
Expand Down

0 comments on commit 377d033

Please sign in to comment.