From 9ed744a7a444df7b3595266254bd8eec6213bf81 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Fri, 2 Feb 2018 12:41:58 -0500 Subject: [PATCH] simplify inputParametersDeclarationToString code by using array.map --- src/app/execution/txHelper.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/app/execution/txHelper.js b/src/app/execution/txHelper.js index b00f565537..f11a9247e9 100644 --- a/src/app/execution/txHelper.js +++ b/src/app/execution/txHelper.js @@ -114,15 +114,8 @@ module.exports = { }, inputParametersDeclarationToString: function (abiinputs) { - var inputs = '' - if (abiinputs) { - abiinputs.forEach(function (i, inp) { - if (inputs !== '') { - inputs += ', ' - } - inputs += inp.type + ' ' + inp.name - }) - } - return inputs + var inputs = (abiinputs || []).map((inp) => inp.type + ' ' + inp.name) + return inputs.join(', ') } + }