mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 01:39:44 +01:00
Linting
This commit is contained in:
parent
62f2aebe1d
commit
5120cfdff3
@ -40,7 +40,7 @@ function sanitizeDecimal (val) {
|
||||
// sanitizeValue('.200') -> '0.200'
|
||||
// sanitizeValue('a.b.1.c,89.123') -> '0.189123'
|
||||
function sanitizeValue (value) {
|
||||
let [,integer, point, decimal] = (/([^.]*)([.]?)([^.]*)/).exec(value)
|
||||
let [integer, point, decimal] = (/([^.]*)([.]?)([^.]*)/).exec(value)
|
||||
|
||||
integer = sanitizeInteger(integer) || '0'
|
||||
decimal = sanitizeDecimal(decimal)
|
||||
|
@ -115,7 +115,7 @@ CustomizeGasModal.prototype.validate = function ({ gasTotal, gasLimit }) {
|
||||
} = this.props
|
||||
|
||||
let error = null
|
||||
|
||||
|
||||
const balanceIsSufficient = isBalanceSufficient({
|
||||
amount,
|
||||
gasTotal,
|
||||
|
@ -7,7 +7,7 @@ const {
|
||||
calcTokenAmount,
|
||||
} = require('../../token-util')
|
||||
|
||||
function isBalanceSufficient({
|
||||
function isBalanceSufficient ({
|
||||
amount = '0x0',
|
||||
gasTotal = '0x0',
|
||||
balance,
|
||||
@ -39,7 +39,7 @@ function isBalanceSufficient({
|
||||
return balanceIsSufficient
|
||||
}
|
||||
|
||||
function isTokenBalanceSufficient({
|
||||
function isTokenBalanceSufficient ({
|
||||
amount = '0x0',
|
||||
tokenBalance,
|
||||
decimals,
|
||||
|
@ -151,7 +151,7 @@ const subtractCurrencies = (a, b, options = {}) => {
|
||||
bBase,
|
||||
...conversionOptions
|
||||
} = options
|
||||
const value = (new BigNumber(a, aBase)).minus(b, bBase);
|
||||
const value = (new BigNumber(a, aBase)).minus(b, bBase)
|
||||
|
||||
return converter({
|
||||
value,
|
||||
@ -183,7 +183,7 @@ const conversionGreaterThan = (
|
||||
) => {
|
||||
const firstValue = converter({ ...firstProps })
|
||||
const secondValue = converter({ ...secondProps })
|
||||
|
||||
|
||||
return firstValue.gt(secondValue)
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ SendTransactionScreen.prototype.componentWillMount = function () {
|
||||
.all([
|
||||
getGasPrice(),
|
||||
estimateGas(estimateGasParams),
|
||||
tokenContract && tokenContract.balanceOf(from.address)
|
||||
tokenContract && tokenContract.balanceOf(from.address),
|
||||
])
|
||||
.then(([gasPrice, gas, usersToken]) => {
|
||||
|
||||
@ -352,7 +352,7 @@ SendTransactionScreen.prototype.validateAmount = function (value) {
|
||||
let amountError = null
|
||||
|
||||
const sufficientBalance = isBalanceSufficient({
|
||||
amount: selectedToken ? '0x0' : amount,
|
||||
amount: selectedToken ? '0x0' : amount,
|
||||
gasTotal,
|
||||
balance,
|
||||
primaryCurrency,
|
||||
@ -395,7 +395,7 @@ SendTransactionScreen.prototype.renderAmountRow = function () {
|
||||
amount,
|
||||
} = this.props
|
||||
return h('div.send-v2__form-row', [
|
||||
|
||||
|
||||
h('div.send-v2__form-label', [
|
||||
'Amount:',
|
||||
this.renderErrorMessage('amount'),
|
||||
|
Loading…
Reference in New Issue
Block a user