aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2016-08-23 02:58:59 +0800
committerKevin Serrano <kevgagser@gmail.com>2016-08-23 02:58:59 +0800
commitcec88cc9acb4711c8227502f3477a55b3800ea22 (patch)
tree4af721d931b884d6207b42d18e577b627c246735
parent7a466697d30019a4a1703a19b60ecc78fd063f5d (diff)
parent3756384da6cb7d1566271cb99ec561d3b051a4ac (diff)
downloadtangerine-wallet-browser-cec88cc9acb4711c8227502f3477a55b3800ea22.tar.gz
tangerine-wallet-browser-cec88cc9acb4711c8227502f3477a55b3800ea22.tar.zst
tangerine-wallet-browser-cec88cc9acb4711c8227502f3477a55b3800ea22.zip
Merge branch 'master' into fox-sub
-rw-r--r--CHANGELOG.md2
-rw-r--r--app/manifest.json2
-rw-r--r--test/unit/util_test.js7
-rw-r--r--ui/app/components/eth-balance.js11
-rw-r--r--ui/app/components/shift-list-item.js2
-rw-r--r--ui/app/util.js4
6 files changed, 19 insertions, 9 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2d9e9ca54..bf5255497 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,8 @@
## Current Master
+## 2.9.0 2016-08-22
+
- Added ShapeShift to the transaction history
- Added affiliate key to Shapeshift requests
- Added feature to reflect current conversion rates of current vault balance.
diff --git a/app/manifest.json b/app/manifest.json
index a4953542e..09bc9eb37 100644
--- a/app/manifest.json
+++ b/app/manifest.json
@@ -1,7 +1,7 @@
{
"name": "MetaMask",
"short_name": "Metamask",
- "version": "2.8.0",
+ "version": "2.9.0",
"manifest_version": 2,
"description": "Ethereum Browser Extension",
"icons": {
diff --git a/test/unit/util_test.js b/test/unit/util_test.js
index 9a3963ac1..45e545e8e 100644
--- a/test/unit/util_test.js
+++ b/test/unit/util_test.js
@@ -156,7 +156,12 @@ describe('util', function() {
var result = util.formatBalance(input)
assert.equal(result, '0.00032 ETH')
})
-
+ it('should not parse the balance and return value with 2 decimal points with ETH at the end', function() {
+ var value = '1.2456789'
+ var needsParse = false
+ var result = util.formatBalance(value, 2, needsParse)
+ assert.equal(result, '1.24 ETH')
+ })
})
describe('normalizing values', function() {
diff --git a/ui/app/components/eth-balance.js b/ui/app/components/eth-balance.js
index bb2dc9010..498873faa 100644
--- a/ui/app/components/eth-balance.js
+++ b/ui/app/components/eth-balance.js
@@ -15,8 +15,8 @@ function EthBalanceComponent () {
EthBalanceComponent.prototype.render = function () {
var state = this.props
var style = state.style
-
- const value = formatBalance(state.value, 6)
+ var needsParse = this.props.needsParse !== undefined ? this.props.needsParse : true
+ const value = formatBalance(state.value, 6, needsParse)
var width = state.width
return (
@@ -29,12 +29,13 @@ EthBalanceComponent.prototype.render = function () {
display: 'inline',
width: width,
},
- }, this.renderBalance(value, state)),
+ }, this.renderBalance(value)),
])
)
}
-EthBalanceComponent.prototype.renderBalance = function (value, state) {
+EthBalanceComponent.prototype.renderBalance = function (value) {
+ var state = this.props
if (value === 'None') return value
var balanceObj = generateBalanceObject(value, state.shorten ? 1 : 3)
var balance
@@ -68,7 +69,7 @@ EthBalanceComponent.prototype.renderBalance = function (value, state) {
width: '100%',
textAlign: 'right',
},
- }, balance),
+ }, this.props.incoming ? `+${balance}` : balance),
h('div', {
style: {
color: ' #AEAEAE',
diff --git a/ui/app/components/shift-list-item.js b/ui/app/components/shift-list-item.js
index 9d5340447..11e11cd37 100644
--- a/ui/app/components/shift-list-item.js
+++ b/ui/app/components/shift-list-item.js
@@ -99,6 +99,8 @@ ShiftListItem.prototype.renderUtilComponents = function () {
value: `${props.response.outgoingCoin}`,
width: '55px',
shorten: true,
+ needsParse: false,
+ incoming: true,
style: {
fontSize: '15px',
color: '#01888C',
diff --git a/ui/app/util.js b/ui/app/util.js
index 2d1c753dd..e4b77e2bc 100644
--- a/ui/app/util.js
+++ b/ui/app/util.js
@@ -92,8 +92,8 @@ function parseBalance (balance) {
// Takes wei hex, returns an object with three properties.
// Its "formatted" property is what we generally use to render values.
-function formatBalance (balance, decimalsToKeep) {
- var parsed = parseBalance(balance)
+function formatBalance (balance, decimalsToKeep, needsParse = true) {
+ var parsed = needsParse ? parseBalance(balance) : balance.split('.')
var beforeDecimal = parsed[0]
var afterDecimal = parsed[1]
var formatted = 'None'