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

Commit 01382b1

Browse files
authored
Merge pull request #25 from ethereumjs/update-dependencies
Update dependencies
2 parents cfe0f60 + 47a0001 commit 01382b1

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

hdkey.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ EthereumHDKey.fromExtendedKey = function (base58key) {
2222
}
2323

2424
EthereumHDKey.prototype.privateExtendedKey = function () {
25-
// FIXME: change this according to the outcome of https://github.com/cryptocoinjs/hdkey/issues/7
26-
if (!this._hdkey._privateKey) {
27-
throw new Error('Private key is not available')
25+
if (!this._hdkey.privateExtendedKey) {
26+
throw new Error('This is a public key only wallet')
2827
}
2928
return this._hdkey.privateExtendedKey
3029
}

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var Buffer = require('safe-buffer').Buffer
22
var ethUtil = require('ethereumjs-util')
33
var crypto = require('crypto')
44
var scryptsy = require('scrypt.js')
5-
var uuid = require('uuid')
5+
var uuidv4 = require('uuid/v4')
66
var bs58check = require('bs58check')
77

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

146146
return {
147147
version: 3,
148-
id: uuid.v4({ random: opts.uuid || crypto.randomBytes(16) }),
148+
id: uuidv4({ random: opts.uuid || crypto.randomBytes(16) }),
149149
address: this.getAddress().toString('hex'),
150150
crypto: {
151151
ciphertext: ciphertext.toString('hex'),

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,19 @@
2626
},
2727
"homepage": "https://github.com/ethereumjs/ethereumjs-wallet",
2828
"dependencies": {
29-
"aes-js": "^0.2.3",
30-
"bs58check": "^1.0.8",
31-
"ethereumjs-util": "^4.4.0",
32-
"hdkey": "^0.7.0",
29+
"aes-js": "^3.1.0",
30+
"bs58check": "^2.1.1",
31+
"ethereumjs-util": "^5.1.4",
32+
"hdkey": "^0.8.0",
3333
"safe-buffer": "^5.1.1",
3434
"scrypt.js": "^0.2.0",
35-
"utf8": "^2.1.1",
36-
"uuid": "^2.0.1"
35+
"utf8": "^3.0.0",
36+
"uuid": "^3.2.1"
3737
},
3838
"devDependencies": {
39-
"coveralls": "^2.11.4",
40-
"istanbul": "^0.4.1",
41-
"mocha": "^2.3.4",
39+
"coveralls": "^3.0.0",
40+
"istanbul": "^0.4.5",
41+
"mocha": "^5.0.0",
4242
"standard": "^10.0.0"
4343
},
4444
"standard": {

test/hdkey.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe('.fromExtendedKey()', function () {
3232
assert.equal(hdnode.publicExtendedKey(), 'xpub661MyMwAqRbcGout4B6s29b6gGQsowyoiF6UgXBEr7eFCWYfXuZDvRxP9zEh1Kwq3TLqDQMbkbaRpSnoC28oWvjLeshoQz1StZ9YHM1EpcJ')
3333
assert.throws(function () {
3434
hdnode.privateExtendedKey()
35-
}, /^Error: Private key is not available$/)
35+
}, /^Error: This is a public key only wallet$/)
3636
})
3737
it('should work with private', function () {
3838
var hdnode = HDKey.fromExtendedKey('xprv9s21ZrQH143K4KqQx9Zrf1eN8EaPQVFxM2Ast8mdHn7GKiDWzNEyNdduJhWXToy8MpkGcKjxeFWd8oBSvsz4PCYamxR7TX49pSpp3bmHVAY')

thirdparty.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,10 @@ Thirdparty.fromKryptoKit = function (entropy, password) {
203203
/* eslint-disable new-cap */
204204
var decipher = new aesjs.ModeOfOperation.ecb(aesKey)
205205
/* eslint-enable new-cap */
206+
/* decrypt returns an Uint8Array, perhaps there is a better way to concatenate */
206207
privKey = Buffer.concat([
207-
decipher.decrypt(encryptedSeed.slice(0, 16)),
208-
decipher.decrypt(encryptedSeed.slice(16, 32))
208+
Buffer.from(decipher.decrypt(encryptedSeed.slice(0, 16))),
209+
Buffer.from(decipher.decrypt(encryptedSeed.slice(16, 32)))
209210
])
210211

211212
if (checksum.length > 0) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy