mirror of https://github.com/embarklabs/embark.git
define default account for each contract
This commit is contained in:
parent
7cac969f16
commit
e2aa46eac8
|
@ -1,3 +1,9 @@
|
||||||
__mainContext.web3 = undefined;
|
__mainContext.web3 = undefined;
|
||||||
web3 = new Web3(new Web3.providers.HttpProvider("<%- url -%>"));
|
web3 = new Web3(new Web3.providers.HttpProvider("<%- url -%>"));
|
||||||
<%- done %>
|
web3.eth.getAccounts(function(err, accounts) {
|
||||||
|
if (err) {
|
||||||
|
return done(new Error(err));
|
||||||
|
}
|
||||||
|
web3.defaultAccount = accounts[0];
|
||||||
|
<%- done %>
|
||||||
|
});
|
||||||
|
|
|
@ -2,3 +2,4 @@
|
||||||
<%- className %> = new web3.eth.Contract(<%- className %>Abi);
|
<%- className %> = new web3.eth.Contract(<%- className %>Abi);
|
||||||
<%- className %>.options.address = '<%- contract.deployedAddress %>';
|
<%- className %>.options.address = '<%- contract.deployedAddress %>';
|
||||||
<%- className %>.address = '<%- contract.deployedAddress %>';
|
<%- className %>.address = '<%- contract.deployedAddress %>';
|
||||||
|
<%- className %>.options.from = web3.eth.defaultAccount;
|
||||||
|
|
|
@ -110,6 +110,7 @@ class Engine {
|
||||||
|
|
||||||
codeGeneratorService(_options) {
|
codeGeneratorService(_options) {
|
||||||
let self = this;
|
let self = this;
|
||||||
|
|
||||||
let generateCode = function (contractsManager) {
|
let generateCode = function (contractsManager) {
|
||||||
let codeGenerator = new CodeGenerator({
|
let codeGenerator = new CodeGenerator({
|
||||||
blockchainConfig: self.config.blockchainConfig,
|
blockchainConfig: self.config.blockchainConfig,
|
||||||
|
|
Loading…
Reference in New Issue