diff --git a/src/app/execution/txLogger.js b/src/app/execution/txLogger.js index f39bfb39a4..eedd4ebaa0 100644 --- a/src/app/execution/txLogger.js +++ b/src/app/execution/txLogger.js @@ -12,7 +12,7 @@ var EventManager = remixLib.EventManager var helper = require('../../lib/helper') var executionContext = require('../../execution-context') var modalDialog = require('../ui/modal-dialog-custom') -var typeConversion = require('./typeConversion') +var typeConversion = remixLib.execution.typeConversion var css = csjs` .log { diff --git a/src/app/execution/typeConversion.js b/src/app/execution/typeConversion.js deleted file mode 100644 index 1b5d879fc3..0000000000 --- a/src/app/execution/typeConversion.js +++ /dev/null @@ -1,42 +0,0 @@ -'use strict' -var ethJSUtil = require('ethereumjs-util') -var BN = ethJSUtil.BN - -module.exports = { - toInt: (h) => { - if (h.indexOf && h.indexOf('0x') === 0) { - return (new BN(h.replace('0x', ''), 16)).toString(10) - } else if (h.constructor && h.constructor.name === 'BigNumber' || BN.isBN(h)) { - return h.toString(10) - } - return h - }, - stringify: stringify -} - -function stringify (v) { - try { - if (v instanceof Array) { - var ret = [] - for (var k in v) { - ret.push(stringify(v[k])) - } - return ret - } else if (BN.isBN(v) || (v.constructor && v.constructor.name === 'BigNumber')) { - return v.toString(10) - } else if (v._isBuffer) { - return ethJSUtil.bufferToHex(v) - } else if (typeof v === 'object') { - var retObject = {} - for (var i in v) { - retObject[i] = stringify(v[i]) - } - return retObject - } else { - return v - } - } catch (e) { - console.log(e) - return v - } -} diff --git a/src/universal-dapp.js b/src/universal-dapp.js index e61048f933..3c17b939b3 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -17,7 +17,7 @@ var modalCustom = require('./app/ui/modal-dialog-custom') var uiUtil = require('./app/ui/util') var modalDialog = require('./app/ui/modaldialog') -var typeConversion = require('./app/execution/typeConversion') +var typeConversion = remixLib.execution.typeConversion var confirmDialog = require('./app/execution/confirmDialog') /*