convert hex to decimal ether unit value

pull/1/head
yann300 7 years ago
parent 94e01f8ace
commit 11913d315a
  1. 4
      src/app/execution/txRunner.js

@ -6,6 +6,7 @@ var BN = ethJSUtil.BN
var executionContext = require('../../execution-context') var executionContext = require('../../execution-context')
var modalDialog = require('../ui/modaldialog') var modalDialog = require('../ui/modaldialog')
var yo = require('yo-yo') var yo = require('yo-yo')
var typeConversion = require('../../lib/typeConversion')
var csjs = require('csjs-inject') var csjs = require('csjs-inject')
var remixLib = require('remix-lib') var remixLib = require('remix-lib')
var styleGuide = remixLib.ui.styleGuide var styleGuide = remixLib.ui.styleGuide
@ -215,6 +216,7 @@ function run (self, tx, stamp, callback) {
} }
function confirmDialog (tx, gasEstimation, self) { function confirmDialog (tx, gasEstimation, self) {
var amount = executionContext.web3().fromWei(typeConversion.toInt(tx.value), 'ether')
var input = yo`<input id='confirmsetting' type="checkbox">` var input = yo`<input id='confirmsetting' type="checkbox">`
return yo` return yo`
<div> <div>
@ -222,7 +224,7 @@ function confirmDialog (tx, gasEstimation, self) {
<div class=${css.txInfoBox}> <div class=${css.txInfoBox}>
<div>From: ${tx.from}</div> <div>From: ${tx.from}</div>
<div>To: ${tx.to ? tx.to : '(Contract Creation)'}</div> <div>To: ${tx.to ? tx.to : '(Contract Creation)'}</div>
<div>Amount: ${tx.value}</div> <div>Amount: ${amount} Ether</div>
<div>Gas estimation: ${gasEstimation}</div> <div>Gas estimation: ${gasEstimation}</div>
<div>Gas limit: ${tx.gas}</div> <div>Gas limit: ${tx.gas}</div>
<div>Data:</div> <div>Data:</div>

Loading…
Cancel
Save