move typeConversion into remixLib

pull/1/head
Iuri Matias 7 years ago
parent ca7de9a93a
commit d16d25e6d4
  1. 2
      src/app/execution/txLogger.js
  2. 42
      src/app/execution/typeConversion.js
  3. 2
      src/universal-dapp.js

@ -12,7 +12,7 @@ var EventManager = remixLib.EventManager
var helper = require('../../lib/helper') var helper = require('../../lib/helper')
var executionContext = require('../../execution-context') var executionContext = require('../../execution-context')
var modalDialog = require('../ui/modal-dialog-custom') var modalDialog = require('../ui/modal-dialog-custom')
var typeConversion = require('./typeConversion') var typeConversion = remixLib.execution.typeConversion
var css = csjs` var css = csjs`
.log { .log {

@ -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
}
}

@ -17,7 +17,7 @@ var modalCustom = require('./app/ui/modal-dialog-custom')
var uiUtil = require('./app/ui/util') var uiUtil = require('./app/ui/util')
var modalDialog = require('./app/ui/modaldialog') var modalDialog = require('./app/ui/modaldialog')
var typeConversion = require('./app/execution/typeConversion') var typeConversion = remixLib.execution.typeConversion
var confirmDialog = require('./app/execution/confirmDialog') var confirmDialog = require('./app/execution/confirmDialog')
/* /*

Loading…
Cancel
Save