fix using deployedAddress instead of address
This commit is contained in:
parent
aa04279a6f
commit
91b8033ab5
|
@ -66,6 +66,8 @@ class Test {
|
||||||
trackContracts: false
|
trackContracts: false
|
||||||
});
|
});
|
||||||
this.engine.startService("codeGenerator");
|
this.engine.startService("codeGenerator");
|
||||||
|
}
|
||||||
|
|
||||||
init(callback) {
|
init(callback) {
|
||||||
const self = this;
|
const self = this;
|
||||||
this.engine.contractsManager.build(() => {
|
this.engine.contractsManager.build(() => {
|
||||||
|
@ -73,7 +75,6 @@ class Test {
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
onReady(callback) {
|
onReady(callback) {
|
||||||
if (this.ready) {
|
if (this.ready) {
|
||||||
|
@ -86,7 +87,8 @@ class Test {
|
||||||
|
|
||||||
config(options, callback) {
|
config(options, callback) {
|
||||||
if (!callback) {
|
if (!callback) {
|
||||||
callback = function () {};
|
callback = function () {
|
||||||
|
};
|
||||||
}
|
}
|
||||||
if (!options.contracts) {
|
if (!options.contracts) {
|
||||||
throw new Error(__('No contracts specified in the options'));
|
throw new Error(__('No contracts specified in the options'));
|
||||||
|
@ -122,9 +124,7 @@ class Test {
|
||||||
self.engine.contractsManager.gasLimit = 6000000;
|
self.engine.contractsManager.gasLimit = 6000000;
|
||||||
self.engine.deployManager.fatalErrors = true;
|
self.engine.deployManager.fatalErrors = true;
|
||||||
self.engine.deployManager.deployOnlyOnConfig = true;
|
self.engine.deployManager.deployOnlyOnConfig = true;
|
||||||
self.engine.events.request('deploy:contracts', (err) => {
|
self.engine.events.request('deploy:contracts', next);
|
||||||
next(err);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
function getAccounts(next) {
|
function getAccounts(next) {
|
||||||
self.web3.eth.getAccounts(function (err, accounts) {
|
self.web3.eth.getAccounts(function (err, accounts) {
|
||||||
|
@ -142,18 +142,18 @@ class Test {
|
||||||
if (!self.contracts[contractName]) {
|
if (!self.contracts[contractName]) {
|
||||||
self.contracts[contractName] = {};
|
self.contracts[contractName] = {};
|
||||||
}
|
}
|
||||||
Object.assign(self.contracts[contractName], new self.web3.eth.Contract(contract.abiDefinition, contract.address,
|
Object.assign(self.contracts[contractName], new self.web3.eth.Contract(contract.abiDefinition, contract.deployedAddress,
|
||||||
{from: self.web3.eth.defaultAccount, gas: 6000000}));
|
{from: self.web3.eth.defaultAccount, gas: 6000000}));
|
||||||
eachCb();
|
eachCb();
|
||||||
}, next);
|
}, next);
|
||||||
}
|
}
|
||||||
], function (err) {
|
], function (err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log(__('terminating due to error'));
|
console.log(__('terminating due to error'));
|
||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
require(module) {
|
require(module) {
|
||||||
|
|
Loading…
Reference in New Issue