Unverified Commit f8b6ccba authored by Iuri Matias's avatar Iuri Matias Committed by GitHub

Merge pull request #1031 from ethereum/refactor/remove_jquery_dependency

minor refactor: replace jquery util with native js
parents 1cb05f7d 9ed744a7
'use strict' 'use strict'
var $ = require('jquery')
var ethJSABI = require('ethereumjs-abi') var ethJSABI = require('ethereumjs-abi')
var ethJSUtil = require('ethereumjs-util') var ethJSUtil = require('ethereumjs-util')
var BN = ethJSUtil.BN var BN = ethJSUtil.BN
...@@ -55,7 +54,7 @@ module.exports = { ...@@ -55,7 +54,7 @@ module.exports = {
data = Buffer.from(dataHex, 'hex') data = Buffer.from(dataHex, 'hex')
} else { } else {
try { try {
funArgs = $.parseJSON('[' + params + ']') funArgs = JSON.parse('[' + params + ']')
} catch (e) { } catch (e) {
callback('Error encoding arguments: ' + e) callback('Error encoding arguments: ' + e)
return return
......
'use strict' 'use strict'
var ethJSABI = require('ethereumjs-abi') var ethJSABI = require('ethereumjs-abi')
var $ = require('jquery')
module.exports = { module.exports = {
encodeParams: function (funABI, args) { encodeParams: function (funABI, args) {
...@@ -115,15 +114,8 @@ module.exports = { ...@@ -115,15 +114,8 @@ module.exports = {
}, },
inputParametersDeclarationToString: function (abiinputs) { inputParametersDeclarationToString: function (abiinputs) {
var inputs = '' var inputs = (abiinputs || []).map((inp) => inp.type + ' ' + inp.name)
if (abiinputs) { return inputs.join(', ')
$.each(abiinputs, function (i, inp) {
if (inputs !== '') {
inputs += ', '
}
inputs += inp.type + ' ' + inp.name
})
}
return inputs
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment