diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-02-06 23:37:07 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-02-07 09:27:47 +0800 |
commit | 600a2b40af0430d4037f86f6ffe21d6edf3fb166 (patch) | |
tree | 63a7d4b6df21f34c0ee2c26dd9a805ced4f45146 /packages | |
parent | a7c51593e4e6bc514f4f975fdc6fb9207c52ac8e (diff) | |
download | dexon-sol-tools-600a2b40af0430d4037f86f6ffe21d6edf3fb166.tar dexon-sol-tools-600a2b40af0430d4037f86f6ffe21d6edf3fb166.tar.gz dexon-sol-tools-600a2b40af0430d4037f86f6ffe21d6edf3fb166.tar.bz2 dexon-sol-tools-600a2b40af0430d4037f86f6ffe21d6edf3fb166.tar.lz dexon-sol-tools-600a2b40af0430d4037f86f6ffe21d6edf3fb166.tar.xz dexon-sol-tools-600a2b40af0430d4037f86f6ffe21d6edf3fb166.tar.zst dexon-sol-tools-600a2b40af0430d4037f86f6ffe21d6edf3fb166.zip |
Add indices for index parameters so that their names don't collide
Diffstat (limited to 'packages')
-rw-r--r-- | packages/abi-gen/src/index.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/abi-gen/src/index.ts b/packages/abi-gen/src/index.ts index 6b5119ca4..46d41861d 100644 --- a/packages/abi-gen/src/index.ts +++ b/packages/abi-gen/src/index.ts @@ -114,10 +114,10 @@ for (const abiFileName of abiFileNames) { const methodAbis = ABI.filter((abi: Web3.AbiDefinition) => abi.type === ABI_TYPE_METHOD) as Web3.MethodAbi[]; const methodsData = _.map(methodAbis, methodAbi => { - _.map(methodAbi.inputs, input => { + _.map(methodAbi.inputs, (input, i: number) => { if (_.isEmpty(input.name)) { // Auto-generated getters don't have parameter names - input.name = 'index'; + input.name = `index_${i}`; } }); // This will make templates simpler |