|
|
@ -32,14 +32,8 @@ function runTab (opts, localRegistry) { |
|
|
|
var index = select.selectedIndex |
|
|
|
var index = select.selectedIndex |
|
|
|
var selectedUnit = select.querySelectorAll('option')[index].dataset.unit |
|
|
|
var selectedUnit = select.querySelectorAll('option')[index].dataset.unit |
|
|
|
var unit = 'ether' // default
|
|
|
|
var unit = 'ether' // default
|
|
|
|
if (selectedUnit === 'ether') { |
|
|
|
if (['ether', 'finney', 'gwei', 'wei'].indexOf(selectedUnit) >= 0) { |
|
|
|
unit = 'ether' |
|
|
|
unit = selectedUnit |
|
|
|
} else if (selectedUnit === 'finney') { |
|
|
|
|
|
|
|
unit = 'finney' |
|
|
|
|
|
|
|
} else if (selectedUnit === 'gwei') { |
|
|
|
|
|
|
|
unit = 'gwei' |
|
|
|
|
|
|
|
} else if (selectedUnit === 'wei') { |
|
|
|
|
|
|
|
unit = 'wei' |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
cb(null, executionContext.web3().toWei(number, unit)) |
|
|
|
cb(null, executionContext.web3().toWei(number, unit)) |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|