use parseFunctionParams

pull/5370/head
yann300 3 years ago committed by David Disu
parent 3b21799350
commit 6512965f77
  1. 8
      libs/remix-lib/src/execution/txFormat.ts

@ -61,11 +61,9 @@ export function encodeParams (params, funAbi, callback) {
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
const args = '[' + params + ']'
funArgs = JSON.parse(args)
if (params.length > 0) {
funArgs = parseFunctionParams(params)
}
} catch (e) {
return callback('Error encoding arguments: ' + e)
}

Loading…
Cancel
Save