mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
yarn lint --fix
This commit is contained in:
parent
1e4f8e68e0
commit
16e6103a68
@ -17,8 +17,8 @@ module.exports = {
|
|||||||
|
|
||||||
// functions that handle normalizing of that key in txParams
|
// functions that handle normalizing of that key in txParams
|
||||||
const normalizers = {
|
const normalizers = {
|
||||||
from: (from, LowerCase = true) => LowerCase ? addHexPrefix(from).toLowerCase() : addHexPrefix(from),
|
from: (from, LowerCase = true) => (LowerCase ? addHexPrefix(from).toLowerCase() : addHexPrefix(from)),
|
||||||
to: (to, LowerCase = true) => LowerCase ? addHexPrefix(to).toLowerCase() : addHexPrefix(to),
|
to: (to, LowerCase = true) => (LowerCase ? addHexPrefix(to).toLowerCase() : addHexPrefix(to)),
|
||||||
nonce: nonce => addHexPrefix(nonce),
|
nonce: nonce => addHexPrefix(nonce),
|
||||||
value: value => addHexPrefix(value),
|
value: value => addHexPrefix(value),
|
||||||
data: data => addHexPrefix(data),
|
data: data => addHexPrefix(data),
|
||||||
|
@ -30,7 +30,7 @@ describe('#createPendingNonceMiddleware', function () {
|
|||||||
|
|
||||||
describe('#createPendingTxMiddleware', function () {
|
describe('#createPendingTxMiddleware', function () {
|
||||||
let returnUndefined = true
|
let returnUndefined = true
|
||||||
const getPendingTransactionByHash = () => returnUndefined ? undefined : txMetaStub
|
const getPendingTransactionByHash = () => (returnUndefined ? undefined : txMetaStub)
|
||||||
const address = '0xF231D46dD78806E1DD93442cf33C7671f8538748'
|
const address = '0xF231D46dD78806E1DD93442cf33C7671f8538748'
|
||||||
const pendingTxMiddleware = createPendingTxMiddleware({ getPendingTransactionByHash })
|
const pendingTxMiddleware = createPendingTxMiddleware({ getPendingTransactionByHash })
|
||||||
const spec = {
|
const spec = {
|
||||||
|
@ -141,7 +141,7 @@ describe('GasModalPageContainer Component', function () {
|
|||||||
fetchBasicGasAndTimeEstimates={propsMethodSpies.fetchBasicGasAndTimeEstimates}
|
fetchBasicGasAndTimeEstimates={propsMethodSpies.fetchBasicGasAndTimeEstimates}
|
||||||
fetchGasEstimates={propsMethodSpies.fetchGasEstimates}
|
fetchGasEstimates={propsMethodSpies.fetchGasEstimates}
|
||||||
/>
|
/>
|
||||||
), { context: { t: (str1, str2) => str2 ? str1 + str2 : str1 } })
|
), { context: { t: (str1, str2) => (str2 ? str1 + str2 : str1) } })
|
||||||
const { tabsComponent } = renderTabsWrapperTester.find(PageContainer).props()
|
const { tabsComponent } = renderTabsWrapperTester.find(PageContainer).props()
|
||||||
assert.equal(tabsComponent, 'mockTabs')
|
assert.equal(tabsComponent, 'mockTabs')
|
||||||
GasModalPageContainer.prototype.renderTabs.restore()
|
GasModalPageContainer.prototype.renderTabs.restore()
|
||||||
|
@ -44,7 +44,7 @@ describe('TransactionActivityLog Component', () => {
|
|||||||
onRetry={() => {}}
|
onRetry={() => {}}
|
||||||
primaryTransactionStatus="confirmed"
|
primaryTransactionStatus="confirmed"
|
||||||
/>,
|
/>,
|
||||||
{ context: { t: (str1, str2) => str2 ? str1 + str2 : str1 } }
|
{ context: { t: (str1, str2) => (str2 ? str1 + str2 : str1) } }
|
||||||
)
|
)
|
||||||
|
|
||||||
assert.ok(wrapper.hasClass('transaction-activity-log'))
|
assert.ok(wrapper.hasClass('transaction-activity-log'))
|
||||||
@ -92,7 +92,7 @@ describe('TransactionActivityLog Component', () => {
|
|||||||
primaryTransactionStatus="pending"
|
primaryTransactionStatus="pending"
|
||||||
isEarliestNonce
|
isEarliestNonce
|
||||||
/>,
|
/>,
|
||||||
{ context: { t: (str1, str2) => str2 ? str1 + str2 : str1 } }
|
{ context: { t: (str1, str2) => (str2 ? str1 + str2 : str1) } }
|
||||||
)
|
)
|
||||||
|
|
||||||
assert.ok(wrapper.hasClass('transaction-activity-log'))
|
assert.ok(wrapper.hasClass('transaction-activity-log'))
|
||||||
@ -141,7 +141,7 @@ describe('TransactionActivityLog Component', () => {
|
|||||||
primaryTransactionStatus="pending"
|
primaryTransactionStatus="pending"
|
||||||
isEarliestNonce={false}
|
isEarliestNonce={false}
|
||||||
/>,
|
/>,
|
||||||
{ context: { t: (str1, str2) => str2 ? str1 + str2 : str1 } }
|
{ context: { t: (str1, str2) => (str2 ? str1 + str2 : str1) } }
|
||||||
)
|
)
|
||||||
|
|
||||||
assert.ok(wrapper.hasClass('transaction-activity-log'))
|
assert.ok(wrapper.hasClass('transaction-activity-log'))
|
||||||
|
@ -24,7 +24,7 @@ describe('TransactionBreakdown Component', () => {
|
|||||||
transaction={transaction}
|
transaction={transaction}
|
||||||
className="test-class"
|
className="test-class"
|
||||||
/>,
|
/>,
|
||||||
{ context: { t: (str1, str2) => str2 ? str1 + str2 : str1 } }
|
{ context: { t: (str1, str2) => (str2 ? str1 + str2 : str1) } }
|
||||||
)
|
)
|
||||||
|
|
||||||
assert.ok(wrapper.hasClass('transaction-breakdown'))
|
assert.ok(wrapper.hasClass('transaction-breakdown'))
|
||||||
|
@ -13,7 +13,7 @@ describe('TransactionBreakdownRow Component', () => {
|
|||||||
>
|
>
|
||||||
Test
|
Test
|
||||||
</TransactionBreakdownRow>,
|
</TransactionBreakdownRow>,
|
||||||
{ context: { t: (str1, str2) => str2 ? str1 + str2 : str1 } }
|
{ context: { t: (str1, str2) => (str2 ? str1 + str2 : str1) } }
|
||||||
)
|
)
|
||||||
|
|
||||||
assert.ok(wrapper.hasClass('transaction-breakdown-row'))
|
assert.ok(wrapper.hasClass('transaction-breakdown-row'))
|
||||||
@ -29,7 +29,7 @@ describe('TransactionBreakdownRow Component', () => {
|
|||||||
>
|
>
|
||||||
<Button onClick={() => {}} >Button</Button>
|
<Button onClick={() => {}} >Button</Button>
|
||||||
</TransactionBreakdownRow>,
|
</TransactionBreakdownRow>,
|
||||||
{ context: { t: (str1, str2) => str2 ? str1 + str2 : str1 } }
|
{ context: { t: (str1, str2) => (str2 ? str1 + str2 : str1) } }
|
||||||
)
|
)
|
||||||
|
|
||||||
assert.ok(wrapper.hasClass('transaction-breakdown-row'))
|
assert.ok(wrapper.hasClass('transaction-breakdown-row'))
|
||||||
|
@ -33,7 +33,7 @@ describe('TransactionListItemDetails Component', () => {
|
|||||||
<TransactionListItemDetails
|
<TransactionListItemDetails
|
||||||
transactionGroup={transactionGroup}
|
transactionGroup={transactionGroup}
|
||||||
/>,
|
/>,
|
||||||
{ context: { t: (str1, str2) => str2 ? str1 + str2 : str1 } }
|
{ context: { t: (str1, str2) => (str2 ? str1 + str2 : str1) } }
|
||||||
)
|
)
|
||||||
|
|
||||||
assert.ok(wrapper.hasClass('transaction-list-item-details'))
|
assert.ok(wrapper.hasClass('transaction-list-item-details'))
|
||||||
@ -72,7 +72,7 @@ describe('TransactionListItemDetails Component', () => {
|
|||||||
transactionGroup={transactionGroup}
|
transactionGroup={transactionGroup}
|
||||||
showSpeedUp
|
showSpeedUp
|
||||||
/>,
|
/>,
|
||||||
{ context: { t: (str1, str2) => str2 ? str1 + str2 : str1 } }
|
{ context: { t: (str1, str2) => (str2 ? str1 + str2 : str1) } }
|
||||||
)
|
)
|
||||||
|
|
||||||
assert.ok(wrapper.hasClass('transaction-list-item-details'))
|
assert.ok(wrapper.hasClass('transaction-list-item-details'))
|
||||||
@ -104,7 +104,7 @@ describe('TransactionListItemDetails Component', () => {
|
|||||||
<TransactionListItemDetails
|
<TransactionListItemDetails
|
||||||
transactionGroup={transactionGroup}
|
transactionGroup={transactionGroup}
|
||||||
/>,
|
/>,
|
||||||
{ context: { t: (str1, str2) => str2 ? str1 + str2 : str1 } }
|
{ context: { t: (str1, str2) => (str2 ? str1 + str2 : str1) } }
|
||||||
)
|
)
|
||||||
|
|
||||||
assert.ok(wrapper.hasClass('transaction-list-item-details'))
|
assert.ok(wrapper.hasClass('transaction-list-item-details'))
|
||||||
@ -139,7 +139,7 @@ describe('TransactionListItemDetails Component', () => {
|
|||||||
<TransactionListItemDetails
|
<TransactionListItemDetails
|
||||||
transactionGroup={transactionGroup}
|
transactionGroup={transactionGroup}
|
||||||
/>,
|
/>,
|
||||||
{ context: { t: (str1, str2) => str2 ? str1 + str2 : str1 } }
|
{ context: { t: (str1, str2) => (str2 ? str1 + str2 : str1) } }
|
||||||
)
|
)
|
||||||
|
|
||||||
assert.ok(wrapper.hasClass('transaction-list-item-details'))
|
assert.ok(wrapper.hasClass('transaction-list-item-details'))
|
||||||
|
@ -15,7 +15,7 @@ const historySpies = {
|
|||||||
push: sinon.spy(),
|
push: sinon.spy(),
|
||||||
}
|
}
|
||||||
|
|
||||||
const t = (str1, str2) => str2 ? str1 + str2 : str1
|
const t = (str1, str2) => (str2 ? str1 + str2 : str1)
|
||||||
const metricsEvent = () => ({})
|
const metricsEvent = () => ({})
|
||||||
|
|
||||||
describe('TransactionViewBalance Component', () => {
|
describe('TransactionViewBalance Component', () => {
|
||||||
|
@ -353,7 +353,7 @@ function quartiles (data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function inliersByIQR (data, prop) {
|
function inliersByIQR (data, prop) {
|
||||||
const { lowerQuartile, upperQuartile } = quartiles(data.map(d => prop ? d[prop] : d))
|
const { lowerQuartile, upperQuartile } = quartiles(data.map(d => (prop ? d[prop] : d)))
|
||||||
const IQR = upperQuartile - lowerQuartile
|
const IQR = upperQuartile - lowerQuartile
|
||||||
const lowerBound = lowerQuartile - 1.5 * IQR
|
const lowerBound = lowerQuartile - 1.5 * IQR
|
||||||
const upperBound = upperQuartile + 1.5 * IQR
|
const upperBound = upperQuartile + 1.5 * IQR
|
||||||
|
@ -40,10 +40,10 @@ const casedContractMap = Object.keys(contractMap).reduce((acc, base) => {
|
|||||||
}, {})
|
}, {})
|
||||||
|
|
||||||
let customNonceValue = ''
|
let customNonceValue = ''
|
||||||
const customNonceMerge = txData => customNonceValue ? ({
|
const customNonceMerge = txData => (customNonceValue ? ({
|
||||||
...txData,
|
...txData,
|
||||||
customNonceValue,
|
customNonceValue,
|
||||||
}) : txData
|
}) : txData)
|
||||||
|
|
||||||
const mapStateToProps = (state, ownProps) => {
|
const mapStateToProps = (state, ownProps) => {
|
||||||
const { toAddress: propsToAddress, customTxParamsData, match: { params = {} } } = ownProps
|
const { toAddress: propsToAddress, customTxParamsData, match: { params = {} } } = ownProps
|
||||||
|
@ -26,7 +26,7 @@ describe('SendHeader Component', function () {
|
|||||||
history={historySpies}
|
history={historySpies}
|
||||||
titleKey="mockTitleKey"
|
titleKey="mockTitleKey"
|
||||||
/>
|
/>
|
||||||
), { context: { t: (str1, str2) => str2 ? str1 + str2 : str1 } })
|
), { context: { t: (str1, str2) => (str2 ? str1 + str2 : str1) } })
|
||||||
})
|
})
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
|
@ -331,7 +331,7 @@ function estimateGasPriceFromRecentBlocks (recentBlocks) {
|
|||||||
return parseInt(next, 16) < parseInt(currentLowest, 16) ? next : currentLowest
|
return parseInt(next, 16) < parseInt(currentLowest, 16) ? next : currentLowest
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.sort((a, b) => parseInt(a, 16) > parseInt(b, 16) ? 1 : -1)
|
.sort((a, b) => (parseInt(a, 16) > parseInt(b, 16) ? 1 : -1))
|
||||||
|
|
||||||
return lowestPrices[Math.floor(lowestPrices.length / 2)]
|
return lowestPrices[Math.floor(lowestPrices.length / 2)]
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,6 @@ import { shallow } from 'enzyme'
|
|||||||
|
|
||||||
export default function (jsxComponent) {
|
export default function (jsxComponent) {
|
||||||
return shallow(jsxComponent, {
|
return shallow(jsxComponent, {
|
||||||
context: { t: (str1, str2) => str2 ? str1 + str2 : str1 },
|
context: { t: (str1, str2) => (str2 ? str1 + str2 : str1) },
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user