From 600a2b40af0430d4037f86f6ffe21d6edf3fb166 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 6 Feb 2018 16:37:07 +0100 Subject: Add indices for index parameters so that their names don't collide --- packages/abi-gen/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/abi-gen') 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 -- cgit