Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

Commit

Permalink
Merge pull request #25 from ethereumjs/update-dependencies
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
axic authored Feb 9, 2018
2 parents cfe0f60 + 47a0001 commit 01382b1
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
5 changes: 2 additions & 3 deletions hdkey.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ EthereumHDKey.fromExtendedKey = function (base58key) {
}

EthereumHDKey.prototype.privateExtendedKey = function () {
// FIXME: change this according to the outcome of https://github.com/cryptocoinjs/hdkey/issues/7
if (!this._hdkey._privateKey) {
throw new Error('Private key is not available')
if (!this._hdkey.privateExtendedKey) {
throw new Error('This is a public key only wallet')
}
return this._hdkey.privateExtendedKey
}
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var Buffer = require('safe-buffer').Buffer
var ethUtil = require('ethereumjs-util')
var crypto = require('crypto')
var scryptsy = require('scrypt.js')
var uuid = require('uuid')
var uuidv4 = require('uuid/v4')
var bs58check = require('bs58check')

function assert (val, msg) {
Expand Down Expand Up @@ -145,7 +145,7 @@ Wallet.prototype.toV3 = function (password, opts) {

return {
version: 3,
id: uuid.v4({ random: opts.uuid || crypto.randomBytes(16) }),
id: uuidv4({ random: opts.uuid || crypto.randomBytes(16) }),
address: this.getAddress().toString('hex'),
crypto: {
ciphertext: ciphertext.toString('hex'),
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@
},
"homepage": "https://github.com/ethereumjs/ethereumjs-wallet",
"dependencies": {
"aes-js": "^0.2.3",
"bs58check": "^1.0.8",
"ethereumjs-util": "^4.4.0",
"hdkey": "^0.7.0",
"aes-js": "^3.1.0",
"bs58check": "^2.1.1",
"ethereumjs-util": "^5.1.4",
"hdkey": "^0.8.0",
"safe-buffer": "^5.1.1",
"scrypt.js": "^0.2.0",
"utf8": "^2.1.1",
"uuid": "^2.0.1"
"utf8": "^3.0.0",
"uuid": "^3.2.1"
},
"devDependencies": {
"coveralls": "^2.11.4",
"istanbul": "^0.4.1",
"mocha": "^2.3.4",
"coveralls": "^3.0.0",
"istanbul": "^0.4.5",
"mocha": "^5.0.0",
"standard": "^10.0.0"
},
"standard": {
Expand Down
2 changes: 1 addition & 1 deletion test/hdkey.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('.fromExtendedKey()', function () {
assert.equal(hdnode.publicExtendedKey(), 'xpub661MyMwAqRbcGout4B6s29b6gGQsowyoiF6UgXBEr7eFCWYfXuZDvRxP9zEh1Kwq3TLqDQMbkbaRpSnoC28oWvjLeshoQz1StZ9YHM1EpcJ')
assert.throws(function () {
hdnode.privateExtendedKey()
}, /^Error: Private key is not available$/)
}, /^Error: This is a public key only wallet$/)
})
it('should work with private', function () {
var hdnode = HDKey.fromExtendedKey('xprv9s21ZrQH143K4KqQx9Zrf1eN8EaPQVFxM2Ast8mdHn7GKiDWzNEyNdduJhWXToy8MpkGcKjxeFWd8oBSvsz4PCYamxR7TX49pSpp3bmHVAY')
Expand Down
5 changes: 3 additions & 2 deletions thirdparty.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,10 @@ Thirdparty.fromKryptoKit = function (entropy, password) {
/* eslint-disable new-cap */
var decipher = new aesjs.ModeOfOperation.ecb(aesKey)
/* eslint-enable new-cap */
/* decrypt returns an Uint8Array, perhaps there is a better way to concatenate */
privKey = Buffer.concat([
decipher.decrypt(encryptedSeed.slice(0, 16)),
decipher.decrypt(encryptedSeed.slice(16, 32))
Buffer.from(decipher.decrypt(encryptedSeed.slice(0, 16))),
Buffer.from(decipher.decrypt(encryptedSeed.slice(16, 32)))
])

if (checksum.length > 0) {
Expand Down

0 comments on commit 01382b1

Please sign in to comment.