const Component = require('react').Component const h = require('react-hyperscript') const connect = require('react-redux').connect const inherits = require('util').inherits const formatBalance = require('../util').formatBalance const generateBalanceObject = require('../util').generateBalanceObject const Tooltip = require('./tooltip.js') const FiatValue = require('./fiat-value.js') module.exports = connect(mapStateToProps)(EthBalanceComponent) function mapStateToProps (state) { return { ticker: state.metamask.ticker, } } inherits(EthBalanceComponent, Component) function EthBalanceComponent () { Component.call(this) } EthBalanceComponent.prototype.render = function () { var props = this.props let { value } = props const { ticker } = props var style = props.style var needsParse = this.props.needsParse !== undefined ? this.props.needsParse : true value = value ? formatBalance(value, 6, needsParse, ticker) : '...' var width = props.width return ( h('.ether-balance.ether-balance-amount', { style: style, }, [ h('div', { style: { display: 'inline', width: width, }, }, this.renderBalance(value)), ]) ) } EthBalanceComponent.prototype.renderBalance = function (value) { var props = this.props if (value === 'None') return value if (value === '...') return value var balanceObj = generateBalanceObject(value, props.shorten ? 1 : 3) var balance var splitBalance = value.split(' ') var ethNumber = splitBalance[0] var ethSuffix = splitBalance[1] const showFiat = 'showFiat' in props ? props.showFiat : true if (props.shorten) { balance = balanceObj.shortBalance } else { balance = balanceObj.balance } var label = balanceObj.label return ( h(Tooltip, { position: 'bottom', title: `${ethNumber} ${ethSuffix}`, }, h('div.flex-column', [ h('.flex-row', { style: { alignItems: 'flex-end', lineHeight: '13px', fontFamily: 'Montserrat Light', textRendering: 'geometricPrecision', }, }, [ h('div', { style: { width: '100%', textAlign: 'right', }, }, this.props.incoming ? `+${balance}` : balance), h('div', { style: { color: ' #AEAEAE', fontSize: '12px', marginLeft: '5px', }, }, label), ]), showFiat ? h(FiatValue, { value: props.value }) : null, ])) ) } value='wip/yenlin/planner'>wip/yenlin/planner DEXON full node (https://github.com/dexon-foundation/dexon)
aboutsummaryrefslogtreecommitdiffstats
path: root/tests/rlp_test_util.go
blob: 58ef8a6428c02b9f3854706cedb0bd7e65f6dd30 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159