mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Merge branch 'master' into fox-sub
This commit is contained in:
commit
cec88cc9ac
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
## Current Master
|
## Current Master
|
||||||
|
|
||||||
|
## 2.9.0 2016-08-22
|
||||||
|
|
||||||
- Added ShapeShift to the transaction history
|
- Added ShapeShift to the transaction history
|
||||||
- Added affiliate key to Shapeshift requests
|
- Added affiliate key to Shapeshift requests
|
||||||
- Added feature to reflect current conversion rates of current vault balance.
|
- Added feature to reflect current conversion rates of current vault balance.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "MetaMask",
|
"name": "MetaMask",
|
||||||
"short_name": "Metamask",
|
"short_name": "Metamask",
|
||||||
"version": "2.8.0",
|
"version": "2.9.0",
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"description": "Ethereum Browser Extension",
|
"description": "Ethereum Browser Extension",
|
||||||
"icons": {
|
"icons": {
|
||||||
|
@ -156,7 +156,12 @@ describe('util', function() {
|
|||||||
var result = util.formatBalance(input)
|
var result = util.formatBalance(input)
|
||||||
assert.equal(result, '0.00032 ETH')
|
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() {
|
describe('normalizing values', function() {
|
||||||
|
@ -15,8 +15,8 @@ function EthBalanceComponent () {
|
|||||||
EthBalanceComponent.prototype.render = function () {
|
EthBalanceComponent.prototype.render = function () {
|
||||||
var state = this.props
|
var state = this.props
|
||||||
var style = state.style
|
var style = state.style
|
||||||
|
var needsParse = this.props.needsParse !== undefined ? this.props.needsParse : true
|
||||||
const value = formatBalance(state.value, 6)
|
const value = formatBalance(state.value, 6, needsParse)
|
||||||
var width = state.width
|
var width = state.width
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -29,12 +29,13 @@ EthBalanceComponent.prototype.render = function () {
|
|||||||
display: 'inline',
|
display: 'inline',
|
||||||
width: width,
|
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
|
if (value === 'None') return value
|
||||||
var balanceObj = generateBalanceObject(value, state.shorten ? 1 : 3)
|
var balanceObj = generateBalanceObject(value, state.shorten ? 1 : 3)
|
||||||
var balance
|
var balance
|
||||||
@ -68,7 +69,7 @@ EthBalanceComponent.prototype.renderBalance = function (value, state) {
|
|||||||
width: '100%',
|
width: '100%',
|
||||||
textAlign: 'right',
|
textAlign: 'right',
|
||||||
},
|
},
|
||||||
}, balance),
|
}, this.props.incoming ? `+${balance}` : balance),
|
||||||
h('div', {
|
h('div', {
|
||||||
style: {
|
style: {
|
||||||
color: ' #AEAEAE',
|
color: ' #AEAEAE',
|
||||||
|
@ -99,6 +99,8 @@ ShiftListItem.prototype.renderUtilComponents = function () {
|
|||||||
value: `${props.response.outgoingCoin}`,
|
value: `${props.response.outgoingCoin}`,
|
||||||
width: '55px',
|
width: '55px',
|
||||||
shorten: true,
|
shorten: true,
|
||||||
|
needsParse: false,
|
||||||
|
incoming: true,
|
||||||
style: {
|
style: {
|
||||||
fontSize: '15px',
|
fontSize: '15px',
|
||||||
color: '#01888C',
|
color: '#01888C',
|
||||||
|
@ -92,8 +92,8 @@ function parseBalance (balance) {
|
|||||||
|
|
||||||
// Takes wei hex, returns an object with three properties.
|
// Takes wei hex, returns an object with three properties.
|
||||||
// Its "formatted" property is what we generally use to render values.
|
// Its "formatted" property is what we generally use to render values.
|
||||||
function formatBalance (balance, decimalsToKeep) {
|
function formatBalance (balance, decimalsToKeep, needsParse = true) {
|
||||||
var parsed = parseBalance(balance)
|
var parsed = needsParse ? parseBalance(balance) : balance.split('.')
|
||||||
var beforeDecimal = parsed[0]
|
var beforeDecimal = parsed[0]
|
||||||
var afterDecimal = parsed[1]
|
var afterDecimal = parsed[1]
|
||||||
var formatted = 'None'
|
var formatted = 'None'
|
||||||
|
Loading…
Reference in New Issue
Block a user