diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-12-05 22:51:47 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-12-05 22:51:47 +0800 |
commit | 43983f1bb3660a7a7650d947de4bc1a2a9fb8c09 (patch) | |
tree | 5443cd08af713af47e270691a3a2d796e830e9bf | |
parent | eb4adcf797cab80b9fa7c08083978be5514df8b9 (diff) | |
download | dexon-0x-contracts-43983f1bb3660a7a7650d947de4bc1a2a9fb8c09.tar dexon-0x-contracts-43983f1bb3660a7a7650d947de4bc1a2a9fb8c09.tar.gz dexon-0x-contracts-43983f1bb3660a7a7650d947de4bc1a2a9fb8c09.tar.bz2 dexon-0x-contracts-43983f1bb3660a7a7650d947de4bc1a2a9fb8c09.tar.lz dexon-0x-contracts-43983f1bb3660a7a7650d947de4bc1a2a9fb8c09.tar.xz dexon-0x-contracts-43983f1bb3660a7a7650d947de4bc1a2a9fb8c09.tar.zst dexon-0x-contracts-43983f1bb3660a7a7650d947de4bc1a2a9fb8c09.zip |
Check ABI is defined
-rw-r--r-- | packages/typed-contracts/src/index.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/typed-contracts/src/index.ts b/packages/typed-contracts/src/index.ts index 0a74e1594..9461ca8ca 100644 --- a/packages/typed-contracts/src/index.ts +++ b/packages/typed-contracts/src/index.ts @@ -69,6 +69,11 @@ for (const abiFileName of abiFileNames) { const ABI = _.isArray(parsedContent) ? parsedContent : // ABI file parsedContent.abi; // Truffle contracts file + if (_.isUndefined(ABI)) { + utils.log(`${chalk.red(`ABI not found in ${abiFileName}.`)}`); + utils.log(`Please make sure your ABI file is either an array with ABI entries or an object with the abi key`); + process.exit(1); + } const methodAbis = ABI.filter((abi: Web3.AbiDefinition) => abi.type === ABI_TYPE_METHOD) as Web3.MethodAbi[]; _.map(methodAbis, methodAbi => { _.map(methodAbi.inputs, input => { |