From 50ff2817fba59cf545f93650b854401971b48262 Mon Sep 17 00:00:00 2001 From: Fabian Vogelsteller Date: Wed, 15 Feb 2017 18:51:42 +0100 Subject: [PATCH] updated to web3.js 0.18.2, please run yarn --- interface/client/lib/ethereum/1_web3js_init.js | 12 +++++++++--- .../popupWindows/sendTransactionConfirmation.js | 4 ++-- package.json | 2 +- yarn.lock | 11 ++++++++--- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/interface/client/lib/ethereum/1_web3js_init.js b/interface/client/lib/ethereum/1_web3js_init.js index fc80d40a2..15f612e52 100644 --- a/interface/client/lib/ethereum/1_web3js_init.js +++ b/interface/client/lib/ethereum/1_web3js_init.js @@ -2,9 +2,15 @@ if(typeof web3 !== 'undefined') { console.info('Web3 already initialized, re-using provider.'); - web3 = new Web3(web3.currentProvider); + // add web3 backwards compatibility + if(!web3.currentProvider.sendAsync) { + web3.currentProvider.sendAsync = web3.currentProvider.send; + web3.currentProvider.send = web3.currentProvider.sendSync; + } + + web3 = new Web3(web3.currentProvider); } else { - console.info('Web3 not yet initialized, doing so now with HttpProvider.'); + console.info('Web3 not yet initialized, doing so now with HttpProvider.'); - web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); + web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); } diff --git a/interface/client/templates/popupWindows/sendTransactionConfirmation.js b/interface/client/templates/popupWindows/sendTransactionConfirmation.js index 3b672103c..f0279a595 100644 --- a/interface/client/templates/popupWindows/sendTransactionConfirmation.js +++ b/interface/client/templates/popupWindows/sendTransactionConfirmation.js @@ -11,7 +11,7 @@ var setWindowSize = function(template){ } -var defaultEstimateGas = 5000000; +var defaultEstimateGas = 50000000; /** The sendTransaction confirmation popup window template @@ -327,7 +327,7 @@ Template['popupWindows_sendTransactionConfirmation'].events({ TemplateVar.set('unlocking', true); // unlock and send transaction! - web3.personal.unlockAccountAndSendTransaction(data, pw || '', function(e, res){ + web3.personal.sendTransaction(data, pw || '', function(e, res){ pw = null; TemplateVar.set(template, 'unlocking', false); diff --git a/package.json b/package.json index 79880329b..4b46c8ce3 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "underscore": "^1.8.3", "underscore-deep-extend": "^1.1.5", "uuid": "^3.0.1", - "web3": "^0.17.0-alpha", + "web3": "^0.18.2", "yargs": "^6.6.0" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index f26b1d3fd..f48fa7c5f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4231,13 +4231,14 @@ wdio-dot-reporter@^0.0.6: dependencies: babel-runtime "^5.8.25" -web3@^0.17.0-alpha: - version "0.17.0-beta" - resolved "https://registry.yarnpkg.com/web3/-/web3-0.17.0-beta.tgz#57af38245bff7a32099f7ce5780fad5bbc00da5b" +web3@^0.18.2: + version "0.18.2" + resolved "https://registry.yarnpkg.com/web3/-/web3-0.18.2.tgz#61b1a6edf5056820e22e1ef082f54c279f4bf758" dependencies: bignumber.js "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2" crypto-js "^3.1.4" utf8 "^2.1.1" + xhr2 "*" xmlhttprequest "*" webdriverio@^4.0.4: @@ -4335,6 +4336,10 @@ xdg-basedir@^2.0.0: dependencies: os-homedir "^1.0.0" +xhr2@*: + version "0.1.4" + resolved "https://registry.yarnpkg.com/xhr2/-/xhr2-0.1.4.tgz#7f87658847716db5026323812f818cadab387a5f" + xml2js@^0.4.17: version "0.4.17" resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.17.tgz#17be93eaae3f3b779359c795b419705a8817e868"