From fdf8791c1c995edb6e5825828720727b5adc50bb Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Tue, 15 May 2018 11:33:19 -0400 Subject: [PATCH] fix mnemonic accounts --- lib/core/provider.js | 3 +-- package-lock.json | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/lib/core/provider.js b/lib/core/provider.js index 824d812b..7a8d349d 100644 --- a/lib/core/provider.js +++ b/lib/core/provider.js @@ -85,9 +85,8 @@ class Provider { const accounts = []; for (let i = addressIndex; i < addressIndex + numAddresses; i++) { const wallet = hdwallet.derivePath(wallet_hdpath + i).getWallet(); - accounts.push(this.web3.eth.accounts.privateKeyToAccount(wallet.getPrivateKey())); + accounts.push(this.web3.eth.accounts.privateKeyToAccount('0x' + wallet.getPrivateKey().toString('hex'))); } - return accounts; } this.logger.warn('Unsupported account configuration: ' + JSON.stringify(accountConfig)); diff --git a/package-lock.json b/package-lock.json index e5078791..67df1eb6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-5.0.2.tgz", "integrity": "sha512-Q3FWsbdmkQd1ib11A4XNWQvRD//5KpPoGawA8aB2DR7pWKoW9XQv3+dGxD/Z1eVFze23Okdo27ZQytVFlweKvQ==", "requires": { - "@types/node": "10.0.6" + "@types/node": "10.0.9" } }, "@types/lockfile": { @@ -32,16 +32,16 @@ "integrity": "sha512-pD6JuijPmrfi84qF3/TzGQ7zi0QIX+d7ZdetD6jUA6cp+IsCzAquXZfi5viesew+pfpOTIdAVKuh1SHA7KeKzg==" }, "@types/node": { - "version": "10.0.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.0.6.tgz", - "integrity": "sha512-2whhQUfDHRBiZ3L54Ulyl1X+fZWbWabxPYRDAsibgOAtE6adwusD15Xv0Bw/D7cPah35Z/wKTdW3iAKsevw1uw==" + "version": "10.0.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.0.9.tgz", + "integrity": "sha512-ekJ3mXJcJP+Nn5kC6eCmWPND/fHx/Ga12Lz0IJgTfGz1ge7OCIR5xcDY5tcYgnyM1kWsVDRH2bguxkGcNj39AQ==" }, "@types/node-fetch": { "version": "1.6.9", "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-1.6.9.tgz", "integrity": "sha512-n2r6WLoY7+uuPT7pnEtKJCmPUGyJ+cbyBR8Avnu4+m1nzz7DwBVuyIvvlBzCZ/nrpC7rIgb3D6pNavL7rFEa9g==", "requires": { - "@types/node": "10.0.6" + "@types/node": "10.0.9" } }, "@types/semver": { @@ -54,7 +54,7 @@ "resolved": "https://registry.npmjs.org/@types/tar/-/tar-4.0.0.tgz", "integrity": "sha512-YybbEHNngcHlIWVCYsoj7Oo1JU9JqONuAlt1LlTH/lmL8BMhbzdFUgReY87a05rY1j8mfK47Del+TCkaLAXwLw==", "requires": { - "@types/node": "10.0.6" + "@types/node": "10.0.9" } }, "@types/url-join": { @@ -3714,6 +3714,15 @@ "uuid": "2.0.3" }, "dependencies": { + "hdkey": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/hdkey/-/hdkey-0.7.1.tgz", + "integrity": "sha1-yu5L6BqneSHpCbjSKN0PKayu5jI=", + "requires": { + "coinstring": "2.3.0", + "secp256k1": "3.5.0" + } + }, "uuid": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz", @@ -5370,15 +5379,6 @@ "sntp": "2.1.0" } }, - "hdkey": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/hdkey/-/hdkey-0.7.1.tgz", - "integrity": "sha1-yu5L6BqneSHpCbjSKN0PKayu5jI=", - "requires": { - "coinstring": "2.3.0", - "secp256k1": "3.5.0" - } - }, "he": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz",