From fdd8ad53219f1fe866a5f21cb8bcafb55bea8fcb Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Wed, 6 Feb 2019 14:52:29 -0500 Subject: [PATCH] fix(embarkjs/blockchain): pass error only when there is an error --- .../modules/blockchain_connector/embarkjs.js | 60 ------------------- 1 file changed, 60 deletions(-) delete mode 100644 packages/embark/src/lib/modules/blockchain_connector/embarkjs.js diff --git a/packages/embark/src/lib/modules/blockchain_connector/embarkjs.js b/packages/embark/src/lib/modules/blockchain_connector/embarkjs.js deleted file mode 100644 index c69c42539..000000000 --- a/packages/embark/src/lib/modules/blockchain_connector/embarkjs.js +++ /dev/null @@ -1,60 +0,0 @@ -/*global Web3*/ - -const __embarkWeb3 = {}; - -__embarkWeb3.init = function(_config) { - // Check if the global web3 object uses the old web3 (0.x) - if (global.web3 && typeof global.web3.version !== 'string') { - // If so, use a new instance using 1.0, but use its provider - this.web3 = new Web3(global.web3.currentProvider); - } else { - this.web3 = global.web3 || new Web3(); - } - global.web3 = this.web3; -}; - -__embarkWeb3.getInstance = function () { - return this.web3; -}; - -__embarkWeb3.getAccounts = function () { - return this.web3.eth.getAccounts(...arguments); -}; - -__embarkWeb3.getNewProvider = function (providerName, ...args) { - return new Web3.providers[providerName](...args); -}; - -__embarkWeb3.setProvider = function (provider) { - return this.web3.setProvider(provider); -}; - -__embarkWeb3.getCurrentProvider = function () { - return this.web3.currentProvider; -}; - -__embarkWeb3.getDefaultAccount = function () { - return this.web3.eth.defaultAccount; -}; - -__embarkWeb3.setDefaultAccount = function (account) { - this.web3.eth.defaultAccount = account; -}; - -__embarkWeb3.newContract = function (options) { - return new this.web3.eth.Contract(options.abi, options.address); -}; - -__embarkWeb3.send = function () { - return this.web3.eth.sendTransaction(...arguments); -}; - -__embarkWeb3.toWei = function () { - return this.web3.toWei(...arguments); -}; - -__embarkWeb3.getNetworkId = function () { - return this.web3.eth.net.getId(); -}; - -