From 53617c53446e35c1c6ad0ecfb821575e6a0a6796 Mon Sep 17 00:00:00 2001 From: Jorge Izquierdo Date: Tue, 12 Feb 2019 10:51:52 +0100 Subject: [PATCH] dao act: cleanup --- src/commands/dao_cmds/act.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/commands/dao_cmds/act.js b/src/commands/dao_cmds/act.js index 4def15e30..8bd07774f 100644 --- a/src/commands/dao_cmds/act.js +++ b/src/commands/dao_cmds/act.js @@ -4,10 +4,11 @@ const { ensureWeb3 } = require('../../helpers/web3-fallback') const ABI = require('web3-eth-abi') const EXECUTE_FUNCTION_NAME = 'execute' +const ZERO_ADDR = '0x0000000000000000000000000000000000000000' exports.command = 'act [call-args..]' -exports.describe = 'Executes a call from the Agent app' +exports.describe = 'Executes an action from the Agent app' exports.builder = function(yargs) { return yargs @@ -59,7 +60,12 @@ exports.handler = async function({ const web3 = await ensureWeb3(network) const dao = await getAppKernel(web3, agentAddress) - // TODO: assert dao != 0x00...00 + if (dao === ZERO_ADDR) { + throw new Error( + 'Invalid Agent app address, cannot find Kernel reference in contract' + ) + } + const fnArgs = [target, 0, encodeCalldata(signature, callArgs)] const getTransactionPath = wrapper =>