Add a general purpose contract CLI #11

Merged
bumi merged 3 commits from features/cli into master 2018-04-07 20:02:31 +00:00
Showing only changes of commit 1488862b42 - Show all commits

View File

@ -16,6 +16,10 @@ module.exports = function(callback) {
console.log(`Using ${contractName} at ${contractAddress}`);
let contract = await artifacts.require(`./${contractName}`).at(contractAddress);
if(!contract[method]) {
callback(new Error(`Method ${method} is not defined on ${contractName}`));
return;
}
console.log(`Calling ${method} with ${JSON.stringify(args)}`);
contract[method](...args).then((result) => {