diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-12-05 22:08:22 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-12-05 22:08:22 +0800 |
commit | 8cd204423a868d66228c226d29cc47ea2a7fd686 (patch) | |
tree | 36dd1cf512d82ce0c4e66e579d151679cb531ca6 /packages/typed-contracts/src/index.ts | |
parent | 2abc5a88c551956c704848f8e2c2d024d5cb81a9 (diff) | |
download | dexon-sol-tools-8cd204423a868d66228c226d29cc47ea2a7fd686.tar dexon-sol-tools-8cd204423a868d66228c226d29cc47ea2a7fd686.tar.gz dexon-sol-tools-8cd204423a868d66228c226d29cc47ea2a7fd686.tar.bz2 dexon-sol-tools-8cd204423a868d66228c226d29cc47ea2a7fd686.tar.lz dexon-sol-tools-8cd204423a868d66228c226d29cc47ea2a7fd686.tar.xz dexon-sol-tools-8cd204423a868d66228c226d29cc47ea2a7fd686.tar.zst dexon-sol-tools-8cd204423a868d66228c226d29cc47ea2a7fd686.zip |
Introduce a const for 'function'
Diffstat (limited to 'packages/typed-contracts/src/index.ts')
-rw-r--r-- | packages/typed-contracts/src/index.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/typed-contracts/src/index.ts b/packages/typed-contracts/src/index.ts index 5f925e079..f647343f8 100644 --- a/packages/typed-contracts/src/index.ts +++ b/packages/typed-contracts/src/index.ts @@ -14,6 +14,8 @@ import * as Web3 from 'web3'; import {ParamKind} from './types'; import {utils} from './utils'; +const ABI_TYPE_METHOD = 'function'; + const args = yargs .option('abiGlob', { describe: 'Glob pattern to search for ABI JSON files', @@ -66,7 +68,7 @@ for (const abiFileName of abiFileNames) { const ABI = _.isArray(parsedContent) ? parsedContent : // ABI file parsedContent.abi; // Truffle contracts file - const methodAbis = ABI.filter((abi: Web3.AbiDefinition) => abi.type === 'function') as Web3.MethodAbi[]; + const methodAbis = ABI.filter((abi: Web3.AbiDefinition) => abi.type === ABI_TYPE_METHOD) as Web3.MethodAbi[]; _.map(methodAbis, methodAbi => { _.map(methodAbi.inputs, input => { if (_.isEmpty(input.name)) { |