From 5b3d629d06b8e8e7759c84568d35f90ee9c89485 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 22 Feb 2018 15:11:26 +0100 Subject: [PATCH] double quoted number and hex string --- remix-lib/src/execution/txFormat.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/remix-lib/src/execution/txFormat.js b/remix-lib/src/execution/txFormat.js index ef0c87487a..8959de4215 100644 --- a/remix-lib/src/execution/txFormat.js +++ b/remix-lib/src/execution/txFormat.js @@ -51,6 +51,8 @@ module.exports = { data = Buffer.from(dataHex, 'hex') } else { try { + params = params.replace(/(^|,\s+|,)(\d+)(\s+,|,|$)/g, '$1"$2"$3') // replace non quoted number by quoted number + params = params.replace(/(^|,\s+|,)(0[xX][0-9a-fA-F]+)(\s+,|,|$)/g, '$1"$2"$3') // replace non quoted hex string by quoted hex string funArgs = JSON.parse('[' + params + ']') } catch (e) { callback('Error encoding arguments: ' + e)