From 59b2d809f1971d2bdb6cfd3abd91eaedbaaf1a87 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Mon, 18 Jun 2018 14:02:02 -0400 Subject: [PATCH] put defaultAccount as the default contract from --- js/embark.js | 2 +- js/embark_node.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/embark.js b/js/embark.js index cff85842..90cab289 100644 --- a/js/embark.js +++ b/js/embark.js @@ -36,7 +36,7 @@ EmbarkJS.Contract = function (options) { ContractClass = new this.web3.eth.Contract(this.abi, this.address); ContractClass.setProvider(this.web3.currentProvider); ContractClass.options.data = this.code; - ContractClass.options.from = this.from; + ContractClass.options.from = this.from || this.web3.eth.defaultAccount; ContractClass.abi = ContractClass.options.abi; ContractClass.address = this.address; ContractClass.gas = this.gas; diff --git a/js/embark_node.js b/js/embark_node.js index 9e9ea8b7..f93916b2 100644 --- a/js/embark_node.js +++ b/js/embark_node.js @@ -36,7 +36,7 @@ EmbarkJS.Contract = function(options) { ContractClass = new this.web3.eth.Contract(this.abi, this.address); ContractClass.setProvider(this.web3.currentProvider); ContractClass.options.data = this.code; - ContractClass.options.from = this.from; + ContractClass.options.from = this.from || this.web3.eth.defaultAccount; ContractClass.abi = ContractClass.options.abi; ContractClass.address = this.address; ContractClass.gas = this.gas;