From 43ceb24914124bc67818d35d8ac8d1c62e40ce22 Mon Sep 17 00:00:00 2001 From: Nguyen Sy Thanh Son Date: Fri, 19 Oct 2018 07:54:07 +0000 Subject: [PATCH 1/5] change hdpath, warning do login --- app/components/Setting.vue | 2 +- app/components/candidates/Apply.vue | 13 +++++ app/components/voters/Voting.vue | 15 ++++- app/helpers.js | 88 +++++++++++++++++++++++++++++ 4 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 app/helpers.js diff --git a/app/components/Setting.vue b/app/components/Setting.vue index e1184f04..3d7ca9e7 100644 --- a/app/components/Setting.vue +++ b/app/components/Setting.vue @@ -168,7 +168,7 @@ import { required } from 'vuelidate/lib/validators' import localhostUrl from '../../validators/localhostUrl.js' -const HDWalletProvider = require('truffle-hdwallet-provider') +const { HDWalletProvider } = require('../helpers.js') const PrivateKeyProvider = require('truffle-privatekey-provider') export default { name: 'App', diff --git a/app/components/candidates/Apply.vue b/app/components/candidates/Apply.vue index e8fa8ff5..a5b1b345 100644 --- a/app/components/candidates/Apply.vue +++ b/app/components/candidates/Apply.vue @@ -150,6 +150,19 @@ export default { let account = await self.getAccount() self.account = account } catch (e) { + self.$toasted.show(`You need login your account before voting`, + { + type : 'default', + duration: 5000, + action : [ + { + text : 'Login', + onClick : (e, toastObject) => { + self.$router.push({ path: '/setting' }) + } + } + ] + }) console.log(e) } }, diff --git a/app/components/voters/Voting.vue b/app/components/voters/Voting.vue index 1b5111ec..cd14f1db 100644 --- a/app/components/voters/Voting.vue +++ b/app/components/voters/Voting.vue @@ -12,7 +12,7 @@
  • - {{ voter }} + {{ voter || 'Unknown' }} Voter

  • @@ -111,6 +111,19 @@ export default { let account = await self.getAccount() self.voter = account } catch (e) { + self.$toasted.show(`You need login your account before voting`, + { + type : 'default', + duration: 5000, + action : [ + { + text : 'Login', + onClick : (e, toastObject) => { + self.$router.push({ path: '/setting' }) + } + } + ] + }) console.log(e) } }, diff --git a/app/helpers.js b/app/helpers.js new file mode 100644 index 00000000..7fdc9c02 --- /dev/null +++ b/app/helpers.js @@ -0,0 +1,88 @@ +var bip39 = require('bip39') +var hdkey = require('ethereumjs-wallet/hdkey') +var ProviderEngine = require('web3-provider-engine') +var FiltersSubprovider = require('web3-provider-engine/subproviders/filters.js') +var NonceSubProvider = require('web3-provider-engine/subproviders/nonce-tracker.js') +var HookedSubprovider = require('web3-provider-engine/subproviders/hooked-wallet.js') +var ProviderSubprovider = require('web3-provider-engine/subproviders/provider.js') +var Web3 = require('web3') +var Transaction = require('ethereumjs-tx') + +// This line shares nonce state across multiple provider instances. Necessary +// because within truffle the wallet is repeatedly newed if it's declared in the config within a +// function, resetting nonce from tx to tx. An instance can opt out +// of this behavior by passing `shareNonce=false` to the constructor. +// See issue #65 for more +var singletonNonceSubProvider = new NonceSubProvider() + +/* eslint-disable */ + +function HDWalletProvider ( + mnemonic, + provider_url, + address_index = 0, + num_addresses = 1, + shareNonce = true +) { + this.mnemonic = mnemonic + this.hdwallet = hdkey.fromMasterSeed(bip39.mnemonicToSeed(mnemonic)) + this.wallet_hdpath = "m/44'/889'/0'/0/" + this.wallets = {} + this.addresses = [] + + for (let i = address_index; i < address_index + num_addresses; i++) { + var wallet = this.hdwallet.derivePath(this.wallet_hdpath + i).getWallet() + var addr = '0x' + wallet.getAddress().toString('hex') + this.addresses.push(addr) + this.wallets[addr] = wallet + } + + const tmp_accounts = this.addresses + const tmp_wallets = this.wallets + + this.engine = new ProviderEngine() + this.engine.addProvider(new HookedSubprovider({ + getAccounts: function (cb) { cb(null, tmp_accounts) }, + getPrivateKey: function (address, cb) { + if (!tmp_wallets[address]) { return cb('Account not found') } else { cb(null, tmp_wallets[address].getPrivateKey().toString('hex')) } + }, + signTransaction: function (txParams, cb) { + let pkey + if (tmp_wallets[txParams.from]) { pkey = tmp_wallets[txParams.from].getPrivateKey() } else { cb('Account not found') } + var tx = new Transaction(txParams) + tx.sign(pkey) + var rawTx = '0x' + tx.serialize().toString('hex') + cb(null, rawTx) + } + })); + + (!shareNonce) + ? this.engine.addProvider(new NonceSubProvider()) + : this.engine.addProvider(singletonNonceSubProvider) + + this.engine.addProvider(new FiltersSubprovider()) + this.engine.addProvider(new ProviderSubprovider(new Web3.providers.HttpProvider(provider_url))) + this.engine.start() // Required by the provider engine. +}; + +HDWalletProvider.prototype.sendAsync = function () { + this.engine.sendAsync.apply(this.engine, arguments) +} + +HDWalletProvider.prototype.send = function () { + return this.engine.send.apply(this.engine, arguments) +} + +// returns the address of the given address_index, first checking the cache +HDWalletProvider.prototype.getAddress = function (idx) { + console.log('getting addresses', this.addresses[0], idx) + if (!idx) { return this.addresses[0] } else { return this.addresses[idx] } +} + +// returns the addresses cache +HDWalletProvider.prototype.getAddresses = function () { + return this.addresses +} +/* eslint-enable */ + +module.exports = { HDWalletProvider } From 7580dff357bf5050397a0594ec0fefbd10b1530a Mon Sep 17 00:00:00 2001 From: Nguyen Sy Thanh Son Date: Fri, 19 Oct 2018 08:01:24 +0000 Subject: [PATCH 2/5] fix issue login by mnemonic --- app/components/Setting.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/app/components/Setting.vue b/app/components/Setting.vue index 3d7ca9e7..6bf69947 100644 --- a/app/components/Setting.vue +++ b/app/components/Setting.vue @@ -254,6 +254,7 @@ export default { } self.wh.push(it) }) + self.isReady = true } catch (e) { console.log(e) } From 5a456af9c896c0725b48d5459d9a434417cf9810 Mon Sep 17 00:00:00 2001 From: Nguyen Sy Thanh Son Date: Fri, 19 Oct 2018 08:19:09 +0000 Subject: [PATCH 3/5] Add sort for lastest signed block --- apis/candidates.js | 4 +--- app/components/candidates/List.vue | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/apis/candidates.js b/apis/candidates.js index 92ae4049..7d74343f 100644 --- a/apis/candidates.js +++ b/apis/candidates.js @@ -31,9 +31,7 @@ router.get('/', async function (req, res, next) { let map = candidates.map(async c => { let bs = await db.BlockSigner.findOne({ - 'signers.signer': { - $in: signers - } + 'signers.signer': c.candidate }).sort({ _id: 'desc' }) c.latestSignedBlock = (bs || {}).blockNumber || 0 diff --git a/app/components/candidates/List.vue b/app/components/candidates/List.vue index 261bf91c..6ea18fba 100644 --- a/app/components/candidates/List.vue +++ b/app/components/candidates/List.vue @@ -147,12 +147,12 @@ export default { { key: 'address', label: 'Address', - sortable: true + sortable: false }, { key: 'name', label: 'Name', - sortable: true + sortable: false }, { key: 'cap', @@ -162,7 +162,7 @@ export default { { key: 'latestSignedBlock', label: 'Latest Signed Block', - sortable: false + sortable: true }, { key: 'status', From f2746ce69303b26730b99f094d53eca60824578f Mon Sep 17 00:00:00 2001 From: Nguyen Sy Thanh Son Date: Fri, 19 Oct 2018 09:36:05 +0000 Subject: [PATCH 4/5] clean pakcages --- apis/candidates.js | 2 +- app/components/Setting.vue | 2 +- app/helpers.js => helpers.js | 0 package-lock.json | 248 +++++++++++++++-------------------- package.json | 2 +- 5 files changed, 110 insertions(+), 144 deletions(-) rename app/helpers.js => helpers.js (100%) diff --git a/apis/candidates.js b/apis/candidates.js index 7d74343f..55842fc7 100644 --- a/apis/candidates.js +++ b/apis/candidates.js @@ -3,7 +3,7 @@ const express = require('express') const router = express.Router() const db = require('../models/mongodb') const { Validator } = require('../models/blockchain/validator') -const HDWalletProvider = require('truffle-hdwallet-provider') +const { HDWalletProvider } = require('../helpers') const PrivateKeyProvider = require('truffle-privatekey-provider') const config = require('config') diff --git a/app/components/Setting.vue b/app/components/Setting.vue index 6bf69947..38551b7b 100644 --- a/app/components/Setting.vue +++ b/app/components/Setting.vue @@ -168,7 +168,7 @@ import { required } from 'vuelidate/lib/validators' import localhostUrl from '../../validators/localhostUrl.js' -const { HDWalletProvider } = require('../helpers.js') +const { HDWalletProvider } = require('../../helpers') const PrivateKeyProvider = require('truffle-privatekey-provider') export default { name: 'App', diff --git a/app/helpers.js b/helpers.js similarity index 100% rename from app/helpers.js rename to helpers.js diff --git a/package-lock.json b/package-lock.json index c47c399b..86d44e6f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5236,8 +5236,8 @@ "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", "dev": true, "requires": { - "esutils": "2.0.2", - "isarray": "1.0.0" + "esutils": "^2.0.2", + "isarray": "^1.0.0" } }, "find-up": { @@ -5255,10 +5255,10 @@ "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "parse-json": "2.2.0", - "pify": "2.3.0", - "strip-bom": "3.0.0" + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" } }, "path-type": { @@ -5267,7 +5267,7 @@ "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", "dev": true, "requires": { - "pify": "2.3.0" + "pify": "^2.0.0" } }, "read-pkg": { @@ -5276,9 +5276,9 @@ "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", "dev": true, "requires": { - "load-json-file": "2.0.0", - "normalize-package-data": "2.4.0", - "path-type": "2.0.0" + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" } }, "read-pkg-up": { @@ -5287,8 +5287,8 @@ "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", "dev": true, "requires": { - "find-up": "2.1.0", - "read-pkg": "2.0.0" + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" } }, "strip-bom": { @@ -5589,13 +5589,13 @@ "integrity": "sha512-NamWuMBIl8kmkJFVj8WzGatySTzQPQag4Xr677yFxdVtIxACFbL/dQowk0MzEqIKk93U1TwY3MjVU6mOcwZnKA==", "requires": { "async-eventemitter": "github:ahultgren/async-eventemitter#fa06e39e56786ba541c180061dbf2c0a5bbf951c", - "eth-query": "2.1.2", - "ethereumjs-tx": "1.3.7", - "ethereumjs-util": "5.2.0", - "ethjs-util": "0.1.6", - "json-rpc-engine": "3.7.3", - "pify": "2.3.0", - "tape": "4.9.1" + "eth-query": "^2.1.0", + "ethereumjs-tx": "^1.3.3", + "ethereumjs-util": "^5.1.3", + "ethjs-util": "^0.1.3", + "json-rpc-engine": "^3.6.0", + "pify": "^2.3.0", + "tape": "^4.6.3" }, "dependencies": { "async-eventemitter": { @@ -5617,13 +5617,13 @@ "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", "requires": { - "bn.js": "4.11.8", - "create-hash": "1.2.0", - "ethjs-util": "0.1.6", - "keccak": "1.4.0", - "rlp": "2.1.0", - "safe-buffer": "5.1.1", - "secp256k1": "3.5.2" + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "ethjs-util": "^0.1.3", + "keccak": "^1.0.2", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1", + "secp256k1": "^3.0.1" } }, "ethereumjs-vm": { @@ -5649,25 +5649,25 @@ "resolved": "https://registry.npmjs.org/web3-provider-engine/-/web3-provider-engine-13.8.0.tgz", "integrity": "sha512-fZXhX5VWwWpoFfrfocslyg6P7cN3YWPG/ASaevNfeO80R+nzgoPUBXcWQekSGSsNDkeRTis4aMmpmofYf1TNtQ==", "requires": { - "async": "2.6.1", - "clone": "2.1.2", - "eth-block-tracker": "2.3.1", - "eth-sig-util": "1.4.2", - "ethereumjs-block": "1.7.1", - "ethereumjs-tx": "1.3.7", - "ethereumjs-util": "5.2.0", - "ethereumjs-vm": "2.3.4", - "fetch-ponyfill": "4.1.0", - "json-rpc-error": "2.0.0", - "json-stable-stringify": "1.0.1", - "promise-to-callback": "1.0.0", - "readable-stream": "2.3.6", - "request": "2.88.0", - "semaphore": "1.1.0", - "solc": "0.4.24", - "tape": "4.9.1", - "xhr": "2.5.0", - "xtend": "4.0.1" + "async": "^2.5.0", + "clone": "^2.0.0", + "eth-block-tracker": "^2.2.2", + "eth-sig-util": "^1.4.2", + "ethereumjs-block": "^1.2.2", + "ethereumjs-tx": "^1.2.0", + "ethereumjs-util": "^5.1.1", + "ethereumjs-vm": "^2.0.2", + "fetch-ponyfill": "^4.0.0", + "json-rpc-error": "^2.0.0", + "json-stable-stringify": "^1.0.1", + "promise-to-callback": "^1.0.0", + "readable-stream": "^2.2.9", + "request": "^2.67.0", + "semaphore": "^1.0.3", + "solc": "^0.4.2", + "tape": "^4.4.0", + "xhr": "^2.2.0", + "xtend": "^4.0.1" } } } @@ -8943,7 +8943,7 @@ "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", "dev": true, "requires": { - "arr-flatten": "1.1.0" + "arr-flatten": "^1.0.1" } }, "array-unique": { @@ -8964,9 +8964,9 @@ "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", "dev": true, "requires": { - "expand-range": "1.8.2", - "preserve": "0.2.0", - "repeat-element": "1.1.3" + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" } }, "expand-brackets": { @@ -8975,7 +8975,7 @@ "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", "dev": true, "requires": { - "is-posix-bracket": "0.1.1" + "is-posix-bracket": "^0.1.0" } }, "extglob": { @@ -8984,7 +8984,7 @@ "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", "dev": true, "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^1.0.0" } }, "is-extglob": { @@ -8999,7 +8999,7 @@ "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", "dev": true, "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^1.0.0" } }, "micromatch": { @@ -9008,19 +9008,19 @@ "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", "dev": true, "requires": { - "arr-diff": "2.0.0", - "array-unique": "0.2.1", - "braces": "1.8.5", - "expand-brackets": "0.1.5", - "extglob": "0.3.2", - "filename-regex": "2.0.1", - "is-extglob": "1.0.0", - "is-glob": "2.0.1", - "kind-of": "3.2.2", - "normalize-path": "2.1.1", - "object.omit": "2.0.1", - "parse-glob": "3.0.4", - "regex-cache": "0.4.4" + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" } }, "write-file-atomic": { @@ -9029,9 +9029,9 @@ "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "imurmurhash": "0.1.4", - "slide": "1.1.6" + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "slide": "^1.1.5" } } } @@ -9415,8 +9415,8 @@ "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", "dev": true, "requires": { - "escape-string-regexp": "1.0.5", - "object-assign": "4.1.1" + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" } }, "log-symbols": { @@ -9425,7 +9425,7 @@ "integrity": "sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg=", "dev": true, "requires": { - "chalk": "1.1.3" + "chalk": "^1.0.0" } }, "rxjs": { @@ -10791,8 +10791,8 @@ "integrity": "sha1-ElYDfsufDF9549bvE14wdwGEuYI=", "dev": true, "requires": { - "lru-cache": "4.1.3", - "which": "1.3.1" + "lru-cache": "^4.0.1", + "which": "^1.2.9" } }, "extend": { @@ -14166,7 +14166,7 @@ "integrity": "sha1-8O/hjE9W5PQK/H4Gxxn9XuYYjzg=", "dev": true, "requires": { - "websocket-driver": "0.7.0" + "websocket-driver": ">=0.5.1" } } } @@ -14225,10 +14225,10 @@ "dev": true, "requires": { "bignumber.js": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2", - "crypto-js": "3.1.8", - "utf8": "2.1.2", - "xhr2": "0.1.4", - "xmlhttprequest": "1.8.0" + "crypto-js": "^3.1.4", + "utf8": "^2.1.1", + "xhr2": "*", + "xmlhttprequest": "*" } } } @@ -15199,40 +15199,6 @@ "resolved": "https://registry.npmjs.org/truffle-error/-/truffle-error-0.0.3.tgz", "integrity": "sha1-S/VSQuFN7uHHGUkycJGC3v8sl8o=" }, - "truffle-hdwallet-provider": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/truffle-hdwallet-provider/-/truffle-hdwallet-provider-0.0.6.tgz", - "integrity": "sha512-vh1nCk9+COz9Z1BnDYjrZEc8Z4KCWeoThAX6U13SpHMuSL7gX40ZDWszlVmovPLEwHSJBh/OaFmaduKfeXT9rA==", - "requires": { - "bip39": "^2.2.0", - "ethereumjs-wallet": "0.6.0", - "web3": "^0.18.2", - "web3-provider-engine": "^14.0.5" - }, - "dependencies": { - "bignumber.js": { - "version": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2", - "from": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2" - }, - "crypto-js": { - "version": "3.1.8", - "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.1.8.tgz", - "integrity": "sha1-cV8HC/YBTyrpkqmLOSkli3E/CNU=" - }, - "web3": { - "version": "0.18.4", - "resolved": "https://registry.npmjs.org/web3/-/web3-0.18.4.tgz", - "integrity": "sha1-gewXhBRUkfLqqJVbMcBgSeB8Xn0=", - "requires": { - "bignumber.js": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2", - "crypto-js": "^3.1.4", - "utf8": "^2.1.1", - "xhr2": "*", - "xmlhttprequest": "*" - } - } - } - }, "truffle-privatekey-provider": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/truffle-privatekey-provider/-/truffle-privatekey-provider-0.1.0.tgz", @@ -15982,7 +15948,7 @@ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { - "color-convert": "1.9.2" + "color-convert": "^1.9.0" } }, "chalk": { @@ -16788,7 +16754,7 @@ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { - "color-convert": "1.9.2" + "color-convert": "^1.9.0" } }, "camelcase": { @@ -16865,19 +16831,19 @@ "integrity": "sha512-E9BmnJbAKLPGonz0HeWHtbKf+EeSP93paWO3ZYoUpq/aowXvYGjjCSuashhXPpzbArIjBbji39THkxTz9ZeEUQ==", "dev": true, "requires": { - "ansi-escapes": "3.1.0", - "chalk": "2.4.1", - "cli-cursor": "2.1.0", - "cli-width": "2.2.0", - "external-editor": "2.2.0", - "figures": "2.0.0", - "lodash": "4.17.10", + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^2.1.0", + "figures": "^2.0.0", + "lodash": "^4.3.0", "mute-stream": "0.0.7", - "run-async": "2.3.0", - "rxjs": "5.5.11", - "string-width": "2.1.1", - "strip-ansi": "4.0.0", - "through": "2.3.8" + "run-async": "^2.2.0", + "rxjs": "^5.5.2", + "string-width": "^2.1.0", + "strip-ansi": "^4.0.0", + "through": "^2.3.6" } }, "is-fullwidth-code-point": { @@ -16940,7 +16906,7 @@ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { - "ansi-regex": "3.0.0" + "ansi-regex": "^3.0.0" } }, "supports-color": { @@ -16958,7 +16924,7 @@ "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", "dev": true, "requires": { - "prepend-http": "2.0.0" + "prepend-http": "^2.0.0" } }, "which-module": { @@ -17114,12 +17080,12 @@ "integrity": "sha1-U+z2mf/LyzljdpGrE7rxYIGXZuU=", "dev": true, "requires": { - "globby": "6.1.0", - "is-path-cwd": "1.0.0", - "is-path-in-cwd": "1.0.1", - "p-map": "1.2.0", - "pify": "3.0.0", - "rimraf": "2.6.2" + "globby": "^6.1.0", + "is-path-cwd": "^1.0.0", + "is-path-in-cwd": "^1.0.0", + "p-map": "^1.1.1", + "pify": "^3.0.0", + "rimraf": "^2.2.8" } }, "find-up": { @@ -17137,11 +17103,11 @@ "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", "dev": true, "requires": { - "array-union": "1.0.2", - "glob": "7.0.6", - "object-assign": "4.1.1", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" }, "dependencies": { "pify": { @@ -17700,7 +17666,7 @@ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { - "color-convert": "1.9.2" + "color-convert": "^1.9.0" } }, "chalk": { @@ -17886,7 +17852,7 @@ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { - "color-convert": "1.9.2" + "color-convert": "^1.9.0" } }, "chalk": { diff --git a/package.json b/package.json index 4de42431..6b4fd085 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "homepage": "https://github.com/tomochain/tomomaster#readme", "dependencies": { "bignumber.js": "^7.2.1", + "bip39": "^2.5.0", "body-parser": "^1.18.2", "commander": "^2.17.1", "config": "^1.30.0", @@ -48,7 +49,6 @@ "mongoose": "^5.0.17", "request": "^2.88.0", "truffle-contract": "^3.0.5", - "truffle-hdwallet-provider": "0.0.6", "truffle-privatekey-provider": "^0.1.0", "vue-toasted": "^1.1.24", "websocket": "^1.0.26" From f6e2db41fdee3d177e5b254c609df454e5d28bc3 Mon Sep 17 00:00:00 2001 From: Nguyen Sy Thanh Son Date: Fri, 19 Oct 2018 10:11:14 +0000 Subject: [PATCH 5/5] reinstall hdwallet --- package-lock.json | 34 ++++++++++++++++++++++++++++++++++ package.json | 1 + 2 files changed, 35 insertions(+) diff --git a/package-lock.json b/package-lock.json index 86d44e6f..5e99772c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15199,6 +15199,40 @@ "resolved": "https://registry.npmjs.org/truffle-error/-/truffle-error-0.0.3.tgz", "integrity": "sha1-S/VSQuFN7uHHGUkycJGC3v8sl8o=" }, + "truffle-hdwallet-provider": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/truffle-hdwallet-provider/-/truffle-hdwallet-provider-0.0.6.tgz", + "integrity": "sha512-vh1nCk9+COz9Z1BnDYjrZEc8Z4KCWeoThAX6U13SpHMuSL7gX40ZDWszlVmovPLEwHSJBh/OaFmaduKfeXT9rA==", + "requires": { + "bip39": "^2.2.0", + "ethereumjs-wallet": "0.6.0", + "web3": "^0.18.2", + "web3-provider-engine": "^14.0.5" + }, + "dependencies": { + "bignumber.js": { + "version": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2", + "from": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2" + }, + "crypto-js": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.1.8.tgz", + "integrity": "sha1-cV8HC/YBTyrpkqmLOSkli3E/CNU=" + }, + "web3": { + "version": "0.18.4", + "resolved": "https://registry.npmjs.org/web3/-/web3-0.18.4.tgz", + "integrity": "sha1-gewXhBRUkfLqqJVbMcBgSeB8Xn0=", + "requires": { + "bignumber.js": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2", + "crypto-js": "^3.1.4", + "utf8": "^2.1.1", + "xhr2": "*", + "xmlhttprequest": "*" + } + } + } + }, "truffle-privatekey-provider": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/truffle-privatekey-provider/-/truffle-privatekey-provider-0.1.0.tgz", diff --git a/package.json b/package.json index 6b4fd085..dba4a603 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "mongoose": "^5.0.17", "request": "^2.88.0", "truffle-contract": "^3.0.5", + "truffle-hdwallet-provider": "0.0.6", "truffle-privatekey-provider": "^0.1.0", "vue-toasted": "^1.1.24", "websocket": "^1.0.26"