aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-02-06 23:37:07 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-02-07 09:27:47 +0800
commit600a2b40af0430d4037f86f6ffe21d6edf3fb166 (patch)
tree63a7d4b6df21f34c0ee2c26dd9a805ced4f45146 /packages
parenta7c51593e4e6bc514f4f975fdc6fb9207c52ac8e (diff)
downloaddexon-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.ts4
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