From 0a94762d16183d82cd6f13e08b64591ddc430b95 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Wed, 6 Dec 2017 15:46:06 +0100 Subject: [PATCH] Use TokenValue to format tokens --- src/MethodDecoding/methodDecoding.js | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/MethodDecoding/methodDecoding.js b/src/MethodDecoding/methodDecoding.js index dafc706..2d9c3e1 100644 --- a/src/MethodDecoding/methodDecoding.js +++ b/src/MethodDecoding/methodDecoding.js @@ -23,6 +23,7 @@ import { connect } from 'react-redux'; import { TypedInput, InputAddress } from '../Form'; import Loading from '../Loading'; +import TokenValue from './tokenValue'; import MethodDecodingStore from './methodDecodingStore'; import { ASCII_INPUT, TOKEN_METHODS } from './constants'; @@ -334,7 +335,7 @@ class MethodDecoding extends Component { } renderTokenAction () { - const { historic } = this.props; + const { historic, token } = this.props; const { methodSignature, methodInputs } = this.state; const [to, value] = methodInputs; const address = to.value; @@ -351,7 +352,11 @@ class MethodDecoding extends Component { historic, value: ( - { this.renderTokenValue(value.value) } + ), address: this.renderAddressName(address) @@ -595,16 +600,6 @@ class MethodDecoding extends Component { return inputs; } - renderTokenValue (value) { - const { token } = this.props; - - return ( - - { value.div(token.format).toFormat(5) } { token.tag } - - ); - } - renderEtherValue (value) { const { api } = this.context; const ether = api.util.fromWei(value);